Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to include a PDF image with '.' in filename #187

Open
nsoranzo opened this issue Jul 20, 2018 · 5 comments
Open

Impossible to include a PDF image with '.' in filename #187

nsoranzo opened this issue Jul 20, 2018 · 5 comments

Comments

@nsoranzo
Copy link

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.

nsoranzo added a commit to nsoranzo/bcftools that referenced this issue Jul 20, 2018
To prevent issues with `\includegraphics` for both pdflatex and tectonic,
see tectonic-typesetting/tectonic#187 .

Also, consolidate `$$opts{rasterize}`, `$$opts{pdf_plots}` and `$$opts{fmt}`
variables in `$$opts{img_fmt}`, which could support other formats in the
future (e.g. eps).
@pd3
Copy link

pd3 commented Jul 21, 2018

Try to add square brackets before the suffix: \includegraphics[width=15cm]{{indels.0}.pdf}

@nsoranzo
Copy link
Author

@pd3 Thanks, that works! I'll leave to the Tectonic maintainers if the workaround is enough to close this issue.

nsoranzo added a commit to nsoranzo/bcftools that referenced this issue Jul 23, 2018
To prevent issues with `\includegraphics` for both pdflatex and tectonic,
see tectonic-typesetting/tectonic#187 .

Also, consolidate `$$opts{rasterize}`, `$$opts{pdf_plots}` and `$$opts{fmt}`
variables in `$$opts{img_fmt}`, which could support other formats in the
future (e.g. eps).
@pkgw
Copy link
Collaborator

pkgw commented Jul 23, 2018

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.

@spl
Copy link
Contributor

spl commented Apr 2, 2019

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.

@hubgit
Copy link

hubgit commented Jul 7, 2020

From a comment in a relevant discussion in pandoc's issue tracker, this should be getting fixed upstream:
jgm/pandoc#5848 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants