3
votes

Even with a very simple Rmd-file generated by 'Newfile' -> 'New R Markdown' sequence selecting 'Document ' and 'PDF' as the Default Output Format I get the following error when pressing the 'Knit PDF' button in RStudio:

"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS mist2.utf8.md --to latex 
--from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures 
--output mist2.pdf --template "D:\_Dateien_von_ulk\Dokumente\R\win-library\3.2\rmarkdown\rmd\latex\default-1.14.tex" --highlight-style tango 
--latex-engine pdflatex --natbib --variable graphics=yes --variable "geometry:margin=1in" 
  output file: mist2.knit.md

  ! Incomplete \iffalse; all text was ignored after line 131.
  <inserted text> 
    \fi 
  <*> ./tex2pdf.2196/input.tex

  !  ==> Fatal error occurred, no output PDF file produced!
    Transcript written on D:/ulk/uk-uni/Uni-ab-September-1999/Lehre/Unterlagen-Lehr
  e-WS-2015-16/Lektuerekurs.VAR.ECM.COINT.WS2015.16/Pfaff.2008.RCode/RCode/tex2pd
  f.2196/input.log.

  pandoc.exe: Error producing PDF from TeX source
  Fehler: pandoc document conversion failed with error 43
  Zusätzlich: Warnmeldung:
    Ausführung von Kommando '"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS mist2.utf8.md --to latex 
 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output mist2.pdf 
 --template "D:\_Dateien_von_ulk\Dokumente\R\win-library\3.2\rmarkdown\rmd\latex\default-1.14.tex"
 --highlight-style tango --latex-engine pdflatex --natbib --variable graphics=yes 
 --variable "geometry:margin=1in"' ergab Status 43 
  Ausführung angehalten

The R session info provided by sessionInfo() gives:

R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C                    LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RevoUtilsMath_3.2.2

loaded via a namespace (and not attached):
[1] htmltools_0.2.6 tools_3.2.2     yaml_2.1.13     rmarkdown_0.8.2 digest_0.6.8   

Under Window 8.1. I use:

  1. MikTeX version 2.9.5721
  2. Pandoc 1.15.1.1.
  3. RStudio 0.99.489

All libraries have been updated today (17th Nov 2015). Furthermore all software has been installed using admin rights in the installation default pathes on drive C: and has been made available to all user.

Knitr the Rmd file into HTML and Word works without any problems.
Any suggestion how to solve the problem?

1
I see you've entered Windows pandoc hell. good luck. It took me half a day of trouble-shooting trial and error before I got it working correctly.Pierre L
Error 43 means pandoc produced a tex file but failed to compile it. You can start troubleshooting by adding keep_tex: true in the yaml front matter under output: pdf_document: and examine the resulting latex file (try to compile it with pdflatex or xelatex and see where it fails)scoa
I am not sure that the problem has been caused by pandoc. According to my tests RMarkdown -> PDF works with date tages like date: "22 November 2015" and date: "22.11.2015" but not with tags like date: "22. November 2015" which used the typical German date format witj a DOT behind the day. Anyway the problem is solved now - I simply use the format DD.MM.YYYY.Ulrich Küsters

1 Answers

0
votes

Just encountered the same problem. Here's what happens:

---
date: "8. Mai 2017"
---

is treated as enumeration by pandoc. TeX then finds an enumeration inside \date{}:

\date{\begin{enumerate} \def\labelenumi{\arabic{enumi}.} \setcounter{enumi}{7} \tightlist \item Mai 2017 \end{enumerate}} which it doesn't like at all.

Workarounds:

  • escape the dot: date: 8\. Mai or date: '8\. Mai 2017' or date: "8\\. Mai 2017" or

    date: '`r format(Sys.time(), "%d\\. %B %Y")`'
    
  • the treatment as enumeration is triggered by the sequence number-dot-space. The problem does not occur with 08.05.2017 (nor with the slightly mistyped 8.Mai 2017).