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

learn more… | top users | synonyms

2
votes
2answers
39 views

Latex compiling out \begin{document} etc

I am writing a thesis with latex, each chapter is in its own TeX file and get included with a \input{Chapters/Chapter1} command. One of my Chapters is generated with Sweave (R code) and includes ...
18
votes
4answers
363 views

Avoid repeating [hbt] and \centering for every table

In a document I'm writing, I'm using the familiar [hbt] option for my floating tables, and I center them. I'd like to avoid repeating that every time I'm creating a table. I assume it's easy to add ...
3
votes
1answer
77 views

Add box to labeled sections

I want to add a box to a repeated section of a textbook, which provides question discussions. Is it possible to do it by adding "tex style setting" command(s) to the preamble? I am using the memoir ...
1
vote
1answer
40 views

How to set a document for use with the Bera fonts instead the default fonts?

I have a document created with scrartcl class and I want to use the three Bera fonts: Serif, Sans and Mono, but I don't find the right way to change it with the KOMA-Script commands. Could someone ...
5
votes
1answer
30 views

Custom class creating compilation problems

I tried adding my preamble to a new class file called labs.cls, in the same directory as my lab1.tex file. I then changed the preamble of my tex file to \documentclass{labs}. When I try to compile the ...
2
votes
1answer
95 views

LyX undefined control sequence \input

I'm a new user. I-m in trouble with lyX and in particular how to use \input{file.tex} correctly. Error: "undefined control sequence". Actually I'm not sure where I have to specify the path so that LyX ...
4
votes
1answer
102 views

Difference between renewing commands before and after \begin{document}

I was wondering what could be reasons for differences when I redefine control sequences in the preamble or after \begin{document}? For example, this code typesets abcd when compiled by any of ...
3
votes
1answer
61 views

Modest changes in LaTeX dialect possible?

I would like to create my own LaTeX-derivative markup language. (I asked similar questions before, but this is more limited.) Advice would be useful. First Question: I believe there are three main ...
22
votes
2answers
399 views

Multi-line options with the `\usepackage` command

When including a package using the \usepackage command that has a lot of options, are there: Any restrictions on how the options can be split across multiple lines? Any best practices for formatting ...
7
votes
2answers
80 views

Amend tabular environment in preamble: different font

I'd like to put some lines in the preamble to change the font of all tabulars in the document. I know that I can easily define my own environment »mytabular«. But for different reasons I need to ...
1
vote
0answers
13 views

Commenting out large blocks in the preamble when in draft mode [duplicate]

I would like something to enable me to comment out large blocks of my preamble when I've specified that my document is a draft. The comment environment provided by the verbatim package works well for ...
14
votes
1answer
109 views

Should babel package call be placed at the end of the preamble?

I remember to have read few year ago1 that babel line2 should be placed at the end of the preamble in order to avoid problems with other packages. (I believe hyperref package should also be placed at ...
3
votes
1answer
148 views

Splitting the preamble

When working with big documents, especially when dealing with many lists, graphics, figures and includes, I often come up with a structure roughly looking like this. \documentclass{beamer} [preamble ...
3
votes
0answers
42 views

At what point of my input file is the subfig package loaded? [duplicate]

When trying to compile my report, I receive an error related to the subcaption package (which I load in my preamble): ! Package subcaption Error: This package can't be used in cooperation ...
3
votes
1answer
91 views

\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?
3
votes
1answer
104 views

Cannot use nomencl package, makeindex doesn't works with my preamble

Time ago I had an issue with Tikz and mathpazo, building my preamble as a post here recommended. In that way my document could compile once again and well, so on the project grew. So my preamble now ...
7
votes
1answer
118 views

What are the pros and cons of packages versus \input for a preamble?

For a some simple cases it seems to me that there would be no important difference between putting some code in a file preamble.tex and having \input{preamble.tex} in the main .tex file putting it ...
12
votes
2answers
312 views

How can I easily use the same preamble on all my documents?

I use multiple computers (Mac and PC), so creating a path (e.g. \input{c:/folder/Preamble}) won't work. I really want to assign a URL (in Dropbox) to the file and input the file via the URL, but I ...
3
votes
1answer
116 views

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 tried \documentclass[a4paper,11pt]{article} ...
7
votes
2answers
2k views

How do I add something to the preamble in LyX?

I'm trying to add something to the preamble, but don't know how. I tried Insert -> Latex Code and just picked places on my article, but I guess they were never in the preamble? I guess I cannot ...
1
vote
1answer
60 views

Predefined settings in Wrapfig

I would like to use: \begin{wrapfigure}{r}[Xcm]{Ycm} \itshape \SomeSymbolHere\\ \fontsize{16}{16} \textbf{bla bla bla.} \end{wrapfigure} many times within my document, preferably writing something ...
13
votes
1answer
318 views

Leveraging a dynamic preamble to generate multiple output formats

Background The diagram below shows an architecture for generating books using a dynamic preamble. The top part of the image shows the database relations between a book theme and its preamble. The top ...
3
votes
1answer
41 views

Certain text always included in new document

Is there a way to make \documentclass and all that to always appear in a new document? It's annoying to have to copy from other documents.
0
votes
0answers
25 views

Preambles: using them in a neat way [duplicate]

All of these years that I am using LaTeX, I have finally found the packages and macros [preambles] that I like to use for my papers. The thing is that they are about 180 lines which are used all times ...
3
votes
1answer
444 views

Pandoc: minimal headers for LaTeX output

I'm taking mediawiki text and trying to convert it to latex in Pandoc. All seems to be reasonably well. However, I had to make sure to use: \documentclass{book} \usepackage{hyperref} ...
6
votes
2answers
260 views

What preamble does math.stackexchange.com use?

I am trying to use Anki to create calculus flash cards. I use the input box on the math.stackexchange.com site since it is the easiest LaTex editor I know of to use for math equations. However, I ...
16
votes
2answers
313 views

Should I make a package or class for my usual preamble, or include it in every document?

This TeX.SE thread is a good resource for how to make your usual preamble into a package or document class. I would like to know why I should do that. What are the pros and cons of doing so, as ...
13
votes
0answers
512 views

Speeding up compilation using precompiled preamble with LuaTeX

Compiling my documents with lualatex takes quite long. I have a complex preamble, and noticed it takes long to process this part of the file. Today I came across this website, which proposes a trick ...
6
votes
0answers
144 views

Need commands for creating manual “pre-compile” of preamble in Windows, perhaps by pressing a button [duplicate]

I would like to manually create a separate file with preamble "pre-compiled". I found a very simple example at: ultrafast pdflatex with precompiling where Jonas Stein describes their example: ...
3
votes
1answer
91 views

how to comment text depending on a number

I have a latex document with 24 questions labeled with numbers from 1 to 8. I want to give a number x between 1 and 8 to latex in the preamble so that all the questions become commented except the ...
10
votes
1answer
148 views

Different styles for the same document

Suppose I am writing a paper, which I plan to submit to a journal/conference, but also put on a preprint server like the arXiv. Each publisher has its own style files required for typesetting the ...
4
votes
1answer
379 views

Why does LaTeX make \DeclareMathSymbol and \DeclareSymbolFont preamble-only?

Is there any good and convincing reason to explain why LaTeX restricts usage of \DeclareSymbolFont and \DeclareMathSymbol to the preamble? and I could also ask the question for many other macros. ...
36
votes
7answers
2k views

Should I place \title, \author, \date in the preamble or after \begin{document}?

The motivation for this question Forgive me if this looks very basic to you but nobody has pointed out to me yet until now in a comment to a question that the \title command (and thus the other two ...
5
votes
1answer
2k views

Strange “There's no line here to end” error

I am starting my adventure with LaTeX. I have following code on my preamble: \usepackage{graphicx} \usepackage{setspace} \onehalfspacing \usepackage{indentfirst} \usepackage{titlesec} On third and ...
1
vote
1answer
449 views

How to place an image in bottom left hand corner on every page? [duplicate]

Possible Duplicate: How do I add an image in the upper, left-hand corner using TikZ and graphicx I would like to place a small image in the bottom left hand corner of every page of my ...
1
vote
3answers
385 views

dynamic paths in latex

Im trying to link from my preamble to some pictures used in the header. My problem is i use the same preamble in multiple documents. lets say the preamble and the needed picture is in the top folder, ...
4
votes
1answer
127 views

Should I load packages (for instance, all AMS packages) separately or all together?

I was reading some post here at SE and I noticed that many people load packages one by one. For example, \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amsthm} and so on. Usually, I load ...
5
votes
1answer
192 views

Tool to handle “precompiling the preamble” automatically

On Windows there is a nice little tool called latexdaemon that can handle "precompiling the preamble" (and thus speeding up compilation) automatically. It doesn't require any additional setup: one ...
7
votes
1answer
2k views

Using Palatino and Euler Math

I'm using Palatino font for my thesis calling in the preamble \usepackage[sc]{mathpazo} \linespread{1.05} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,italian]{babel} ...
7
votes
1answer
114 views

TikZ compiles in body, but not as command [duplicate]

Possible Duplicate: Problem with defining shortcuts for TikZ matrices. When I use the code below to draw a tikzpicture in the body of my document, it works just fine. However, when I define ...
3
votes
1answer
166 views

Is there a source function/capability in LaTeX [duplicate]

Possible Duplicate: How to make a standard preamble into a package I often have the same preamble stuff in my documents that kind of clutter the work space a bit. Some are custom commands ...
4
votes
1answer
208 views

\settowidth in preamble wrong with fontspec+lualatex w/ MWE

I am getting some strange behaviour using luaLaTeX and a rather simple command definition. I am using TeXLive 2012, Linux x86_64. When \settowidth is used in the preamble to compute the width of some ...
19
votes
1answer
1k views

ultrafast pdflatex with precompiling

I try to improve the time pdflatex needs to compile my book. Really working example book.tex %&preamble \begin{document} Hi \end{document} and preamble.tex \documentclass{article} I run ...
4
votes
2answers
317 views

How to write the preamble into a file

Can one define a bunch of macros, include them in a LaTeX source file main.tex and after issuing $ latex main.tex find the preamble of main.tex in a file, say main.nem ? It is a requirement, that ...
1
vote
1answer
130 views

Preamble vs. external style file - same code doesn't work in the later

I'm experiencing the following issue when using todonotes along with TikZ and its externalize library. If my document contains no \todo's then it compiles just fine and seems like the externalization ...
4
votes
3answers
253 views

Creating complex documents from separate files

I have multiple documents (file1.tex, file2.tex, etc.) and one main file (let's call it main.tex). I would like to build a complex document that contains all file_i.tex files. I tried this (according ...
2
votes
2answers
57 views

Could using different packages cause a contradiction for the compiler?

If I am writing a pdf with LaTeX, I would like to use commands from different packages for figures or tables or what so ever ... and I just use all the packages i need, could this lead to a ...
10
votes
2answers
551 views

Are there any situtations where it is better to load a package after other code?

I always place all my packages immediately following the document class, followed by setting information (\hypersetup for example) and customization to my documents (header and footer customization ...
6
votes
1answer
628 views

Bibliography preamble \bibpreamble natbib

I am trying to produce some text after the "References" heading, but before the numbered references themselves. I had read that using the natbib package and the command \bibpreamble{...insert preamble ...
6
votes
2answers
239 views

\dimexpr gives 0pt

Why on earth does the following expression give me 0.0pt? \edef\x{\the\dimexpr 3ex-1ex\relax} I assume ex is a LaTeX unit, as it isn't in the TeXbook. Please where is it defined in the kernel? ...