I would like to use a .tex file with all my custom command definitions, but I do not know how I can then use these commands in my main.tex file. I know about \include and \input, but iirc these are used to insert pages into your eventual document, right?
Asked
Active
Viewed 335 times
1 Answers
1
\input if the file has an extension .tex but better give the file the extension .sty, say mycommands.sty then use \usepackage{mycommands} in the preamble.
David Carlisle
- 757,742
\input. Please have a look at https://tex.stackexchange.com/q/246/82917 – campa Oct 21 '21 at 09:37\input{mycommands}in the preamble as well only for commands in a.texfile, but if you will use a set of commands consistently in several documents, consider make a package (.styextension) or even your own class (.clsextension) in order to simplify the preamble. – Fran Oct 21 '21 at 09:46