{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

3
votes
2answers
44 views

Number of pages in preamble

I have tried this to use the number of pages as an option to a package: \documentclass{article} \usepackage{lipsum} \usepackage{lastpage} \usepackage{refcount} \newcounter{mylastpage} ...
2
votes
1answer
20 views

permanent preamble in bibdesk-texshop

I use TexShop as my bib file generator and manage it with Bibdesk (I have a mac). How do I add a command to the preamble of the bib file which will always stay there even when I update my references ...
0
votes
1answer
29 views

LaTeX not hyphenating with current preamble

I have the following code generated, with my preamble here, and here's just some of the text in it. Below the code I'll show a screenshot of how it looks once compiled. %Setup og layout pakker ...
0
votes
0answers
32 views

when does the order of packages in a preamble matter? [duplicate]

I am writing my first very long document (thesis) and decided to try to keep things super organized to avoid future headaches. One thing I decided to do is to categorize the things in my preamble, ...
0
votes
0answers
31 views

Problem with a table in the header of document - LyX

I am trying to put a table as header of every page of my document. This is the cose I put in the Latex preamble setting of LyX: \usepackage{eso-pic} \AddToShipoutPicture{% \AtPageUpperLeft{% ...
1
vote
0answers
34 views

Personalize document headerwith a table - Lyx

I am trying to put a table as header of every page of my document. This is the cose I put in the Latex preamble setting of LyX: \usepackage{eso-pic} \AddToShipoutPicture{% \AtPageUpperLeft{% ...
2
votes
1answer
44 views

How to change the arrows tips for the whole document?

After I asked this question: What is "\SelectTips{a}{b}" (and how to increase the head of an arrow's head?) I'd like to know one more thing: I want to change it (the arrow tips) for the ...
33
votes
4answers
695 views

Creating a default preamble

Since I am using (almost) the same set up for my tex documents, I wonder if there is a way to create a preamble with my default packages and to recall it anytime I want to create a tex document. If ...
1
vote
0answers
32 views

Invalid Latex preamble (in lyx)?

I'm running into an error while trying to preview my document created in lyx: after adding the language setting as described here. My preamble is as follows:
1
vote
0answers
30 views

Compilation Emergency Error due to preamble (ShareLatex)

I'm fairly new to Sharelatex but I've made a fourth semester project in it before but this time the preamble seems to not be working at all even though I copied the exact sources from my fourth ...
7
votes
2answers
468 views

Is it possible to write `\left(` `\right)` in one command?

\documentclass{amsart} \DeclarePairedDelimiter{\pr}{\left(}{\right)} \begin{document} $\pr{x,y}$ \end{document} I found the commands \left( \right) quite flexible and hence useful; but I am not ...
2
votes
0answers
59 views

What hyperref options should be used for correct Unicode output?

I am trying to work out which hyperref options allow all Unicode characters to display properly, and whether XeLaTeX, LuaLaTeX, and pdfLaTeX have different configuration requirements. The hyperref ...
0
votes
0answers
36 views

Packages canceling each other? (Font-Changing problems)

I'm fairly new to Latex, and recently I started to compile my files with XeLaTeX (because I learned that would be helpful since sometimes I need to type some texts in Japanese), but recently I caught ...
2
votes
1answer
61 views

.sty file in preamble

Suppose I have the following code: %! xelatex \documentclass{report} \usepackage{fontspec} \usepackage{xltxtra,xgreek} \setmainfont{Times New Roman} \usepackage{definitions} ...
1
vote
1answer
41 views

Defining glossary entries on the fly?

I am using glossaries package and Xindy to generate glossaries in Persian. Do I have to separately define the words to be included in the glossary? I tried to define a command that defines the entry ...
3
votes
2answers
156 views

How to define letter-spacing of a custom environment?

Say I have: %defines a vertical bridge hand with seat name \newcommand{\hand}[5]{ \begin{minipage}[t]{1.0cm} \begin{tabbing} \textsc{#1} \= \\ \s\Hair\=#2 \\ \h \> #3 \\ \d \> #4 \\ \c \> #5 ...
0
votes
1answer
39 views

Using custom commands in preamble

I have a the following command in a resume.cls file \newcommand{\name}[1][]{\newcommand{\@name}{#1}} I try to use it in my tex file with \documentclass{resume} \name{My Name} % use \@name in ...
3
votes
2answers
227 views

If, elseif and else conditionals in the preamble

I have a scenario where I need to define a few commands and environments based on some condition in the preamble. I used to use \newtoggle, set the conditional using \toggletrue or \togglefalse and ...
6
votes
0answers
107 views

How to precompile preamble when using arara

A different tex question led me to a link regarding a precompiled preamble. I use arara for all of my runs. What is the correct procedure to use a precompiled preamble for each of the runs made ...
0
votes
1answer
36 views

adding a lable to a newcommand in the preamble using mhchem and fancyref

I'm using [version=4]{mhchem} and fancyref as packages. In mchem's manual there is a code given for the preamble that allows easily to enumberate the chemical equations like the normal equations: ...
2
votes
0answers
33 views

\include'ing a remote file

I am creating a small header file for students that they need to include in the preamble of their document. The changes are minor enough to not need a class file. However, I do not want them to ...
2
votes
2answers
199 views

Writing the entire document as a command

When writing a document, I like to use the following format. %Settings for document %Packages I need \newcommand{\insertdocument}{ %Everything that would ordinarily be put between \begin{document} ...
4
votes
3answers
105 views

Abbreviating commands with shorter commands, launchable from the body

I have a pretty complicated command, lets call it "C" in the preamble a long document that changes how the document looks. If I'm writing text somewhere in the middle of the document, I'd like to ...
4
votes
1answer
43 views

Preamble works in .tex file but not in .sty file

I have a question concerning .sty files. I often use the same preamble in my latex documents and so I wanted to put it into a .sty file. I started with the first few lines, but it already does not ...
5
votes
1answer
102 views

is it possible to have too many things in preamble?

this might seem like dumb question, but .. I'm going to ask it anyway since I'm not an informatician I don't know quite how this works actually. I'm working on my Phd now and I already have ...
1
vote
1answer
358 views

Xetex - Font not found!

I'm a TeX Newbie and I'm trying to get XeTex to work with FontAwesome. Initially I got the error : The font "FontAwesome" cannot be found. So I added the path defaultfontfeatures as suggested in: ...
5
votes
1answer
53 views

Can \totvalue be called in the preamble?

I am trying to use the totcount package, and I noticed some strange behaviour I cannot explain. With the following MWE : \documentclass{book} \usepackage{lipsum} \usepackage{totcount} ...
0
votes
0answers
82 views

\RequirePackage{tikz} in dissertation .cls file

I'm trying to edit the standard .cls file provided by my university towards dissertations to include TikZ pictures. I tried adding \RequirePackage{tikz} in the class file and separately, adding ...
1
vote
2answers
63 views

Indenting text in all paragraphs

I want to indent all the text in all the paragraphs in a document I am writing. Below is the method I am using to accomplish this. It works well enough but I was wondering if I could somehow put the ...
1
vote
1answer
93 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 ...
7
votes
1answer
120 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
254 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
146 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
30 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
65 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
84 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
90 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} ...
4
votes
2answers
451 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
362 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
183 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 ...
2
votes
1answer
114 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
119 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
381 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
100 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} ...
3
votes
1answer
210 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
143 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
131 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
125 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
124 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
226 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 ...