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

\graphicspath and trailing / #1076

Closed
kberry opened this issue May 29, 2023 · 13 comments
Closed

\graphicspath and trailing / #1076

kberry opened this issue May 29, 2023 · 13 comments

Comments

@kberry
Copy link

kberry commented May 29, 2023

In the past it was not necessary to have an explicit / at the end of the elements of \graphicspath. As of the latest releases (not sure exactly when or what), it doesn't work unless the / is given. The documentation is not exactly clear on whether it's theoretically required, but since it's always worked before (I think). Trivial example:

\documentclass{article}
\usepackage{graphicx}
\graphicspath{{somedir}}
\begin{document}
\includegraphics{somefig}% with or without extension
\end{document}

will not find somefig.{jpg,png,pdf} in somedir.

@josephwright
Copy link
Member

I think this will be the dev release. I know what the reason will be. A bit of work but addressable.

@josephwright
Copy link
Member

Ah, no, something arising from an earlier change. Anyway, I'll fix.

@josephwright
Copy link
Member

Note that I’ll fix in expl3

josephwright added a commit to latex3/latex3 that referenced this issue May 29, 2023
@josephwright
Copy link
Member

Right, that should sort it: I'll wait for some team colleagues to take a look, and then aim for an expl3 release before the final LaTeX2e 2023-06-01 one.

@davidcarlisle
Copy link
Member

@josephwright I've no objection to making this work without a trailing / but I'm surprised it worked before, certainly it did not work originally, but perhaps the changes around spaces in filenames added that as a side effect.

grfguide uses / in all examples and documents that it's \input@path syntax which is

https://github.com/latex3/latex2e/blob/develop/base/ltdirchk.dtx#L121

so documented as explicitly needing /

@davidcarlisle
Copy link
Member

I tested this, \graphicspath{{aaa}} with no / fails in texlive 2020 and older but it has worked since texlive 2021

@josephwright
Copy link
Member

@josephwright I've no objection to making this work without a trailing / but I'm surprised it worked before, certainly it did not work originally, but perhaps the changes around spaces in filenames added that as a side effect.

grfguide uses / in all examples and documents that it's \input@path syntax which is

https://github.com/latex3/latex2e/blob/develop/base/ltdirchk.dtx#L121

so documented as explicitly needing /

I thought that was the case, but couldn't pin it down :)

When I adjusted the expl3 code recently to avoid duplicating / tokens in some cases, I went with relying on '\input@path requires a trailing /', but I was a bit worried as the expl3 equivalent doesn't. I can see arguments both ways for a trailing /, so switching to code where it's optional seemed a low barrier decision.

@davidcarlisle
Copy link
Member

the reason it was mandatory in 1993 was to avoid run time checking on how to combine directory and filename, but vms, atari, ... less of an issue now, so it's probably safe to insert a /

@FrankMittelbach
Copy link
Member

If the trailing / was required in the past and documented as requiring it, I wonder if we should make it more flexible if that means runtime checks throughout. The case is special enough in my opinion that a strict syntax is not a problem (and the fact that it worked for a little while neither). Just my 2 cents.

@FrankMittelbach
Copy link
Member

just looked, making it flexible doesn't see so clostly, so I take it back.

@josephwright
Copy link
Member

If the trailing / was required in the past and documented as requiring it, I wonder if we should make it more flexible if that means runtime checks throughout. The case is special enough in my opinion that a strict syntax is not a problem (and the fact that it worked for a little while neither). Just my 2 cents.

My original thinking was it was more effort than it was worth, but then @kberry popped up :) It's only a short loop and a quark test, I think we can live with it.

@kberry
Copy link
Author

kberry commented May 30, 2023 via email

@josephwright
Copy link
Member

The expl3 side is fixed and released, and once we finalise LaTeX2e 2023-06-01 this will be sorted: I'm marking fixed-in-dev.

@josephwright josephwright added the fixed in dev Fixed in development branch, not in stable release label Jun 6, 2023
@josephwright josephwright removed the fixed in dev Fixed in development branch, not in stable release label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants