[R-pkg-devel] debugging remote vignette build failure

Sebastian Meyer @eb@meyer @end|ng |rom |@u@de
Mon Mar 14 14:54:10 CET 2022


Am 14.03.22 um 11:32 schrieb Duncan Murdoch:
> On 13/03/2022 8:11 p.m., Ben Bolker wrote:
>>     After switching some vignette elements of the form
>>
>> https://doi.org/10.1214/09-AOAS306
>>
>> to
>>
>> \doi{10.1214/09-AOAS306}
>>
>>     in the glmmTMB package,
>>
>> GitHub Actions under Ubuntu 20.04 is throwing an error of the form
>>
>> Running 'texi2dvi' on 'glmmTMB.tex' failed.
>> LaTeX errors:
>> ! Undefined control sequence.
>> l.172 doi:\nobreakspace{}\Rhref
>> {[https://doi.org/10.32614/RJ-2017-066}{10.326...](https://doi.org/10.32614/RJ-2017-066%7D%7B10.326...) 
>>
>> The control sequence at the end of the top line
>> of your error message was never \def'ed. If you have
>>
>>
>>      This does **not** happen with rhub::check_on_ubuntu, which tests
>> with R-release under Ubuntu Linux 20.04.1 LTS
>>
>>      It would be nice to fix our GH Actions workflow.  Has anyone seen
>> this before/have suggestions for where to start looking for problems?
> 
> Are you sure this is coming from a vignette?  It looks like it would be 
> from an Rd file or DESCRIPTION:
> 
> The \Rhref macro is defined in Rd.sty.  There's a LaTeX \doi macro in 
> jss.cls, but it doesn't use \Rhref.  On the other hand, the automatic 
> conversion of the DESCRIPTION file uses it in the 
> tools:::.DESCRIPTION_to_latex function.
> 

I think this comes from the glmmTMB vignette doing

> print(citation("glmmTMB"),style="latex")

which produces LaTeX code via Rd2latex(). This uses Rd's \Rhref, 
wrapping either \href from hyperref.sty, or, as a fallback, \url from 
url.sty. In addition, the default tools::bibstyle() will also output the 
volume number in \bold, another LaTeX command from Rd.sty.

I can see the vignette already accounts for \bold via

> %% need this for output of citation() below ...
> \newcommand{\bold}[1]{\textbf{#1}}

To fix the missing \Rhref definition you could similarly do

\NewCommandCopy\Rhref\href

after including hyperref (\NewCommandCopy needs LaTeX >= 2020-10-01).

Best,

	Sebastian



More information about the R-package-devel mailing list