Questions tagged [preamble]

{preamble} is everything before \begin{document} in a LaTeX document. It contains commands loading packages, definitions, and usually most style settings for a document.

The preamble is everything before \begin{document} in a LaTeX document. It contains commands loading packages, definitions, and usually most style settings for a document.

See e.g. chapter "Preamble" in the Wikibook on Latex for more details.

407 questions
42
votes
4 answers

Creating a default preamble

Since I am using (almost) the same set up for my tex documents, I wonder if there is a way to create a preamble with my default packages and to recall it anytime I want to create a tex document. If yes, how I can call this "default" preamble? Thanks…
Yorgos
  • 2,694
33
votes
5 answers

where to put .sty and .cls file for project

I want to use my own .sty and .cls file in a project. I know of the following two possibilities of placing them: in my local tex tree (or the general tex tree, which is worse) in the same directory as the .tex file Both of these I find…
Daniel
  • 331
6
votes
1 answer

Place preamble packages in a different tex file

I have the following main tex file and I wish to place the \usepackage commands in a different usepackage.tex file and compile it on main tex file. How can I do that. I tried but keep getting error as if it does not know where to find the file…
6
votes
1 answer

Separating the preamble to another file

What is the best practice for separating the preamble to a dedicated file? I've seen two variants: A package: preamble.sty and \usepackage{preamble} A .tex file: preamble.tex and \input{preamble} Which one is to be preferred?
Tim Hoffmann
  • 11,159
5
votes
1 answer

\jot is assigned only inside document

The length \jot controlling the vertical space in align, etc. envs can be assigned only after \begin{document}. Can I do the assignment in some my sty-package file or in preamble?
user40791
4
votes
1 answer

Is this a junk preamble?

As a beginner to LaTeX, I would like to know if this is a junk…
PietroP
  • 105
4
votes
1 answer

What does this preamble do? (dvips) and (epsf)

I am in the process of converting an author's paper into a journal template and I am having a great deal of difficulty understanding what this portion of their preamble does. \usepackage[dvips]{hyperref}%needs to be last package listed; use dvips…
Echan
  • 511
3
votes
0 answers

Is it bad to have a large preamble? (~100 lines) / are there any optimizations there could be made to my preamble?

I must say I've been using LaTeX for only a couple of months, so you could say I'm still a beginner. I have a large project that has many modifications applied to it. Every single time I wanted to change something about my document's look and feel,…
Andy3153
  • 361
3
votes
2 answers

Globally altering styles

Is there a generally applicable technique which will, for any tag/environment used in a LaTeX document, allow the default styling of the contents of instances of that tag/environment to be tweaked in the preamble? For instance, if I decided that…
user15911
3
votes
1 answer

Dividing preamble into smaller files

Preamble of my tex file is going to be so long, Can I divide it to some smaller and reusable files? I used \include but it seems that it did not include any thing.
Real Dreams
  • 8,298
  • 12
  • 56
  • 78
3
votes
0 answers

\include'ing a remote file

I am creating a small header file for students that they need to include in the preamble of their document. The changes are minor enough to not need a class file. However, I do not want them to accidentally change it, and also, terms of copyright…
user2751530
  • 1,102
3
votes
1 answer

Custom variables defined in preamble

I am trying to define some variables in the preamble so they are initialized there and then printed in the text body. Here is what I…
MBR
  • 1,347
2
votes
0 answers

I am new to LaTeX

I am new to LaTex. I am writing a paper on a number theory topic. What I know so far is that I need to construct a preamble for my paper. I don't know what packages I need for my paper. What packages should I include? keep in mind this is an…
H.B
  • 51
2
votes
1 answer

Define items with a custom name in preamble, use them in the document

I have items such as \myphone and several others defined in a preamble.sty file and would like to reference these items in my document using this name (similar to CSS classes). How does this mechanism work? In the preamble: \def\myphone{555-5555} In…
Chris
  • 527
2
votes
2 answers

Writing the entire document as a command

When writing a document, I like to use the following format. %Settings for document %Packages I need \newcommand{\insertdocument}{ %Everything that would ordinarily be put between \begin{document} and…
Arcturus
  • 558
1
2 3