In recent versions of R-devel, sessionInfo() has a 'tzone' element, e.g.

> sessionInfo()$tzone
[1] "America/Los_Angeles"


Some time zones, like the one above, has an underscore.  This
underscore is *not* escaped by utils:::toLatex.sessionInfo, e.g.

$ TZ="America/Los_Angeles" Rscript --vanilla -e "toLatex(sessionInfo())"
  \item R Under development (unstable) (2022-11-30 r83391),
  \item Locale: \verb|LC_CTYPE=en_US.UTF-8|, \verb|LC_NUMERIC=C|,
\verb|LC_TIME=en_US.UTF-8|, \verb|LC_COLLATE=en_US.UTF-8|,
\verb|LC_MONETARY=en_US.UTF-8|, \verb|LC_MESSAGES=en_US.UTF-8|,
\verb|LC_PAPER=en_US.UTF-8|, \verb|LC_NAME=C|, \verb|LC_ADDRESS=C|,
  \item Time zone America/Los_Angeles
  \item Running under: \verb|Ubuntu 20.04.5 LTS|
  \item Matrix products: default
  \item BLAS:   \verb|/home/hb/software/R-devel/trunk/lib/R/lib/|
  \item LAPACK: \verb|/home/hb/software/R-devel/trunk/lib/R/lib/|
  \item Base packages: base, datasets, graphics, grDevices, methods,
    stats, utils
  \item Loaded via a namespace (and not attached): compiler~4.3.0

This causes LaTeX-based vignettes using toLatex(sessionInfo()) to fail
their LaTeX compilation with an error, e.g.

Error: processing vignette 'mypkg.Rnw' failed with diagnostics:
Running 'texi2dvi' on 'mypkg.tex' failed.
LaTeX errors:
! Missing $ inserted.
<inserted text>
l.684   \item Time zone America/Los_
! LaTeX Error: Command \item invalid in math mode.


To fix this, either escape any underscores, e.g.

  \item Time zone America/Los\_Angeles

or use \verb as done elsewhere:

  \item Time zone \verb|America/Los_Angeles|


______________________________________________ mailing list

Reply via email to