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?
grffilepackage the normal fix to this? But in general, don;t use spaces in file or folder names. – daleif Nov 21 '13 at 13:08\usepackage{graphicx} \usepackage[space]{grffile}solves the spaces-in-filenames issue. I did not realize this was the problem... – dan3 Nov 21 '13 at 17:59