rr-markdownpdftexrticles

R: Knitting error rticles \vadjust in vertical mode


I tried to use the package rticles within a Rmd file, in order to generate journal publications. When trying to knit the template as it is, I get following error

his is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log UC4_SupplySecurity.log.
! You can't use `\vadjust' in vertical mode.
l.300 \leavevmode\vadjust
                          pre{\hypertarget{ref-Neurobot2013}{}}% 

Error: LaTeX failed to compile UC4_SupplySecurity.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See UC4_SupplySecurity.log for more info.
Execution halted

Within the log file, the same error is reported:

Package pdftex.def Info: UC4_SupplySecurity_files/figure-latex/Figure-1-1.pdf  
used on input line 291.
(pdftex.def)             Requested size: 241.86113pt x 241.86148pt.
! You can't use `\vadjust' in vertical mode.
l.300 \leavevmode\vadjust

I use following configurations

pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021)
kpathsea version 6.3.3
Copyright 2021 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

What am I doing wrong?

Unfortunately I cannot provide a reproductible example, as it corresponds to the raw Frontiers Journal Article. The same issue persists with the Elsevier Journal Article template.

The template compiles if I remove all references and citations [@XY], but a publication without references is a no-go.


Solution

  • I believe this issue with rticles has been reported in the Github repo already https://github.com/rstudio/rticles/issues/383 and it has been fixed in rticles 0.20 which is not yet on CRAN.

    So for now, one should do

    remotes::install_github("rstudio/rticles")
    

    Using the dev version, I can render without error the default template for Frontier article.