{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

1
vote
2answers
49 views

\newpage does not seem to create a new page

Brand new to LaTeX, using LaTeXit on OSX 10.10.1. Here is my preamble and my code after the preamble. \documentclass[10pt]{article} \usepackage[usenames]{color} %used for font color ...
1
vote
1answer
36 views

Chapters number moves out of margin

i'm new to LaTeX and got a problem. The picture says it all... When my number of chapters exceeds 9, the second digit moves out of the margin.... I have copied the following layout, for the ...
2
votes
0answers
65 views

LaTeX: macro templates

Often at the end of astronomical papers there is written that it was created using the AAS LaTeX macro v5.2 . Do I understand this right that one can download such a template with all preamples at the ...
0
votes
1answer
43 views

Improve my TeX-layout + Illegal pream-token

First of all, when I compile my TeX document it says: "! Package array Error: Illegal pream-token (D): `c' used." How can that happend? Second, I am gonna deliver a huge assignment in two weeks, so ...
0
votes
0answers
19 views

Insert a image to Latex preamble in LYX

I am writing a survey report and I need used a template as a cover page from here. It is working fine and now I need to add my university logo into that cover page. Cover page has been included in to ...
0
votes
0answers
43 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
34 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
51 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
17 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
47 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
48 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
32 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
47 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
72 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
58 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
113 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
60 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
54 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
347 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
61 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
56 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
62 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
172 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
283 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
48 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
604 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 ...
5
votes
1answer
151 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
102 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
111 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
648 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
129 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
75 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
569 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
126 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
143 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
200 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
179 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
197 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
142 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
338 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
192 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
73 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
380 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
708 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} ...