Tagged Questions

{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

15
votes
1answer
409 views

Sorting preamble packages thematically while accounting for compulsory load orders

Within a document's preamble (or a custom "preamble" package), at times there's the need to take compulsory load orders for certain packages into account. Most packages must be loaded before the ...
5
votes
1answer
141 views

What is pkgindoc.sty really for?

During a discussion of this question, I looked a bit into the pkgindoc.sty buried in ltclass.dtx (docstrip option afterpreamble). While I understand how this works (and it works in an ugly way IMHO), ...
7
votes
2answers
1k views

Hide all images, listings and equations?

is there any way to hide all images, equations and all listings (embedded by using lstlisting package) manually by setting a certain command in the preamble? It would just be interesting to see how ...
5
votes
3answers
363 views

Is there a \foreach function that works in the preamble?

Tikz/PGF has an extremely useful implementation of \foreach, which allows for instance the construction \foreach \x / \y in {1/a,2/b,3/c,4/d} {\x is a lot like \y} in which you can iterate over a ...
3
votes
1answer
2k views

lyx newcommand and newtheorem

I have two simple problems with preamble (Lyx 2.0.0rc3 on Ubuntu 11.04 or Debian Wheezy) If I put in preamble the line \newcommand{\gra}{\alpha} then within the math formula when I type \gra I ...
11
votes
2answers
4k 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 ...
12
votes
2answers
377 views

How does one detect whether one is in the preamble or not?

In LaTeX, I'd like to know whether a documentclass has been loaded and whether code is inside a \begin{document}. In other words, is there a \ifpreamble similar to \ifvmode and friends? ...
2
votes
1answer
571 views

LyX: modify thesis.cls preamble

I'm using LyX and a custom class from Colorado-Boulder which is based on the thesis class. I'm at another school and my advisor wants me to include titles of the readers on the signature page as well ...
4
votes
1answer
558 views

Only \usepackage if the package can be found [duplicate]

Possible Duplicate: Conditional “if a package is available” I'm using a package "mcode.sty" that enhances/colors listings output; typesetting will work perfectly without it. ...
7
votes
1answer
708 views

Compiling partial documents (without document tags)

I am getting some colleagues to migrate from Word to LaTeX for technical documents, but old habits die hard. I am looking for a way to compile each LaTeX document partially without document tags, so ...
10
votes
2answers
3k views

Where to put a custom macros file?

I have a bunch of common commands I put in document preambles. I don't always use them all, but it makes the preamble too long for my tastes. I want to put them all in an external file (preferably in ...
5
votes
1answer
435 views

How do I call microtype's \SetProtrusion in the preamble?

In this answer about full justification for italic text, I used microtype's \SetProtrusion to get better-looking margin kerning for italics. It works fine, but I had to call \SetProtrusion after ...
13
votes
2answers
4k views

Create new paragraph style in LyX

Background In OpenOffice and Microsoft Word it takes seconds to create a new paragraph style. Here is how I currently use LyX with the KOMA Script document class to mark text as a quotation: Type ...
5
votes
1answer
330 views

How do I use git submodules to keep one preamble template for all my documents?

I’ve read this which outlines the advantages of using submodules in git to use one centralized preamble .tex to be used for all future LaTeX document. When the preamble is changed, all documents ...
3
votes
1answer
1k views

Trouble setting a length [closed]

I'm starting with LaTeX, and there are things that puzzle me. I'm trying to set a length that's the \textwidth minus (let's say for example) two inches. In the preamble, I wrote: \newlength{\bplen} ...
5
votes
3answers
4k views

Chapters and Formatting Headers

When I am composing a large document in LaTeX, I often compose the chapters in separate documents. When I do this I have to copy and paste a large block of header text to the chapter I am editing so I ...
7
votes
0answers
319 views

What's the right order when loading packages? [duplicate]

Possible Duplicate: Non-commutative packages I remember reading in some reference guide that the order of loading packages with \usepackage in principle doesn't matter. Real life, however, ...
6
votes
4answers
674 views

TeX daemon for Windows

A simple question (in theory): is there any (La)TeX distribution for Windows that is capable of running as a daemon? I am not aware that either MiKTeX or TeX Live are capable as running as daemons on ...
35
votes
5answers
4k views

How to make a standard preamble into a package

I have a preamble that I copy and paste into nearly all of my documents. Is there a nice way to turn this into a package than I can use? I would prefer to do this in a way that doesn't depend on my ...
7
votes
2answers
1k views

Automatically define macros in LyX documents

I'm using LyX all the time and over the last 2 years I've accumulated some very handy macros for my lecture notes. As it is today, every time I start a new document, I copy and paste the macros from ...