Document ClassesHow to save the preamble to load it in any new script

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
tuerkas
Posts: 2
Joined: Mon Aug 23, 2021 9:34 am

How to save the preamble to load it in any new script

Post by tuerkas »

Hello.

Working in: TexMaker

I have an elaborated preamble wih a few many newcommands and document's set.
I would like to save my preamble to just load it by command when I open a new file to don't have to copy (Ctrl.+C) and paste (Ctrl+V) every single time I need to work with.

I have tried customed Orders but goes like this:

Code: Select all

\begin{[All the preamble]}
 \end{[all the preamble again]}
.

Does anyone have a solution?
Thanks for your attention

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

How to save the preamble to load it in any new script

Post by Stefan Kottwitz »

Hi Tuerkas,

save it as a .tex file, such as preamble.tex, and in your document just write

Code: Select all

\input{preamble}
Here is an example, where I use \input for the preamble, and \include for chapters. (\include is a different thing, designed for chapters and the like, with page break): https://latexguide.org/chapter-11

Stefan
LaTeX.org admin
Post Reply