I mean: when I put some code in my docs I can include it whitout writing all code in main document.
Is there a similar thing for algorithm?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI mean: when I put some code in my docs I can include it whitout writing all code in main document.
Is there a similar thing for algorithm?
Depending on the kind of result expected, there are two solutions:
Using \input(my_file.tex)
allows you to append the content of my_file.tex to your main TeX file. You can nest \input
comands inside files you call from your main document.
Using \include(my_file.tex)
has the same use but forces a page break and doesn't allow nested \include
. However, you can still \input
a file inside the document you want to \include
.
Note that both commands can be used for any type of LaTeX resource, not only for algorithms. See here for further explanation.
\include
or its behavior?
Jan 21, 2020 at 8:21
\input{fooalgorithm}
?