- #1
gsal
- 1,065
- 54
latex: "include" with path, not just filename
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:
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
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.
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:
|-main.tex
|-subdirectory1
| SectionStress.tex
|-subdirectory2
fig1.png
fig2.png
fig3.png
SectionPressure.tex
In main.tex, I am using
Code:
%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.