On Mon, Aug 26, 2024 at 3:37 AM Arash Esbati <
arash@gnu.org> wrote:
Leo Stein <leo.stein@gmail.com> writes:
> I searched in this mailing list's archives but couldn't find a
> previous mention of this suggestion; sorry if it's already been
> discussed. The ffap-latex-mode function already does some non-trivial
> things, like running kpsewhich to locate .cls or .sty file when point
> is in a \documentclass or \usepackage command. I was wondering if it
> would be possible to leverage AUCTeX to further improve its handling
> of where to search when point is in an \input command. LaTeX looks in
> paths specified by \input@path, which the author may (re)define or
> prepend/append to (see
> e.g. https://tex.stackexchange.com/a/79060/34063 ).
Let me just mention that \input@path is an interal macro and not a
public one available to authors in order to be redefined or extended --
\graphicspath is a different beast.
That's a fair point [though the mechanism is identical — the documentation for \graphicspath even says "The format is as for the LATEX 2ε primitive \input@path"].
> Is it possible to parse the document for such (re)definitions, and
> provide additional paths to ffap-latex-mode via some defadvice? Or is
> this too complicated to do robustly?
ffap.el is an Emacs core library; I suggest you ask Emacs maintainers
about this addition. If they agree, this can also be useful for people
who use the builtin LaTeX-mode.
Reg. usefulness: I'm not sure if I would agree if I was in charge.
epslatex.pdf has a section about this kind of additions (13 Using
Subdirectories). Maybe the reasons given there don't apply to modern
TeX installations and computers anymore, but in general, supporting
This is the first time I've seen that recommendation in epslatex.pdf (the most recent version on the CTAN is from 2006, and I don't think I've used an eps since around that time!). I find the recommendation of preferring to modify the environment variable TEXINPUTS pretty bizarre: when we submit latex sources to journals or the arXiv, we have no control over the environment variables of their build systems. Using \graphicspath is, AFAIK, the most robust way to keep your sources portable.
This thread actually made me realize something I hadn't noticed before. I thought that AUCTeX had been parsing the contents of \graphicspath to search for files when you insert \includegraphics, but now looking at the source, I can't find this... did I imagine it? Did this ever happen in the past?
Thanks again,
Leo
non-public commands inside an editor is asking for trouble (IMHO) and
using Kpathsea is much more reliable.
Best, Arash