tectonic
tectonic copied to clipboard
Impossible to include a PDF image with '.' in filename
For this simple document:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=15cm]{indels.0.pdf}
\end{document}
pdflatex test.tex fails with:
! LaTeX Error: Unknown graphics extension: .0.pdf.
while tectonic test.tex fails with:
! Unable to load picture or PDF file 'indels.0.pdf'.
<to be read again>
}
l.4 \includegraphics[width=15cm]{indels.0.pdf}
After renaming indels.0.pdf to indels_0.pdf, and updating test.tex to:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=15cm]{indels_0.pdf}
\end{document}
both pdflatex and tectonic work.
It is possible to workaround the problem for pdflatex by modifying test.tex to:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[type=pdf,ext=.pdf,read=.pdf,width=15cm]{indels.0}
\end{document}
pdflatex test.tex works, while tectonic test.tex fails with:
! LaTeX Error: Cannot determine size of graphic in indels.0.pdf (no BoundingBox
).
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.4 ...df,ext=.pdf,read=.pdf,width=15cm]{indels.0}
which is probably a separate issue.
Versions:
$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
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: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.17; using libpng 1.6.17
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.41.0
$ tectonic --version
Tectonic 0.1.8
Tectonic installed from conda-forge.
Try to add square brackets before the suffix: \includegraphics[width=15cm]{{indels.0}.pdf}
@pd3 Thanks, that works! I'll leave to the Tectonic maintainers if the workaround is enough to close this issue.
Thanks for the workaround @pd3!
If pdflatex works with the dotted filename, this is definitely a (weird) bug in Tectonic that ought to be fixed.
This appears to be bug-compatible with xelatex. See these StackOverflow questions for more information:
I believe xelatex is probably the better feature/bug benchmark than pdflatex since Tectonic is a fork of XeTeX.
Also, FYI, there is an alternative solution using grffile which is recommended by some of the answers:
\documentclass{article}
\usepackage{graphicx}
\usepackage{grffile}
\begin{document}
\includegraphics[width=15cm]{indels.0.pdf}
\end{document}
Since this issue exists in XeTeX and appears to work as intended, I don't think Tectonic should be changed at this point in time.
From a comment in a relevant discussion in pandoc's issue tracker, this should be getting fixed upstream: https://github.com/jgm/pandoc/issues/5848#issuecomment-549051995