regression/bug in graphics inclusion with double extension

David Carlisle d.p.carlisle at gmail.com
Fri Nov 8 09:58:30 CET 2019


Short version: it works in PL2

Longer version, in case you are interested.

All this is in the core format file handling not in the graphics code,
it just shows up more there.

The extra braces only worked previously by accident not design, the
code path there was "interesting" :-)

Extra character quoting was added in 2019-10-01 so that UTF-8
non-ascii characters get passed to the filesystem as UTF-8 bytes not
tex typesetting instructions.
the {..} braces ended up being quoted by that so even without extra
dots  \includegraphics{{abc}.png} started looking for a file of name
{abc}.png

The main change of PL1  was that it discarded a leading brace group so
\includegraphics{{abc}.png} got treated like \includegraphics{abc.png}
so worked again.
It means \includegraphics{{oma.foo}.png} got treated as
\includegraphics{oma.foo.png} so failed again this time as the
multiple dots were not supported.
I was aware of that but I wanted to get PL1 out quickly as some
systems were routinely adding the brace group to _every_ file so
nothing worked, PL1 got back
to what was always the official position that multiple dots needed extra help.

Meanwhile grffile which deeply patched the latex file handling to
allow spaces multiple dots and (optionally) non ascii characters is
basically irredeemably broken as the core code now supports all those
things and the patching doesn't do what was intended.

So, for oma.foo.png you were basically stuffed except that as I
documented for example here (and on the pandoc tracker) there were one
line workarounds to back this all out.

https://tex.stackexchange.com/a/512877/1090

So that lead to PL2 where the filename parsing was adjusted to take
the extension off the final dot so oma.foo.png works (and a matching
change in graphics so that \includegraphics{oma.foo} now tries to add
.png rather than as always previously complain about unknown extension
.foo).

So your example works in PL2 but.. if you added grffile things would
break again so..

(finally, I hope:-) yesterday's oberdiek package release to ctan
removed grffile from that bundle and a new stub grffile package was
uploaded to ctan that by default just loads graphicx and does nothing
else.


So it's taken a couple of patch releases and a splitting of the
oberdiek bundle, but the end result was I think worth it, filename
handling throughout latex now accepts accented and non latin
characters, and multiple dots and (if you really must:-) spaces in the
filename. Spaces and multiple dots we could perhaps have put off
indefinitely as a technical restriction, but this century it was
becoming more and more uncomfortable to tell people filenames have to
be basically in English.

David


On Fri, 8 Nov 2019 at 07:31, Norbert Preining <preining at logic.at> wrote:
>
> Hi David,
>
> I finally found the time looking into the regression, and it turned out
> that a *simple* document (without grffile or grfext) worked till
> 2019-09-30 and broke afterwards:
>         \documentclass{article}
>         \usepackage{graphicx}
>         \begin{document}
>         Hello
>         \includegraphics{{oma.foo}.png}
>         \end{document}
> Mind the addition braces.
>
> This worked up to know, and Sphinx uses that for documentation building
> of python modules (sphinxdoc).
>
> I just tested with LaTeX 2e <2019-10-01> patch level 2 (TL updated)
> and there it works again, while with pl1 and no pl, it doesn't.
>
> Is this correct?
>
> Thanks
>
> Norbert
>
> --
> PREINING Norbert                               http://www.preining.info
> Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
> GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the tex-live mailing list