{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
0answers
40 views

Hyperref and description environment

I am trying to put an hyperref command inside an item name in the description environment. The following MWE works as expected (this is what I am trying to achieve!): \documentclass{article} ...
4
votes
1answer
448 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 ...
6
votes
1answer
64 views

suppress single macro from style file

I have a master style file of macros, which I use for all of my documents. Is there something I can add to the preamble of a particular file so that it ignores some specific macro from my style file? ...
2
votes
1answer
56 views

How do you efficiently make your preamble in LaTeX?

I use Atom frequently but used to use TeXWorks to write my LaTeX documents. In TeXWorks managing templates was relatively nice and easy and kept me from having to write out the preamble (i.e. ...
2
votes
2answers
39 views

Conditional preamble and pstricks problem \psTilt and \PstLightThreeDText

Look at the following MWE. \PassOptionsToPackage{export}{adjustbox} \documentclass{article} \usepackage{fancyvrb} \usepackage{graphicx} \usepackage{adjustbox} \newcounter{psextern} \makeatletter ...
0
votes
0answers
26 views

conflicting packages -

I need help figuring out which packages are conflicting in my document. I get the error message at the lines 35 and 44: \T already defined' and \U already defined' My preamble includes: ...
4
votes
2answers
83 views

Conflict when using \newcommand

I've just realized that I made a big mistake sometime ago when in my preamble I defined the new command \renewcommand{\v}{\mathbf{v}} Now, I'd like to type the czech s using \v{s}, but I can't. ...
0
votes
1answer
40 views

Installing feynmp / feynmf to TexMaker

What packages do I need to download and what I need to have in my preamble in order to use feynmp and feynmf in texmaker?
1
vote
2answers
54 views

Externalizing tikz with precompiled preamble

This is a very special case, I guess, but it's what I need: %&Testing \documentclass{article} \endofdump \usepackage{pgfplots} \usetikzlibrary{external} \tikzexternalize \begin{document} ...
2
votes
1answer
36 views

Getting user defined constants into the preamble

I think this is a problem of expandable content, a concept I haven't quite got the hang of yet... Lets say I have a preamble or cls file that is trying to configure hyperref. If I have manually setup ...
0
votes
0answers
16 views

changing cross-references' names in LyX 2.1.0

Salut. I am writing an article in LyX 2.1.0 in a language other than English. How do I change the cross-references' names, eg. from "Figure 1" or "equation 1" to "xxx 1" and "yyy 1" ? I have been ...
0
votes
0answers
22 views

Prevent line breaks after specific words in general

I am sorry if this is duplicate but I couldn't find it... or, more specifically, I've found something even more general, but I didn't understand a word from it :D Prevent line-breaking after short ...
3
votes
1answer
49 views

Making a long macro/shortcut in Latex

I was wondering if it was possible to make a big macro, for inserting figures? I wanted it to contain: \begin{figure} [H] \centering \includegraphics[scale=0.8]{#FILENAME} \caption{#FIGURECAPTION ...
3
votes
2answers
83 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
40 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
37 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
33 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, ...
2
votes
1answer
47 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 ...
34
votes
4answers
866 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 ...
0
votes
0answers
36 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
40 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{% ...
4
votes
2answers
1k 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
1answer
248 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 ...
5
votes
2answers
417 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 ...
1
vote
0answers
47 views

Invalid Latex preamble (in lyx)? [on hold]

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
43 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
482 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
102 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
40 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
68 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} ...
7
votes
3answers
4k views

Good LaTeX preambles for math thesis

Can someone provide me an example of a nice preamble to write a math thesis? I am currently using \documentclass[12pt]{article} \topmargin -15mm \textheight 24truecm \textwidth 16truecm ...
1
vote
1answer
56 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
160 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 ...
1
vote
1answer
51 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 ...
7
votes
0answers
115 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 ...
42
votes
1answer
2k views

Speeding up compilation using precompiled preamble with LuaTeX

Compiling my documents with lualatex takes quite long. I have a complex preamble, and I noticed that it takes long to process this part of the file. Today, I came across this website, which proposes ...
3
votes
2answers
332 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 ...
0
votes
1answer
46 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
35 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 ...
4
votes
2answers
109 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 ...
2
votes
2answers
206 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
1answer
44 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
110 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
661 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
57 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
93 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
70 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 ...
15
votes
3answers
5k views

Precompiled preamble with TikZ/Externalize

I'm using the externalize capability of TikZ (external library) to speed up compilation of my TikZ pictures (as explained in Script to automate externalizing tikz graphics). In addition, I would like ...
1
vote
1answer
132 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
137 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 ...