1

I would need to know how to import figure from Figures subfolder to tex file in Chapters subfolder.

Project tree is following:

/Project/main.tex
/Project/Figures/picture.pdf
/Project/Chapters/chapter1.tex

I have tried to use either relative and absolute path to the picture.pdf but nothing works. I think the problem is I am trying to import the figure between subfolders (when I tried to import the figure from subfolder to the main.tex it works all right)

Thanks for help

  • 1
    Welcome to TeX.SX! ../Figures/picture.pdf should work as well as /Project/Figures/picture.pdf (as long as /Project is a valid path)... Can you please be more specific on what fails? Any error message? – Phelype Oleinik Mar 15 at 18:54
  • As far as I know the base directory of a project is that one the main tex file resides in. So using ./Figures/ as path for \graphicspath should do what you want from every folder within our project... The real problem is difficult to track down without a MWE. – AndiW Mar 15 at 20:32
0

You can have your project in a folder named "Project" at any place of your OS.

Then inside it you could have:

/Chapter1

which contains its figures inside the subfolder

/Chapter1/Figures

Then:

/Chapter2

with its figures inside

/Chapter2/Figures.

To use it via \graphicspath command you have to place at the beggining of every Chapter<number>.tex the command:

\graphicspath{{Chapter<number>/Figures/}}

PS: This could be automated to be executed just inside \chapter command... if you are interested feel free to ask about this automation.

PS2: Change <number> with your real chapter's number of course.

  • I found the problem I tried to use the \graphicspath in chapter.tex file which I input in document part of the main.tex file so the command was not used in the preamble of file. – Martin Vit Mar 16 at 14:55
  • @MartinVit .. You should write this as a self placed answer and accept in a few days. A MWE could help you to find it earlier. – koleygr Mar 16 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.