Tagged Questions

{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

7
votes
1answer
553 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 ...
6
votes
1answer
4k 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
655 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
535 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
151 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
202 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 ...
8
votes
1answer
4k 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
130 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
186 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
258 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 ...
20
votes
1answer
2k 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
414 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
146 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
285 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
59 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
706 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
832 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
249 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? ...
6
votes
2answers
2k views

Is it possible to create a LaTeX preamble “header”?

Is it possible to create a header in LaTeX containing my usual preamble, functioning similar to a header in C? Specifically, can I write a text document (or something similar) with the preamble that I ...
5
votes
1answer
4k views

Define abstract environment in book

I want to define an abstract environment for \documentclass{book}. Therefore, I copied the relevant definitions from report.cls from here into my preamble. But it doesn't work. Where's the problem? ...
5
votes
1answer
394 views

Similar header format for my company

I need to reproduce the following header format: Please help; I'm a completely starter at LaTeX or TeX. I work with LyX and this is included in the document's preamble: \usepackage{fancyhdr} ...
13
votes
4answers
2k views

Make align* number the last equation

I am using the align* environment to write equations expanding several lines. I would like to define a command sequence in the preamble, such that the last equation of this block will always be ...
4
votes
2answers
169 views

How to change the maths symbols in preamble?

I have already finished writing my work and now I decided to change notation. How can I do it in preamble? More precisely I use $\mathcal{R}([a,b])$ in all my work and I would prefer to get ...
1
vote
1answer
510 views

How can I affect my table formatting from the preamble?

I'd like to change my LaTeX table formatting slightly, but due to the way the documents are generated, I can't do so by changing the actual LaTeX code, but can change what will appear in the preamble. ...
1
vote
1answer
1k views

“Preamble” menu item does not appear in LyX

I'm trying to use xy-pic in LyX to create diagrams and using this tutorial. It says on page 3 to go Layout->Document->Preamble to enable the xy-pic package. However, there is no "Layout" menu on my ...
4
votes
1answer
166 views

how to organise common preamble of dtx files

I have some new packages (see latexthesistemplate/trunk/packages/template which all use a shared preamble file. I want all of them to have the same packages and commands available and the same ...
2
votes
1answer
744 views

Change background colour of {verbatim} environment

In an existing document which is not to be modified (except for the preamble), all instances of \begin{verbatim}...\end{verbatim} should have their contents rendered not only in a monospaced font but ...
3
votes
2answers
176 views

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 ...
6
votes
2answers
692 views

“Double use” of a4paper (geometry/KOMA)?

In my preamble, should I give the a4paper option just once or twice, i. e. once for the KOMA-script document class (scrartcl) and once for geometry? Is this redundant or does scrartcl need the option ...
3
votes
1answer
184 views

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.
4
votes
2answers
375 views

expand macro in single byte encoded code

In this minimal (not) working example, I try to use single-byte latin10-encoded source file, and expand a command-macro containing a character with \catcode254: % -*- mode: latex; unibyte: t; ...
0
votes
1answer
820 views

Multiple references separated by semi-colon

The following is in the preamble I "inherited": \documentclass[a4paper,12pt]{book} \usepackage{amsmath, amsthm, amssymb} \usepackage{fancyhdr} \pagestyle{fancy} \renewcommand{\headrulewidth}{0.1pt} % ...
4
votes
1answer
311 views

How to set two backgrounds?

background package defines a background with absolute position in preamble, but how to set two independent backgrounds at different positions? Consider we have two backgrounds as \SetBgColor{red} ...
5
votes
1answer
292 views

Why doesn't latexmk handle errors in the preamble?

Today I discovered that if I have an error in the preamble of my tex file then Latexmk produce an error only once. Precisely, for example if my file looks like this \documentclass{article} ...
9
votes
2answers
533 views

Precompile header with xelatex

I read about precompiling the preamble in http://tex.stackexchange.com/a/15606/4918 and it worked fine with pdflatex but how can I do this for xelatex? I tried xelatex -ini -shell-escape ...
2
votes
1answer
7k views

LyX fancy header \thispagestyle{fancy}

I am using LyX and would like (all) my document pages to have a fancy header style that I defined. However, including \thispagestyle{fancy} or \AtBeginDocument{\thispagestyle{fancy}} doesn't ...
13
votes
4answers
864 views

meta packages and typesetting

Background(just ignore): Is there an exhaustive list of packages that you should load and of things you should do to improve your document? Here I mean packages and things that have to do with the ...
6
votes
1answer
4k views

How does \include work in terms of preamble? And is \input better?

When you have different files; say different chapters of a book, that are written in separate Tex files, all having their own preamble packages and document class options, how does it work when you ...
103
votes
5answers
5k views

Best practice on organising your preamble

I am putting together a large document and my preamble is unwieldly and disorganised. What order does it make sense to load packages. Obviously, hyperref goes last, apart from things that have to go ...
11
votes
2answers
366 views

Using breakable hyphen "= in \newcommand

I want to use a breakable hyphen "= in a command: \documentclass[a4paper]{article} \usepackage[ngerman]{babel} \newcommand{\TT}{Test"=Text } \begin{document} This is a test whether the hyphen in \TT ...
13
votes
2answers
383 views

Is it possible to define a `multicols{2}` preamble switch that works for \chapter?

With standard LaTeX, issuing \twocolumn in the preambe causes the document to be typeset in two columns -- except that \chapter will produce separate one-column chapter headings. \documentclass{book} ...
17
votes
2answers
380 views

Load package after other package with \AfterPackage

I want to group packages together (in the real document, I load many more packages) and want to solve the sorting of the packages with commands like \AfterPackage from KOMA-Script. I am using this ...
4
votes
2answers
137 views

Recreate the conditions of the document preamble while loading a file in the document body

While in the document body I like to temporary switch back to the mode active in the LaTeX preamble, i.e. spaces between macros should be ignored. I don't mind whether I get the ! LaTeX Error: Missing ...
8
votes
1answer
217 views

Can I amend the preamble from outside the preamble?

I am writing a document (mydoc.tex) that will include a section as a separate document (mysection.tex) using \input{mysection.tex}. If I want to include something in the preamble (specifically ...
12
votes
2answers
2k views

Placing items before \documentclass

When looking in books or at sample code, I always see \documentclass appearing first. Is that absolutely necessary? I have created some test code which seems to compile fine: \def\SetClass{article} ...
18
votes
6answers
7k views

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 ...
7
votes
3answers
2k views

Good LaTeX preambles for math thesis

Can someone provide me an example of a nice preamble to write a math thesis? I am currently using \documentclass[12pt]{article} \topmargin -15mm \textheight 24truecm \textwidth 16truecm ...
3
votes
1answer
242 views

Extracting parts of a .sty file

Can you load only some specific parts from a package while not loading the rest at all? For example, from the code below I wanted to load only the \newcommands %theorems \usepackage{theorem} ...
7
votes
3answers
591 views

Disable babel's shorthands

I want to disable babel's shorthands in my own sty file. But since I can use \shorthands{off} only inside the document environment, I struggle with this. Is there a way to disable babel's shorthands ...