[R-pkg-devel] LaTeX errors under MacOS on CRAN

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Fri Aug 2 09:39:00 CEST 2024


В Thu, 1 Aug 2024 10:53:56 -0400
Ben Bolker <bbolker using gmail.com> пишет:

>    ! Undefined control sequence.
>    l.176 \hlkwd{library}\hldef
>                               {(}\hlsng{"glmmTMB"}\hldef{)}

Very strange.

This may be related to https://github.com/yihui/knitr/issues/2345
(no diagnosis) and possibly https://github.com/yihui/knitr/pull/2341
(where some of the highlight commands have been renamed).

It would be interesting to see the resulting *.tex file: somehow,
\hlkwd is defined, but \hldef isn't.

Looking at the code, knitr should be generating all these definitions
in styler_assistant_latex, called from theme_to_header_latex. This one
is either called from theme_to_header (thus from knit_theme$get(name)),
or at installation time, converting inst/themes/default.css (which
should have both hlkwd and hldef set).

Since you aren't setting any knitr highlighting themes or
opts_knit$set('header'), you should be getting both \hlkwd and \hldef
defined from themes/default.css via knitr::render_latex. Is there a way
to inadvertently set the 'header' knitr option?

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list