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

Automaticaly add paragraph spacing only between two textual paragraphs

I can use: \setlength{\parskip}{\baselineskip} \setlength{\parindent}{0pt} But this messes up the rest of the document as it also increases the spacing after chapters, sections, sub-sections, and ...
6
votes
1answer
66 views

Changing concrete preamble from pdfLatex to Lua(la)tex

I got an example handout which was written for pdflatex but since I use lualatex i'm pretty sure that I have to make some changes to the preamble. From there Frequently loaded packages: Differences ...
1
vote
1answer
47 views

Error: 'I can't write on file 'Main.pdf'

I suddenly keep getting the error message in the title. I have no idea what I did wrong as I did not have this problem before. I know this error can occur if the corresponding pdf file is opened, but ...
5
votes
1answer
52 views

How can I override geometry's scale in the preamble? (E.g. if a class or package has set a default using geometry.)

With some geometry options, it is possible to override a previous setting in the preamble. For example: \documentclass{article} \usepackage{geometry} \geometry{hmarginratio=1:1} ...
0
votes
0answers
29 views

Font Identification [duplicate]

Can anyone identify the font that is used in this article? Furthermore, is this font compatible with the 'article' class? Note: Using CTRL+D within Adobe Acrobat presents a number of fonts the ...
3
votes
2answers
38 views

how to add a horizontal line before every section by controlling the style of section

I want to add horizontal lines before every section, just like this manually I can just put \rule{\textwidth}{1pt} before every section, but I want a more flexible method, for example, by putting ...
2
votes
1answer
44 views

How to get in preamble the correct total pages number?

Context: In a personal class (for two sided documents), I'd like to translate the layout area towards inner or outer margins (thanks to geometry package's settings), depending on the total pages ...
0
votes
1answer
38 views

Asterisk in Title Issue

I'm using overleaf for a paper and I'm using a journal template with the following in the preamble: % \documentclass[% reprint, amsmath,amssymb, aps, ]{revtex4-1} \usepackage{float} ...
3
votes
2answers
72 views

How to edit LaTeX preamble in source pane under LyX?

I want to add some lines in LyX preamble but not finding how to do that. If anyone help that would be much appreciated. See this is my preamble: \documentclass[english]{article} ...
3
votes
1answer
106 views

\usetikzlibrary should be used only in preamble in case of french babel

The compilation of the following MWE (Edit: The babel library is now loaded in the preamble, as needed (thanks to an @egreg's comment), and another one, no matter which one, is loaded after the ...
0
votes
0answers
69 views

Comments in preamble causing errors in build with “pre-compiled” format file using mylatexformat?

Consider the following MWE - nearly the same as in Failure with [greek] babel and lastpage, \frontmatter?, but not exactly - where I have a large document, for which I wanted to generate "precompiled ...
1
vote
1answer
37 views

Failure with [greek] babel and lastpage, \frontmatter?

I have a large document, for which I wanted to generate "precompiled headers" (TikZ's externalization and mylatex (note, \jobname should be the same)) and thought I'd use mylatexformat for it ...
0
votes
0answers
40 views

How to input multiple files with specific preambles?

I am finishing my thesis and I need to include all of these minor, standalone project into one pice. However, I have trouble how to bite this problem. I found many "how-to-input-files" questions but ...
3
votes
1answer
164 views

Modular LaTeX document preambles and class files

I have been debating whether or not to ask this question as I don't intend to create an overly broad unanswerable, or solely opinion based question, but I have decided that there are probably some ...
0
votes
2answers
57 views

set parbox in preamble

is there any way to set a \parbox of a specific size in the preamble and then automatically pass text from the main body into it? \documentclass{article} \usepackage[utf8]{inputenc} ...
2
votes
1answer
60 views

Line spacing in book document class

how would I go about manipulating the line spacing in the preamble? I am using the 'book' document class. Thanks a lot.
8
votes
2answers
118 views

Is it possible to pop a command from the \@preamblecmds list?

Is it possible to pop a command from the \@preamblecmds list? The use case I have in mind is to allow \DeclareMathOperator to be used after the preamble.
1
vote
2answers
90 views

Adding a preamble to a LaTeX bibliography

Using package natbib, I'm able to add a comment just above my document's bibliography using: \renewcommand{\bibpreamble}{Some text\ldots} I'm adding this command to the document's preamble, and the ...
4
votes
1answer
83 views

What does this preamble do? (dvips) and (epsf)

I am in the process of converting an author's paper into a journal template and I am having a great deal of difficulty understanding what this portion of their preamble does. ...
1
vote
2answers
71 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 ...
4
votes
1answer
169 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
100 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
1answer
59 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
49 views

Given this preamble, what font would be used? [duplicate]

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
103 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
81 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
90 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
68 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
34 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
108 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
108 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
35 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
43 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
89 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
188 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
89 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
66 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
499 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 ...
3
votes
0answers
77 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
61 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
84 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
223 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
305 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
52 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
779 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
198 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
162 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
160 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
969 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 ...