General ⇒ Referring to miscellaneous chunks of LaTeX code
Referring to miscellaneous chunks of LaTeX code
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Referring to miscellaneous chunks of LaTeX code
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Referring to miscellaneous chunks of LaTeX code
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
Many thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Referring to miscellaneous chunks of LaTeX code
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10