Diagnosing R Package Build Warning: "Latex Errors When Creating PDF Version"

Diagnosing R package build warning: LaTeX errors when creating PDF version

Try R CMD Rd2pdf mypackage to create the manual, and possibly also set the --no-clean option to keep the temporary files. This should allow you to debug the LaTeX code triggering the error.

Diagnosing R Package build Error: pdfLatex Not Available

Although you have installed MikTeX under Windows, this does not make it available to R. You need to add the location of the latex executables to your PATH environment variable. How to do this exactly depends on your Windows version. For example, this link describes how to do this for Windows 7. Googling for change environment variables (windows 7|windows xp|windows 95) will tell you how to change your environment variables.

Diacritics in R documentation via roxygen & Rdpack

After some further searching I've found an answer elsewhere that suggests that this is due to Windows' non-native handling of UTF-8 encoding, which [edit] was addressed in R4.0. is being addressed in a future release in the R 4.x series. Unless other readers have further suggestions, it looks like it may have to be a case of "wait a while"...

Thesisdown: knitting to PDF fails when loading huxtable package and creating tables

Solution as recommended by @dash2: include LaTex packages manually

"LaTex packages loaded with header-includes ignored by huskydown?" - it seems that this presumption is actually the case.
Hence, the LaTex packages can not be included in the YAML header of the index.Rmd file.

The huskydown thesis template includes the file "template.tex" which defines the documentclass and sources several LaTex packages.
Manually adding all LaTex packages required by huxtable to this file solves the issue:

% Huxtable
% load LaTex packages needed for huxtable

WARNING: version (0.2) should have exactly three components

You should use a version number that has 3 integer components separated by .:

Version: 0.2.0

See here for more.

CRAN finds an warning that R CMD check --as-cran does not

I was able to reproduce this problem on Ubuntu 12.04 with r-devel by cloning the Github repo and running

R CMD build creelSurvey
R CMD check --as-cran BusRouteCreelSurvey_0.2.1.tar.gz

I was able to fix it by removing DOS end-of-line markers (^M or Ctrl-M) from man/SimulateBusRoute.Rd. I don't know the easiest way to do this on Windows (you could look for a dos2unix utility, or possibly come up with a readLines solution.

I don't know how it will work across platforms, but this seems to work for me:

fn <- "MakeAnglers.Rd"
r <- readLines(fn)

I would (1) look for (possibly obscure) warnings in the R Extensions manual about end-of-line markers and then (2) report this, either to the CRAN maintainers or by posting on r-devel@r-project.org.

In general you should be able to detect these problems if you can set up a test build on a Linux system; I don't know of an equivalent of win-builder.r-project.org for Linux systems, but http://travis-ci.org is a good resource, and this Github project is a good way to get started with R projects on Travis. (Or you can set your project up on R-forge.) I recognize that this might be more of a project than you're looking for right now, just including it for future reference.

Related Topics

Leave a reply