Generaldocuments and "sub" documents with their own figures

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
gsal
Posts: 6
Joined: Wed Jan 09, 2013 12:08 am

documents and "sub" documents with their own figures

Post by gsal »

Say, a co-worker and I are writing two separate sections for the same document; each will get large and have many figures. Somewhere, I read that 'include' is more convenient than 'input' for large documents and for actual (sub)documents than just figures.

So, I am looking to structure my documents like:

Code: Select all

|-main.tex
|-subdirectory1
|   SectionStress.tex
|-subdirectory2
    fig1.png
    fig2.png
    fig3.png
    SectionPressure.tex
What I am hoping for is for each Section*.tex file to be full, legal, self-contained, file that can be compiled in its own right and generate a *.pdf file. Additionally, for "main.tex" to be able to include the 2 sections, compile and generate a full *.pdf document...

In main.tex, I am using

Code: Select all

%usepackage{standalone}
\includeonly{subdirectory/SectinoStress,subdirectory2/SectionPressure}
.
.
.
\include{subdirectory/SectinoStress}
\include{subdirectory2/SectionPressure}
The above works as far as text goes (references, section numbering, etc.), but not when using figures ( \includegraphics{} ). More clearly, the section files work when the includegrahpics commands do not include any path preceeding the figure file names (since they are in the same directory); but the "main.tex" complains about not finding the figures. On the flip side, if I include path to the figure file inside the section files so that they can be found by "main.tex", then, the section files themselves fail to find the figures.

...is there fix to this?

I would appreciate any hints.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

documents and "sub" documents with their own figures

Post by localghost »

Take a look at combine or subfiles.


Best regards and welcome to the board
Thorsten
gsal
Posts: 6
Joined: Wed Jan 09, 2013 12:08 am

documents and "sub" documents with their own figures

Post by gsal »

Thanks for the links.

I ended up taking the

Code: Select all

\usepackage{standalone}
\includeonly{ventnet/tg3506_ventnet,thermnet/tg3506_thermnet}
\graphicspath{{figs/}{ventnet/figs/}{thermnet/figs/}}
approach and it does the trick.

Thanks,

gsal
Post Reply