Having problemas solving LaTeX Error: Environment cslreferences undefined with rMarkdown

Hello, all

I'm trying to use the package coppedown, a "spin-off" of thesisdown, to write my M.Sc. thesis.

First, I updated my R version to 4.0.3, then I followed with

install.packages(c('tinytex', 'rmarkdown'))

After the last command finished, I restarted R (and I am using it in RStudio) and ran


to which I got TRUE as answer. So far, so good. Then I ran


and it finished without errors. I followed with


Despite having updated all my packages earlier today, I got this after trying to install thesisdown

Downloading GitHub repo ismayc/thesisdown@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: backports (1.1.9 -> 1.1.10) [CRAN]
5: ps (1.3.4 -> 1.4.0 ) [CRAN]

I chose 1: All. The following message showed up at my console with the error message in the end.

backports (1.1.9 -> 1.1.10) [CRAN]
ps (1.3.4 -> 1.4.0 ) [CRAN]
Installing 2 packages: backports, ps
Installing packages into ‘C:/Users/santa/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/backports_1.1.10.zip'
Content type 'application/zip' length 90419 bytes (88 KB)
downloaded 88 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ps_1.4.0.zip'
Content type 'application/zip' length 738188 bytes (720 KB)
downloaded 720 KB
package ‘backports’ successfully unpacked and MD5 sums checked
Error: Failed to install 'thesisdown' from GitHub:
** (converted from warning) cannot remove prior installation of package ‘backports’**

I deleted backports and installed it from CRAN without error. Then, I re-ran

but this time I updated no package since they're all up-to-date.

With that, I ran install.packages("bookdown") and the package got installed without error.
Then, I went to "File" -> "New File" -> "RMarkdown" -> "From Template" -> "Thesis {coppedown}" and save the file as index.Rmd in a folder called index as expressed in the coppedown's webpage.

After knitting the index.Rmd document, I got the following messages and error?

pandoc-citeproc: reference angel2000 not found
pandoc-citeproc: reference goochandgooch2001 not found
pandoc-citeproc: reference goochandgooch2001 not found
pandoc-citeproc: reference Molina1994 not found
pandoc-citeproc: reference reedweb2007 not found
pandoc-citeproc: reference noble2002 not found
! LaTeX Error: Environment cslreferences undefined.

Looking around for the error message, I found jokorn's solution. From what I got, he found an old template called default.latex and after he deleted that, he solved the problem.

In pandoc's manual, I found this information aimed at Windows users:

In Windows the default user data directory is C:\Users\USERNAME\AppData\Roaming\pandoc . You can find the default user data directory on your system by looking at the output of pandoc --version . A reference.odt , reference.docx , epub.css , templates , slidy , slideous , or s5 directory placed in this directory will override pandoc’s normal defaults.

And here's the problem I'm facing now: I found nothing related to PANDOC at C:\Users\USERNAME\AppData\Roaming. I tried using the terminal (both cmd and PowerShell) to run pandoc --version but it was to no avail. In both cases, pandoc wasn't a recognizable command.

Does anyone know what I could do/try next to solve this issue?
Thank you so very much.

Here's my 'version' result

platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
major 4
minor 0.3
year 2020
month 10
day 10
svn rev 79318
language R
version.string R version 4.0.3 (2020-10-10)
nickname Bunny-Wunnies Freak Out

And session info

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362), RStudio 1.4.828

LC_COLLATE=English_United States.1252
LC_CTYPE=English_United States.1252
LC_MONETARY=English_United States.1252
LC_TIME=English_United States.1252

Package version:
base64enc_0.1.3 compiler_4.0.3 digest_0.6.26 evaluate_0.14
glue_1.4.2 graphics_4.0.3 grDevices_4.0.3 highr_0.8
htmltools_0.5.0 jsonlite_1.7.1 knitr_1.30 magrittr_1.5
markdown_1.1 methods_4.0.3 mime_0.9 remotes_2.2.0
rlang_0.4.8 rmarkdown_2.5 stats_4.0.3 stringi_1.5.3
stringr_1.4.0 tinytex_0.26 tools_4.0.3 utils_4.0.3
xfun_0.18 yaml_2.2.1


This error means you are missing some environment definition in latex document. This environment is required by Pandoc in some version.

The template used by coppedown is here I believe : https://github.com/mralbu/coppedown/blob/master/inst/rmarkdown/templates/thesis/skeleton/template.tex
As in the skeleton folder, it should be local to your project it seems.

You should open an issue in coppedown or modify it just locally yourself.
The fix applied in thesisdown must be applied to coppedown: https://github.com/ismayc/thesisdown/pull/79

Hope it helps

1 Like

Thanks a lot, @cderv. I'll look into it and let know how things go.
Take care.

1 Like

Thanks, @cderv. The solution you proposed did work.
Thank you so much.

Great ! Did you open an issue in the package coppedown si they know about updating their template ?

1 Like

I did try to open it but I could find the "Issues" button. I have opened issues before, but for some reason I'm not giving this option with coppedown. I'm not the most advanced GitHub user, so I might be making a mistake but I'll certainly try once again.

Yes in fact there is none because coppedown is a fork of thesisdown and fork does not have issue tracker. So I guess there is nothing you can do unless you can contact the maintener

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.