Bioconductor / BiocStyle

Issues and pull requests for BiocStyle should go here.
12 stars 20 forks source link

LaTeX undefined control sequence #44

Closed ghost closed 6 years ago

ghost commented 6 years ago

When knitting an RMarkdown with BiocStyle (with the help of MikTex on Windows), I get an undefined control sequenc error if there is an image. For example:

---
title: "Test"
output: 
  BiocStyle::pdf_document
---

This chunk causes errors

```{r cars}
summary(cars)
plot(pressure)
```

I get this error:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test2.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pandocec44b153a57.tex --table-of-contents --toc-depth 2 --template "C:\Users\erikor\AppData\Local\Temp\RtmpgvaLn4/BiocStyle/template.tex" --number-sections --highlight-style tango --latex-engine pdflatex --include-in-header "C:\Users\erikor\AppData\Local\Temp\RtmpgvaLn4\ec4710a6e74.tex" --variable graphics=yes --variable tables=yes --standalone 
output file: test2.knit.md

! Undefined control sequence.
\grffile@filename ->C:\Users 
                             \erikor \AppData \Local \Temp \RtmpGI 6qxP\prev...
l.164 ...1942.dir\test2_files/figure-latex/cars-1}
                                                   \end{adjustwidth} 

I am working on a Bioconductor package, and thus I am using the development version of Bioconductor and the development version of R:

R Under development (unstable) (2018-03-06 r74362)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Here is my MikTex version:

MiKTeX-pdfTeX 2.9.6607 (1.40.19) (MiKTeX 2.9.6630 64-bit)

Is this a problem with the BiocStyle, or am I Doing It Wrong™?

vobencha commented 6 years ago

Hi @erikor ,

Was this issue opened in relation to the Slinky package? https://github.com/Bioconductor/Contributions/issues/660

The build report for Slinky is clean so I'm assuming you resolved this or found another solution? Valerie

ghost commented 6 years ago

No, at present I am not using the BiocStyle as I could not successfully build the vignette per this issue. But I would like to at the BiocStyle is great.

aoles commented 6 years ago

Looks like an error specific to your LaTeX or system configuration, as on other systems the sample rmarkdown file builds just fine without any errors. Might be related e.g. to spaces in your file paths.

ghost commented 6 years ago

Thanks for the pointer. Spaces in the temp directory path seemed to be my problem. I resolved this issue by creating a the directory C:\Rtemp, and then setting my TMP environment variable to C:\Rtemp.

For anyone else landing here with this issue, make sure you use TMP and not TEMP, otherwise R might use the global TMP value if that is set. See ?tempdir for details on temp directory settings precedence.