0

For a long time I used to losslessly convert muliple PNGs to a single PDF using the following template:

\documentclass[a4paper]{article}
\usepackage{pdfpages}
\usepackage[margin=0pt]{geometry}
\begin{document}
\pagestyle{empty}
\enlargethispage*{0cm}
%
%
\centering{
\includegraphics[width=.99\paperwidth,totalheight=.99\paperheight,keepaspectratio]{img1.png}
\clearpage
\includegraphics[width=.99\paperwidth,totalheight=.99\paperheight,keepaspectratio]{img2.png}
\clearpage
}
\end{document}

Lately, I've been getting (on Ubuntu 12.04)

! Missing $ inserted.
<inserted text> 
                $
l.10 ...ht,keepaspectratio]{img1.png}

What's wrong, what's changed? Alternatives?

Update: turns out this only happens with filenames with spaces (so "img 1.pdf", not img1.pdf). How can this be avoided?

dan3
  • 101

0 Answers0