I am using bookdown with RStudio to create a pdf-book. After updating latex-packages with tinytex::tlmgr_update(), images were suddenly not rendered anymore, either with knitr::include_graphics() or \includegraphics{}, but the figure caption is still being rendered.

This is how it looks like: enter image description here

Note that everything worked fine until I updated all latex packages (and tlmgr), so nothing has changed in any paths or code text. I have tried to uninstall tinytex and all packages, then reinstalling, but I still seem to have the same issue.

The .tex file created by bookdown have the following:

\includegraphics[width=0.9\linewidth]{images/test} \caption{\label{fig:test}Test figure}\label{fig:unnamed-chunk-1}

Minimal working example:

title: "Test book"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
    latex_engine: xelatex
    fig_caption: yes
    citation_package: natbib
      in_header: preamble.tex
link-citations: yes
keep_md: true
keep_tex: true

# Test book

Test figure:

```{r, fig.cap="\\label{fig:test}Test figure", echo=FALSE, message=FALSE, out.width="90%"}



And these are my installed latex packages:

 [1] "amscls"           "amsfonts"         "amsmath"          "babel"            "bibtex"           "blindtext"        "booktabs"        
 [8] "caption"          "cm"               "colortbl"         "dehyph"           "dvipdfmx"         "dvips"            "ec"              
[15] "environ"          "epigraph"         "eso-pic"          "etex"             "etoolbox"         "euenc"            "fancyhdr"        
[22] "fancyvrb"         "float"            "fontspec"         "framed"           "geometry"         "glyphlist"        "graphics"        
[29] "graphics-cfg"     "graphics-def"     "gsftopk"          "helvetic"         "hyperref"         "hyphen-base"      "hyphenat"        
[36] "iftex"            "inconsolata"      "knuth-lib"        "kpathsea"         "l3backend"        "l3kernel"         "l3packages"      
[43] "latex"            "latex-base-dev"   "latex-bin"        "latex-fonts"      "latexconfig"      "latexmk"          "lm"              
[50] "lualibs"          "luaotfload"       "luatex"           "makecell"         "makeindex"        "mathspec"         "metafont"        
[57] "mfware"           "multirow"         "natbib"           "oberdiek"         "pdfpages"         "pdftex"           "plain"           
[64] "scheme-infraonly" "setspace"         "tabu"             "tetex"            "tex"              "tex-ini-files"    "texlive.infra"   
[71] "threeparttable"   "threeparttablex"  "times"            "tipa"             "titlesec"         "titling"          "tlgs"            
[78] "tlperl"           "tlpsv"            "tocbibind"        "tools"            "trimspaces"       "ulem"             "unicode-data"    
[85] "upquote"          "url"              "varwidth"         "wrapfig"          "xcolor"           "xetex"            "xetexconfig"     
[92] "xkeyval"          "xunicode"         "zapfding"
  • What is the latex version and the version of the graphicx package? – Ulrike Fischer Nov 7 '19 at 12:46
  • @UlrikeFischer The newest version of Tex Live is always installed with tinytex, so I assume this is the April release this year. I'm currently using XeTeX Version 3.141-2.6-0.999. The graphicx package is not installed – Haakonkas Nov 7 '19 at 13:00
  • Don't assume, look in the log-file or whatever. They have been some changes in the file name handling of \includegraphics etc, and the exact versions are important. – Ulrike Fischer Nov 7 '19 at 13:04
  • @UlrikeFischer modified the answer above – Haakonkas Nov 7 '19 at 13:05
  • 1
    no need to be sorry, I wrote graphicx, but I meant graphics ;-). Wait until tomorrow, then there should be a new graphics and latex version in the updates. Try if the problem persists with the new version. – Ulrike Fischer Nov 7 '19 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.