As i cant comment on posts yet, i will have to ask this question. Here is the link with the example: (The last answer by markellos is what im using and reffering to)
path of figures in different directories with subfile latex
His case:
Main.tex:
\providecommand{\main}{.}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
%here is the path
\graphicspath{{\main/images/}{images/}}
\usepackage{subfiles}
\usepackage{blindtext}
\begin{document}
\subfile{\main/chap1/chap1}
\end{document}
chap1.tex
\providecommand{\main}{..}
\documentclass[\main/main.tex]{subfiles}
\begin{document}
\begin{figure}[bh]
\centering
\includegraphics[width=4cm]{f1}
\label{fig:img1}
\caption{ShareLaTeX learn logo}
\end{figure}
Hello, here is some text...
\end{document}
So lets say that my main images directory is the 'images', and you call that by using: \includegraphics[width=4cm]{./f1}
(at least i do)
But i also have a subfolder within 'images' called 'ABC'.. How to i call from that using \includegraphics ?
I not very good at latex and i mainly copy things off from answers and other templates to mix for my own likings. Im writing my thesis, and i will have several other subfolder containing images (im doing histology). So it would be very convenient to sort them out in different folder from the main 'images' folder.
I tried \includegraphics{../f1)
, but something tells me that i have to modify this line in the main.tex to include my subfolders:
\graphicspath{{\main/images/}{images/}}
But how?
Br
Best Answer
Forgive the family analogy but it may help you grasp how your relatives are structured and how they are referenced
So you are a folder lets call you Thomas and you have a parent lets call them blindhardt you are placed in a system as /blindhardt/thomas but for self reference you can use the alias "."
you have children /blindhardt/thomas/janet and /blindhardt/thomas/john
they may have nicknames such as preface and chap1
to indicate your childs relation to yourself you can say ./preface or ./chap1
for your father you can say .. and for siblings they may be ../older or ../younger
your family tree can now be
Ok thats the basic theory of your relative paths now to your answer
One part of you Thomas the custodian (of the family bible) is known as main.tex
markellos shows neatly that if that part of you (main.tex) identifies as
then any ../child/story.tex can refer to you as their provider
also their additional statement
confirms they are of the same subgroup (class) as yourself
as a family you agree to keep all your pictorial assets in
/blindhart/somewhere/vault however as custodian you wish to call it
% here is the vault path for you ./images and the next generation {\main\images/}
OK nothing new so far, lets say you keep a folder (ABC) in that vault
both you and your children will now both need to have some cross index.
So now it does not matter if pic1.png or fig1.pdf is in either main/images or /images/ABC
all of your imediate family of files can find it with
Obviously /older and its /children can follow the same pattern but if you all want to access the family crest in /blindhardt/images then you start adding many more nested relative layers and it may be easier to include an absolute address for such master images thus you and your siblings could add
There are ways to include spaces in the above but for fullest compatibility I suggest we don't include any
All of the above is based on the wording of your question, however every tex file can visit the public library by itself.
There is a default library at your
${TEXMFHOME}/tex/generic/images
You can also nominate a sequence of project collectives via the
TEXINPUTS=".:.//:c:\road\to\nowhere: "
variable which you could if you know what your doing re-define differently prior to each project run.NOTE the special token .// which means ALL subdirectories
See Automatically Locate Included Images and Renaming chapter folder and referring to images efficiently