Hi,
I hope this request makes sense, essentially im building a large document with a lot of flow charts, im using the tikzpicture environment for the flowcharts but it upsets the main document (and me!) including all the tikz code, id like to keep that in a seperate document and just call the chunks of code.
I know i can use \input{} command and keep the tikz code for each flowchart in a seperate .tex file but id like to have them all in the one tikzflowcharts.tex document and call them from main.tex document.
Thanks for any help
General ⇒ Referring to miscellaneous chunks of LaTeX code
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
Referring to miscellaneous chunks of LaTeX code
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Referring to miscellaneous chunks of LaTeX code
Why not have your separate document consist of a bunch of defined commands, e.g.:
Then you'd only have to use \input once to load the entire set of commands (at the beginning or something). Then you'd just use the defined commands \myfirstchart or \anotherchart in the appropriate places in your document.
Another thing to consider would be to use an editor that does code folding.
Code: Select all
\newcommand{\myfirstchart}{%
% code for the first chart goes here
%
}
\newcommand{\anotherchart}{%
% code for another chart goes here
%
}
Another thing to consider would be to use an editor that does code folding.
Re: Referring to miscellaneous chunks of LaTeX code
Thanks for the replies, I have implemented the simple suggestion of using \newcommand for each flowchart, by fabjous and it has helped tidy up my project a lot.
Many thanks
Many thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Referring to miscellaneous chunks of LaTeX code
Now that the problem is solved, please be so kind and mark the topic accordingly as clearly written in the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10