rstudio/bookdown-demo

Environment snugshade undefined.

chipbrock opened this issue · 4 comments

I'm trying to build the demo-master in a new bookdown session. It fails on a MacBook pro, 2019. I similarly did this last night on a new MacBook air and have been running it happily. Both use Mac Texlive 2015. I've updated Pandoc. The R,r markdown, bookdown installations between the two computers are, as far as I can tell, the same. The MacBook air was created from the MacBook pro's Time Machine.

However, on the pro building the default bookdown-demo-master generates the tex error:

Environment snugshade undefined.

I've been a latex user for decades and my installations are the same and working. I use them daily.

The failed execution creates a bookbown-demo.tex file (that isn't produced in the working air's version?) It is a standalone book class file and fails at the \begin{Shaded} statement:

\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{install.packages}\NormalTok{(}\StringTok{"bookdown"}\NormalTok{)}
\CommentTok{# or the development version}
\CommentTok{# devtools::install_github("rstudio/bookdown")}
\end{Highlighting}
\end{Shaded}

the preamble of the produced tex file contains

\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}

The bookdown-minimal-master works fine.

Clearly this is a latex-installation issue and I surely not a bookdown issue...but any hints would be great. Log is below.

thanks
Ray Brock

==> rmarkdown::render_site(encoding = 'UTF-8')

|....... | 11%
inline R code fragments

|.............. | 22%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE

processing file: bookdown-demo.Rmd
|...................... | 33%
ordinary text without R code

|............................. | 44%
label: unnamed-chunk-2 (with options)
List of 1
$ include: logi FALSE

|.................................... | 56%
ordinary text without R code

|........................................... | 67%
label: nice-fig (with options)
List of 4
$ fig.cap : chr "Here is a nice figure!"
$ out.width: chr "80%"
$ fig.asp : num 0.75
$ fig.align: chr "center"

|................................................... | 78%
ordinary text without R code

|.......................................................... | 89%
label: nice-tab (with options)
List of 1
$ tidy: logi FALSE

|.................................................................| 100%
inline R code fragments

/usr/local/bin/pandoc +RTS -K512m -RTS bookdown-demo.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output bookdown-demo.html --email-obfuscation none --wrap preserve --standalone --section-divs --table-of-contents --toc-depth 3 --template /Library/Frameworks/R.framework/Versions/3.6/Resources/library/bookdown/templates/gitbook.html --highlight-style pygments --number-sections --css style.css --include-in-header /var/folders/20/z4dv530d5y52060q5hky1gkc0000gn/T//Rtmp7pCLn3/rmarkdown-str3bf4662d44ec.html --mathjax --filter /usr/local/bin/pandoc-citeproc
output file: bookdown-demo.knit.md

Output created: _book/index.html

processing file: bookdown-demo.Rmd
|....... | 11%
inline R code fragments

|.............. | 22%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE

|...................... | 33%
ordinary text without R code

|............................. | 44%
label: unnamed-chunk-2 (with options)
List of 1
$ include: logi FALSE

|.................................... | 56%
ordinary text without R code

|........................................... | 67%
label: nice-fig (with options)
List of 4
$ fig.cap : chr "Here is a nice figure!"
$ out.width: chr "80%"
$ fig.asp : num 0.75
$ fig.align: chr "center"

|................................................... | 78%
ordinary text without R code

|.......................................................... | 89%
label: nice-tab (with options)
List of 1
$ tidy: logi FALSE

|.................................................................| 100%
inline R code fragments

/usr/local/bin/pandoc +RTS -K512m -RTS bookdown-demo.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bookdown-demo.tex --table-of-contents --toc-depth 2 --template /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/latex/default-1.17.0.2.tex --number-sections --highlight-style tango --pdf-engine xelatex --natbib --include-in-header preamble.tex --variable graphics=yes --wrap preserve --variable 'compact-title:yes' --variable tables=yes --standalone
output file: bookdown-demo.knit.md

! LaTeX Error: Environment snugshade undefined.

Error: Failed to compile bookdown-demo.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See bookdown-demo.log for more info.
Execution halted

Exited with status 1.

yihui commented

TeX Live 2015? That might be too old.

For LaTeX output, I recommend TinyTeX: https://bookdown.org/yihui/rmarkdown/installation.html

yihui commented

Because TinyTeX is the very latest version of TeX Live. Please see https://yihui.name/tinytex/ if you are interested in knowing more about it. Thanks!