Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there.

Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document.

As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them.

This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But please explain why in the comments.)

Also see our community poll question: “I have used the following packages / classes”

share|improve this question
4  
Personally, I'd find a single list, separated by headings (Ex. Format, Math, Bib,Images, Other for this question), with a list of everyone's packages and how they're different from other packages in the section much more readable and useful. That amsmath is the highest voted just says that the MO community is here in full force. The less-known, but equally relevant formatting packages linked by Vivi, Joseph, and András are invisible without a lot of scrolling and reading. –  Kevin Vermeer Jul 29 '10 at 22:37
5  
I think the list of one package per answer is a good idea, as we can vote on individual packages... –  Amir Rachum Jul 30 '10 at 11:30

55 Answers 55

This question assumes you are making a LaTeX document for personal use. If you are planning to submit the document to a journal, it's safer to avoid using too many unusual classes, because they may be incompatible with the journal's LaTeX classes or may be incompatible with the style that the journal will impose on your paper. Very common packages like amsthm are usually safe. (I would leave this as a comment, but I don't have enough reputation yet.)

share|improve this answer
7  
Yes and no. Given that I rarely know what paper it is intended for when I start writing a paper, and given how useful some of these packages are, I include them all and try to get away with it! Sometimes I'm successful, sometimes I need to include the package .sty file along with my submission. –  Loop Space Aug 4 '10 at 7:03

A nice commenting environment is provided by the package:

\usepackage{verbatim}

For debugging purposes I find this package indispensable. Before I found this package I would have to enter % before each line I wished to comment. The environment works as follows:

\begin{comment}
Text in this environment will be ignored by LaTeX.
\end{comment}

The packages

\usepackage{comment}
\usepackage{xcomment}

provide even greater commenting capabilities (i.e. the ability to selectively typeset certain environments) though I personally haven't had much use for these extended features.

share|improve this answer
7  
In any decent editor, you can easily comment out/in several lines at once. Due to that, I find the usefulness of the comment environment greatly reduced – i.e. I don’t use it at all. –  Konrad Rudolph Sep 11 '10 at 8:14
5  
I simply use \newcommand{\comment}[1]{}. Put \comment{ before the block and } after to comment out any part of the file. –  András Salamon Sep 11 '10 at 10:45

Usually I write German texts. We have new and old rules for spelling. The package hyphsubst provides some new hyphenation pattern. That's why I load it in addition to babel:

\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
share|improve this answer

Edited by doncherry: Removed packages mentioned in separate answers.

I use TeX for a variety of documents: research papers, lectures/tutorials, presentations, miscellaneous documents (some in Japanese). Each of these different uses, requires different packages.

Depending on my mood, I like to use different fonts. A particular nice combination for mathematics papers is

\usepackage[T1]{fontenc} % better treatment of accented words
\usepackage{eulervm}   % Zapf's Euler fonts
\usepackage{tgpagella} % TeXGyre Pagella fonts

For references,...

\usepackage[notref,notcite]{showkeys} % useful when writing the paper
\usepackage[noadjust]{cite} % [1,2,3,4,5] --> [1-5]  useful in hep-th!
\usepackage{hyperref} % hyperlinks, metadata,...

For lecture notes (again mathematical) I often like to section the document into "lectures" instead of sections and to add some colours to the titles,.... To do this it's useful to use

\usepackage{fancyhdr} % fancy headers
\usepackage{titlesec} % to change how sections are displayed
\usepackage{color}    % to be able to do this in colour

and I also like to decorate using some silly glyphs, for which these fonts are useful:

\usepackage{wasysym,marvosym,pifont}

and also box equations and other things

\usepackage{fancybox,shadow}

I like adding pictures, whence

\usepackage[rflt]{floatflt}
\usepackage{graphicx,subfigure,epic,eepic}

You may want to hide the answers to tutorial exercises, problems,... and this can be achieved with

\usepackage{version,ifthen} % ifthen allows controlling exclusions

I use XeLaTeX for documents containing Japanese, which works better with

\usepackage{fontspec} % makes it very easy to select fonts in XeLaTeX
\usepackage{xunicode} % accents
share|improve this answer
9  
As the question suggested, could you write an answer per package/topic and explain what these packages do or why do you need them? –  Juan A. Navarro Jul 29 '10 at 10:51
1  
can you please add comments like \ usepackage{foo} % to get following features within your code? –  Dima Jul 29 '10 at 11:06
1  
To avoid breaking them up all the way, you could try grouping them a little (say, if there's one package that you wouldn't consider using without another one then put them together). –  Loop Space Jul 29 '10 at 13:04

I almost always use the enumitem package, which makes it much easier to make modifications to lists (especially enumerate lists). Most notably, changing the labels to something like (i), (ii), (iii) [no period] with this package is as easy as

\begin{enumerate}[label=(\roman*)]
    \item The first item
    \item The second item
\end{enumerate}

Furthermore, the code above will automatically get nesting right. Before I started using this package, my preamble always included the awkward macro (necessary to change the references and eliminate the extra period in the list itself)

\newcommand{\setenumroman}{%
    \renewcommand{\theenumi}{(\roman{enumi})}%
    \renewcommand{\labelenumi}{\theenumi}%
}

which would break if I ever used it for a nested list (all the enumis would have to be changed to enumiis, if I understand correctly).

The enumitem package is quite flexible; another option I sometimes use is [wide], which makes a list look like part of the body of the text (with numbers/labels at the beginning of relevant paragraphs).

share|improve this answer
\usepackage{fancyvrb}

I use it for highly customisable verbatim. The abstract of the package documentation reads:

This package provides very sophisticated facilities for reading and writing verbatim TeX code. Users can perform common tasks like changing font family and size, numbering lines, framing code examples, colouring text and conditionally processing text.

Here's an example using the SaveVerbatim environment in combination with the \fcolorbox command: enter image description here

share|improve this answer

This has been mentioned in some of the “big answers”, but thought it deserved special attention. Probably most documents should include:

\usepackage[T1]{fontenc}

This is to resolve some deficiencies and inconsistencies of the default OT1 font encoding; while improving the support of special characters (e.g. the ability to copy&paste from the generated pdf document).

share|improve this answer
\usepackage[scaled=0.8]{luximono} 

which is a fixed-width font which supports boldface. This is useful when typesetting source code.

share|improve this answer

I also find package lipsum fun to use. It lets you generate several versions of lorem ipsum placeholder text to see what your document would look like.

share|improve this answer
\usepackage{docmute}

I use this in my syllabus preparation as I can make each of the subordinate documents fully standalone, yet do a complete compile of everything at once to verify I have all the corrections made.

It does require that all of the preambles are identical.

This then allows me to work only on one course syllabus or schedule or homework assignments with very fast compiles. Also during the semester I can do corrections on individual documents.

My main document preamble is

\documentclass[10pt,letterpaper]{article}
\input{commonpreamble}
\usepackage{docmute}
\begin{document}

And the subordinate documents have this preamble

\documentclass[10pt,letterpaper]{article}
\input{commonpreamble}
\begin{document}

Notice: Only one master document and the \usepackage{docmute} is only in that file.

Also all subordinate document must be only loaded with \input or \include from the main document. Only one level down is allowed.

I keep one copy of the preamble as commonpreamble. And all files are kept in one folder. This system works very well with Texmaker or TexStudio as the structure of the document is always displayed regardless of choosing a "Master Document".

share|improve this answer

I'm not just feigning surprise when I say I'm shocked that such an incredibly useful package set as xparse/expl3 (the latter is loaded by the former) hasn't been mentioned yet. I invariably find myself typing:

\documentclass{article}
\usepackage{xparse}

to begin a document.

share|improve this answer
4  
So, what does it do? –  fifaltra Dec 24 '13 at 0:32
1  
with xparse, one can define commands and environments with multiple optional arguments before, between, and after mandatory arguments. Several new type of arguments can be defined, starred commands, and much more. –  Michael P May 7 at 10:17

For the natural scientists among us, the package mhchem makes it very easy to typeset chemical symbols and chemical equations.

share|improve this answer
 \usepackage{etex}

to be able to include e.g. TikZ without strange errors.

share|improve this answer
1  
Todd: see tex.stackexchange.com/questions/7896/… –  Ben Feb 10 '12 at 11:01

As long as this list is, minted is missing. For code syntax highlighting it works really well and includes the long list of languages of pygments. The pieces of code end up looking like this:

\begin{minted}{language}  
code
\end{minted}

In Beamer it requires frames to be marked as [fragile], and it takes some skill to set it up on Windows. But the results are well worth the effort.

share|improve this answer
1  
@Christian: the main difference is that you can tap directly into pygments, which is a (very) well maintained source for syntax colouring for many languages and is used in many places other than LaTeX. There is a full discussion on the differences between lstlisting and minted here: tex.stackexchange.com/questions/102596/…, –  FvD Jun 28 '13 at 13:17

I always use

\usepackage[retainorgcmds]{IEEEtrantools} % sophisticated equation arrays

It offers a sophisticated environment for formatting equation arrays,IEEEeqnarray and also offers a few other constructions. I don't use the traditional eqnarrays any more. I usually set the option [retainorgcmds] because it prevents the package from overwriting the itemize, enumerate and description definitions.

Check out How to Typeset Equations in LaTeX. The author gives some good examples of how and why to use this package instead of the traditional ones. The Not So Short Introduction to LaTeX 2ε also mentions the package in section 3.5.2. This section actually seems to be a copy of the first link ;)

share|improve this answer
\usepackage{mciteplus}

Allows you to combine multiple references: \cite{refa, *refc, *refc, refd} will produce one references with refa, refb, and refc combined (if they are not used independently elsewhere).

share|improve this answer
2  
BTW: natbib supports this feature too. See p.19 in the documentation mirrors.ctan.org/macros/latex/contrib/natbib/natbib.pdf –  amorua May 2 '12 at 1:24

I usually use relsize package. It's easy to use it. It changes the font size of part of your text. Just type \relsize{x} where x is the number of steps you want to move through the hierarchy of font sizes.

share|improve this answer

When I'm writing package documentation using ltxdoc it likes using three columns for the index. I'd prefer two. I fix it with the idxlayout package:

\usepackage[columns=2]{idxlayout}
share|improve this answer

The following command before the \documentclass command permits Computer Modern fonts at arbitrary sizes: \RequirePackage{fix-cm}.

share|improve this answer

Very often a requirement for the documents I write is that the font should be Times (or Times New Roman), so the package I use to set the main roman font to Times and acceptable math is mathptmx.

Recently, I have experimented with newtxtext and newtxmath but, personally, I do not like the design of some symbols and there are a few cases where the spacing between characters is too tight.

For personal use I set the font to New Century Schoolbook and Fourier (for math) with the fouriernc package.

share|improve this answer

I always load the package xy to produce diagrams.

Also tikz to draw figures.

share|improve this answer
2  
I use tikz-cd to get commutative diagrams drawn with tikz with a syntax highly reminiscent of the xy syntax. –  Charles Staats Dec 6 '12 at 3:22

I have a whole slew of commands that that provide a nice short hand for standard idioms of mine. (and which if I ever share tex source would make someone grumpy if i made it a package)

So the meta habit is: whatever personal short hands you think would be nice, have them defined at the top of your template file!

share|improve this answer

pageslts: for being able to refer to the last page of a document

share|improve this answer

I include: \usepackage{outlines} in my preamble. outlines is a quick and easy way to generate hierarchically embedded lists. Especially useful when I'm drafting up a paper (I like to outline it) or if I'm quickly typing up notes, e.g., at a conference.

share|improve this answer

I always end up loading the same packages, some of which were suggested by some answers to this question, such as hyperref, amsmath, nag, etoolbox, xparse, and others.

I created a style file latexdev.sty that I use in almost all my notes and publications, which loads all these standard packages:

https://github.com/olivierverdier/latexdev

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.