What is the right way to include graphics when you are creating a modular document?
My directory structure is as follows:
/root
--report.tex
--mystyle.sty
--/tex
----/literature
------literature.tex
--/img
----biological_neuron.eps
My main file is report.tex whose content is as follows:
\documentclass[11pt, a4paper, twoside, openright]{book}
\usepackage{graphicx}
\usepackage{my_style}
\begin{document}
\mainmatter
\include{tex/literature/literature}
\bibliographystyle{plain}
\bibliography{../../../Bibliography/Bibtex/SNN}
\end{document}
The content of file literature.tex is as follows:
\chapter{A review}
\begin{figure}[h]
\includegraphics{../../img/biological_neuron}
\caption{A biological neuron}
\label{Fig:BN}
\end{figure}
Everytime I try to generate a pdf I get an error: File "../../img/biological_neuron" not found. I tried "/img/biological_neuron" instead of "../../img/biological_neuron" but that doesn't work either. One thing that does work is adding \graphicspath{img/} to report.tex. But I don't know if thats the right way to do it. Because even if I do \graphicspath{img/} I have to specify the path for any graphics in an included file as '../../img/biological_neuron' and I think after adding \graphicspath{img/}` we should have to just write '/biological_neuron'. I don't know if this is a bug or am I doing something wrong. Please enlighten. Thank you.
\graphicspathrequires it's argument to contain grouped elements. So you should use\graphicspath{{<dir1>}{<dir2>}..}. See section 4.5 Other commands in the graphics package (p 13) of thegraphicsguide. – Werner Aug 17 '13 at 05:01\graphicspath{{../../img/}}will help? Take note to double braces. – Eddy_Em Aug 17 '13 at 05:01\def\imgfolder{img/}\includegraphics{\imgfolder myimage}. – Werner Aug 17 '13 at 05:20