{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

0
votes
0answers
35 views

Given this preamble, what font would be used?

Given the following code sample, what font would LaTeX actually use? I've looked in various places, but the help on fonts seems too cunning to be understood. This is definitely a different question ...
2
votes
1answer
26 views

How to modify default parameters in the Algorithmic Environment module using LyX?

I'm using LyX together with the Springer Journal LaTeX template to write a document. I'm also using the Algorithmic Environment module to create an algorithm layout within my document. The problem is ...
6
votes
1answer
48 views

Why hyperref's \url may be used in preamble within a macro but not within a box?

The following MWE, where a macro involving hyperref's \url is defined in the preamble, works like a charm: \documentclass{article} \usepackage{hyperref} % ...
0
votes
0answers
16 views

How can I modify the preamble in Lyx? [duplicate]

I am using Lyx and need to modify my document's preamble. Where should I add \documentclass[openany]{scrbook} \usepackage{classicthesis} \begin{document} \chapter{A} in order to remove blank ...
2
votes
1answer
43 views

include a preamble in a standalone

I need to make many images wich uses the same preamble. To make those images, I use the document class standalone. My aim would be to create a file preamble.tex and to include it in the other files, ...
4
votes
1answer
41 views

Beamer not compiling presentation properly

I am making a beamer presentation, and it doesn't seem to want to be my friend. The main problems: (1) When it compiles (pdflatex) the output is a series of slides, and after each \pause it ...
0
votes
0answers
30 views

Please insert into preamble [duplicate]

I encounter a problem with "preamble". I don't know if it is a language issue. I write both in english and greek in my .tex file, using the babel package and I have made a table of contents in greek, ...
4
votes
0answers
44 views

Errors when loading a package with AtEndPreamble hook

Consider the following (not so) MWE: \documentclass{article} \usepackage[style=authoryear-comp,backend=biber]{biblatex} \addbibresource{biblatex-examples.bib} \makeatletter % Load xpatch and ...
3
votes
1answer
65 views

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} ...
1
vote
0answers
31 views

LyX 2.1 Report Class Changing Part to Other Text When Using non-TeX fonts (via XeTeX/LuaTeX) [duplicate]

I am using LyX 2.1 with the document class "Report". I am writing my thesis, which consists of three essays. How do I change word "Part" for each section to "Essay"? I have not been able to find an ...
2
votes
1answer
34 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
53 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
92 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
54 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
52 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
294 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
60 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
50 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
55 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
164 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
282 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
46 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
578 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
130 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
96 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
98 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
609 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
126 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
71 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
554 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
118 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
140 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
197 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
158 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
187 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
140 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
333 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
182 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} ...
11
votes
2answers
4k 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
72 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 ...
15
votes
1answer
375 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
44 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
682 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
306 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
345 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 ...
22
votes
0answers
880 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
145 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 ...