0

I have a problem with a bookdown job running on travis (runs fine on my machine). the html builds fine, the latex version fails. it complains about a "wrong measure". The offending code chunk is (apparently) this one, and the fact that I used option out.width="700px" ?

! Illegal unit of measure (pt inserted).
<to be read again> 
                   p
l.6137 ...ludegraphics[width=700px]{images/pasta1}

Error: Failed to compile ScPoEconometrics.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See ScPoEconometrics.log for more info.
Execution halted

So that's just a JPG image to be included. I read that this works with pdflatex, not sure about xelatex (which is what bookdown is using?). the travis job is here.

EDIT

MWE using px in latex:

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}

\begin{document}

\noindent\includegraphics[width=3cm]{example-image-a}\qquad
\includegraphics[width=3cm]{example-image-golden}\qquad
\includegraphics[width=50px]{example-grid-100x100pt}
\includegraphics[width=30px]{example-grid-100x100pt}

\end{document}

enter image description here

Florian Oswald
  • 5,054
  • 5
  • 30
  • 38
  • Well @user2554330 that is clearly not true. See edit above. I muted the possibility that I need to use a certain latex engine for bookdown on travis (that my latex engine is different and that's why it works). If you know more about this, step forward. Else, nothing beats an MWE. – Florian Oswald Oct 09 '19 at 20:13
  • oh wow, it *corrects* spelling mistakes?! that's a new dimension. ok, well in that case your suggestion would be to just use *another* measure (cm) that kind of resembles 700px on a screen? happy to accept that as an answer if you feel like posting it! – Florian Oswald Oct 10 '19 at 07:42

0 Answers0