Graphics, Figures & TablesCurrent File Directory and Path for Graphics Files

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BinaryBen
Posts: 15
Joined: Mon Feb 18, 2013 8:54 pm

Current File Directory and Path for Graphics Files

Post by BinaryBen »

Hi all,

I've got a "main.tex", and several .tex files in sub-folders, which I'm including using \input.

Code: Select all

main.tex
  \ch01\sub.tex
  \ch02\sub.tex
  \ch03\sub.tex
  ...
I include the currfile package in "main.tex". In each "sub.tex" I want it to use that relative folder and sub-folder like this.

Code: Select all

/graphicspath{{\currfiledir/figures/}}
instead of doing this:

Code: Select all

\graphicspath{{ch03/figures/}}
However, \currfiledir won't work here. Any ideas why?

Thanks

Bob
Last edited by localghost on Fri Mar 08, 2013 6:40 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Current File Directory and Path for Graphics Files

Post by cgnieder »

Can you please compose a minimal (non) working example that illustrates your problem? It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.

Regards
site moderator & package author
Post Reply