Keita and Arash, thanks for the responses! I must have given myself this
false memory of how inserting \includegraphics works, because so many
things are very nicely automated in AUCTeX.

On Sat, Aug 31, 2024 at 11:41 AM Arash Esbati <ar...@gnu.org> wrote:

> Leo Stein <leo.st...@gmail.com> writes:
>
> > 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'd say epslatex.pdf is a good read for including graphics into .tex
> files in general; the specifics about the EPS file format are not that
> relevant anymore, probably.
>
> > 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.
>
> Or you could simply hardcode the path to the file inside
> \includegraphics for this kind of rather small documents.


Again this would not work when submitting to the arXiv or a journal. At
least one journal I've submitted to will flatten the tarball you upload,
which makes \graphicspath invaluable.


> Personally, I
> think all this is relevant only if you're using the good old latex-dvips
> route.  With the advent of pdflatex, you can plonk all your graphics
> into a single file and then use the 'page=X' key-val inside the optional
> arg of \includegraphics; then you can have your single file with the
> graphics in the same directory of your main-file.tex and all the
> path-searching stuff isn't really necessary.
>

I know this is probably irrelevant to most people, but let me just give
some more context on what a typical workflow looks like. This is all about
keeping the repos of projects highly organized, which is especially
important for nontrivial projects when collaborating with multiple people.
Often my directories are structured like

project_repo/
├─ analysis_code/
│  ├─ Makefile
│  ├─ analysis_script_1.py
│  ├─ plotting_script_1.py
│  ├─ plotting_script_2.py
│  ├─ ...
│  ├─ figs/
│  ├─  ├─ generated_fig_1.pdf
│  ├─  ├─ generated_fig_2.pdf
│  ├─  ├─ ...
├─ paper/
│  ├─ Makefile
│  ├─ paper_draft.tex
│  ├─ relevant_bibilo.bib
│  ├─ ...

The last article I was on had 13 figures. Putting everything in one
directory is very disorganized. Writing all the figures into one big PDF
just adds unneeded complications. Using \graphicspath and just the
individual file names (with no paths or extensions) works great!

Best
Leo


> > 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?
>
> See Keita's answer.
>
> Best, Arash
>

Reply via email to