{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
1answer
22 views

Malfunction when loading preamble code using \include{}

I am trying to load a piece of code using \include{file}. This code uses tikz to create fancy chapters. The weird thing is that when I load my code, the \chaptername gets cut(after running the code ...
2
votes
1answer
36 views

Is it possible to collect hyperref's \hypersetup argument?

Suppose you want to set, in a .sty or .cls file, some hyperref's options in case the end user loads this package. Because that's only at the begin of the document you know if hyperref has been loaded, ...
2
votes
1answer
57 views

Create an Appendix with sections for extra tables, and a Appendix with sections for demonstrations

I would like to include an "Annex" chapter named "Anexos", which would have several sections, in which extra tables would be exposed. In addition, demonstrations would be included in an "Appendix" ...
1
vote
0answers
37 views

lyx - Lost table of contents [closed]

All has been going well for weeks, but in an attempt to change font-style in headers, I've lost the table of contents: e.g. it doesn't show up in the pdf. **** Here's my preamble: % DO NOT ALTER ...
1
vote
0answers
47 views

Error with custom definition

I am working on a file on multiple computers, laptop and PC. I am using TexStudio, same version on both. On the laptop, the file compiles fine, but on the PC I am having trouble. On the PC, when I ...
3
votes
1answer
197 views

Forcing text into a document with class

I'm creating a style sheet for my organizations memos and reports. I need to include a disclaimer type of statement into ever report created with the style. I'm uses a class document (*.cls) based ...
2
votes
0answers
56 views

How to follow the DRY (Dont Repeat Yourself) in multidoc?

What is the best way to keep the configurations and same content in different parts of the main document reusable from single location (e.g. from child document)? First idea was to have this ...
1
vote
1answer
44 views

Adding contents for the end of the document in the preamble

I create lots of LaTeX documents and put all my declarations into a header.tex that I use with \input{header.tex} at the beginning. However, I am migrated that into a header.sty and just use ...
3
votes
1answer
44 views

Command \env already defined

This is a follow-up to How to ignore everything in the document environment?. The code below is intended to extract the value of a token that occurs before \begin{document}. For some reason, there ...
0
votes
2answers
126 views

Need help to create such a beautiful title page

I have seen such a beautiful preamble (got the PDF from on of my studentfriends and need help to create such a beautiful titlepage. The black bands are to make the picture anonymous, to hide the ...
6
votes
2answers
268 views

Preamble anywhere

If I want to use a set of macros in my tex document, I have to obviously include the appropriate packages IN THE PREAMBLE. So now, i write a 100 page document, with 55 packages already included (in a ...
2
votes
2answers
44 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
479 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
107 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
64 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
59 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
366 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
118 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
65 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 ...
23
votes
2answers
480 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
105 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
14 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 ...
15
votes
1answer
127 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
179 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
111 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
147 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
127 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
325 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
147 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} ...
10
votes
2answers
3k 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
64 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 ...
14
votes
1answer
349 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
43 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.
4
votes
1answer
576 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
282 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
329 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 ...
21
votes
0answers
691 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
95 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
156 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 ...
6
votes
1answer
491 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
3k 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
594 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
470 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
135 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
199 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
3k 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
127 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 ...