rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.88k stars 975 forks source link

! Undefined control sequence. l.2 \parFirst #246

Closed lwaldron closed 10 years ago

lwaldron commented 10 years ago

The following beamer presentation errors for me when parsed by rmarkdown::render:



---
title: "Test"
author: "Tester"
date: "September 3, 2014"
output: beamer_presentation

---

## A slide that breaks "Knit PDF"

First some text:
* Then some bullet points, then some R:

```{r}
2+2
```

Here is the output:

> rmarkdown::render("test.Rmd")

processing file: test.Rmd
  |......................                                           |  33%
  ordinary text without R code

  |...........................................                      |  67%
label: unnamed-chunk-1
  |.................................................................| 100%
  ordinary text without R code

output file: test.knit.md

/usr/local/bin/pandoc test.utf8.md --to beamer --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output test.pdf --template /Users/lwaldron/Library/R/3.1/library/rmarkdown/rmd/beamer/default.tex --highlight-style tango 
! Undefined control sequence.
l.2 \parFirst

pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] rmarkdown_0.2.68

loaded via a namespace (and not attached):
[1] digest_0.6.4    evaluate_0.5.5  formatR_0.10    htmltools_0.2.4
[5] knitr_1.6       stringr_0.6.2   tools_3.1.1     yaml_2.1.13    
> 
lwaldrons-imac:lectures lwaldron$ pandoc --version
pandoc 1.13.1
Compiled with texmath 0.8, highlighting-kate 0.5.9.
Syntax highlighting is supported for the following languages:
    abc, actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c,
    changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css,
    curry, d, diff, djangotemplate, dot, doxygen, doxygenlua, dtd, eiffel,
    email, erlang, fasm, fortran, fsharp, gcc, glsl, gnuassembler, go, haskell,
    haxe, html, ini, isocpp, java, javadoc, javascript, json, jsp, julia, latex,
    lex, lilypond, literatecurry, literatehaskell, lua, m4, makefile, mandoc,
    markdown, mathematica, matlab, maxima, mediawiki, metafont, mips, modelines,
    modula2, modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml,
    octave, opencl, pascal, perl, php, pike, postscript, prolog, pure, python,
    r, relaxng, relaxngcompact, rest, rhtml, roff, ruby, rust, scala, scheme,
    sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, tcsh, texinfo, verilog,
    vhdl, xml, xorg, xslt, xul, yacc, yaml, zsh
Default user data directory: /Users/lwaldron/.pandoc
Copyright (C) 2006-2014 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
jmcphers commented 10 years ago

Thanks for reporting this. Unfortunately I wasn't able to repro, even with pandoc 1.13.1. Here a a couple things that might help narrow down the problem:

  1. Do you see the same error if you change beamer_presentation to pdf_document? (i.e. is this a problem every time you produce LaTeX output, or is it specific to Beamer?)
  2. Next to Knit PDF, click the gear, go to the Advanced tab, and turn on Keep TeX source file, then knit again. That should leave you with a test.tex file after you render. Does that file have the offending \parFirst sequence in it? If so, could you paste the offending lines and a few surrounding them?
lwaldron commented 10 years ago

Rats, and I don't know if my results here will help either:

  1. No, it compiles without error if I change to beamer_presentation to pdf_document.
  2. The test.tex file does not contain any \parFirst in it. If I do pdflatex test this compiles without error.
jmcphers commented 10 years ago

Okay, time for some long shots. :-)

Do you see the error if you add a blank line between the lines First... and * Then...?

Replace the word First with something else, say, Second -- does parFirst become parSecond?

lwaldron commented 10 years ago
  1. I still see the error after adding a blank line between the lines First... and * Then...
  2. Yes, \parFirst becomes \parSecond
jjallaire commented 10 years ago

I recall that Beamer didn't work in pandoc for older versions of MacTex. Are you by chance on the Mac? If so what version of MacTeX are you running? You can determine this with the following code at the R console:

system("pdflatex --version")

On Thu, Sep 4, 2014 at 1:58 PM, Levi Waldron notifications@github.com wrote:

1.

I still see the error after adding a blank line between the lines First... and * Then... 2.

Yes, \parFirst becomes \parSecond

— Reply to this email directly or view it on GitHub https://github.com/rstudio/rmarkdown/issues/246#issuecomment-54518461.

lwaldron commented 10 years ago

I am on a Mac, and upgrading MacTex fixed the error! FYI here were my versions before:

> system("pdflatex --version")
pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012)
kpathsea version 6.1.0
Copyright 2012 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.10; using libpng 1.5.10
Compiled with zlib 1.2.7; using zlib 1.2.7
Compiled with xpdf version 3.03
> 

and after:

> system("pdflatex --version")
pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)
kpathsea version 6.2.0
Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.10; using libpng 1.6.10
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with xpdf version 3.03
> 
jjallaire commented 10 years ago

Great! Yes, in my previous experience TexLive 2012 didn't work properly with pandoc's Beamer template.

On Fri, Sep 5, 2014 at 11:10 AM, Levi Waldron notifications@github.com wrote:

Closed #246 https://github.com/rstudio/rmarkdown/issues/246.

— Reply to this email directly or view it on GitHub https://github.com/rstudio/rmarkdown/issues/246#event-161794663.

melmacparis commented 7 years ago

I am having the same problem on a Mac. Please help. Changing the output to pdf_document does not help. I have updated all my programs and the error persists. Please help

pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016)

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.