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

I almost always load microtype. It plays with ever-so-slightly shrinking and stretching of the fonts and with the extent to which text protrudes into the margins in a way that yields results that look better, that have fewer instances of hyphenation, and fewer overfull hboxes. It doesn't work with latex, you have to use pdflatex instead. It also works with lualatex and (protrusion only) with xelatex.

share|improve this answer
10  
You may want to use \usepackage[stretch=10]{microtype}, which allows font expansion up to 1% (default is 2%). –  lockstep Aug 6 '10 at 12:03
41  
Can we have an example of with versus without? –  levesque Nov 15 '10 at 18:28
6  
there's a nice example in the documentation for microtype mirror.ctan.org/macros/latex/contrib/microtype/microtype.pdf, though it requires adobe acrobat for the inline examples –  Noah Aug 12 '11 at 22:37
6  
Here is another example. –  Juri Robl Oct 11 '12 at 11:13
1  
The only texts for which I don't use microtype are those set raggedright. It seems to maximally stretch practically all lines. In any case, ragged2e then becomes the must include package. –  Christian Jun 27 '13 at 16:41

The family of AMS math packages. At least amsmath and amssymb. Also amsthm if I need theorems and the class I'm using doesn't already define them.

Particularly for writing equations, the AMS packages define a rich set of environments to group and align formulas in many different and useful ways. I also like that it encourages the use of semantic commands (e.g. the cases environment) over syntactic commands (e.g. a \left\{ followed by an array).

Its documentation can be found running texdoc amsldoc on a command line.

share|improve this answer
1  
In particular, amsthm provides an easy way to set up different theorem styles, amsmath provides the \text command, and amssymb contains several often-used symbols. –  András Salamon Jul 29 '10 at 12:40
14  
+1 for the (oblique) reference to texdoc. I only discovered that recently and I wonder how I ever lived without it! –  Loop Space Jul 29 '10 at 18:08
4  
I believe amssymb loads amsfonts. There's rarely any need to load it yourself. –  TH. Sep 11 '10 at 9:13
4  
Note that the ams math packages are loaded automatically if you use one of their document classes, such as amsart. –  Erik P. Jan 18 '12 at 19:08
2  
Instead of loading amsmath I usually load mathtools. It is based on amsmath and loads it automatically. Moreover it fixes some deficiencies of the amsmath package and provides additional useful commands such as \coloneqq. –  Stan Aug 24 at 9:53

I use hyperref for setting PDF metadata and to create links, both within the document and for clickable URLs. Even Elsevier has used urlbst to update their bibliography style to support URLs and DOIs; hyperref does the actual work of rendering url = and doi = BibTeX fields into clickable PDF links.

share|improve this answer

One package that’s really general purpose is nag: It doesn’t do anything, per se, it just warns when you accidentally use deprecated LaTeX constructs from l2tabu (English / French / German / Italian / Spanish documentation).

From the documentation:

Old habits die hard. All the same, there are commands, classes and packages which are outdated and superseded. nag provides routines to warn the user about the use of those. As an example, we provide an extension that detects many of the “sins” described in l2tabu.

Therefore, I now always have the following in my header (before the \documentclass, thanks qbi):

\RequirePackage[l2tabu, orthodox]{nag}

It’s a bit like having use strict; in Perl: a useful best practice.

share|improve this answer
12  
Somewhat better is \RequirePackage[l2tabu,orthodox]{nag} before \documentclass. The package docu also recommends this. –  qbi Jul 29 '10 at 18:40
2  
This package sounds useful. However, when I tested it with a large project, I started to get the message "Label(s) may have changed. Rerun to get cross-references right." no matter how many times I re-run Latex. –  Jukka Suomela Jul 31 '10 at 9:36

The todonotes package is a must have in all my documents.

\usepackage{todonotes}

The package enables you to insert small notes in the text marking things to do in the document. Something like

\todo{Rewrite this answer \ldots}

At any location in the document a list of the inserted notes can be generated with the

\listoftodos 

command.

share|improve this answer
7  
For multiuser comment support, and configurability with regard to the kinds of notes/themes available, the fixme package is quite nice (I use it quite regularly). –  Mark Mar 25 '11 at 22:29
1  
Personally I use an editor which automatically highlights and groups in the "structure" window any comment that begins with %TODO: Works better for me because you don't have anything in your compiled document giving away the fact that it still has TODOs around. –  Dom Jun 12 '13 at 10:53
1  
Has anyone done a comparison between easy-todo, fixme, fixmetodonotes, todo, and todonotes? –  Ari Brodsky Nov 20 '13 at 1:12

For citations and bibliographies, biblatex is the package of my choice. Key points:

  • biblatex includes a wide variety of built-in citation/bibliography styles (numeric, alphabetic, author-year, author-title, verbose [full in-text-citations], with numerous variants for each one). A number of custom styles have been published.

  • Modifications of the built-in or custom styles can be accomplished using LaTeX macros instead of having to resort to the BibTeX programming language.

  • biblatex offers well-nigh every feature of other bibliography-related LaTeX packages (e.g. multiple/subdivided bibliographies, sorted/compressed citations, entry sets, ibidem functionality, back references). If a feature is not included, chances are high it is on the package authors' to-do list.

  • The babel package is supported, and biblatex comes with localization files for about a dozen languages (with the list still growing).

  • Although the current version of biblatex (2.8a) still allows to use BibTeX as a database backend, by default it cooperates with Biber which supports bibliographies using Unicode. Biber (currently at version 1.8) is included in TeX Live and MiKTeX. Many features introduced since biblatex 1.1 (e.g., advanced name disambiguation, smart crossref data inheritance, configurable sorting schemes, dynamic datasource modification) are "Biber only".

share|improve this answer
4  
Nevertheless one should append about the usage of biblatex that some papers do not accept its usage. See: Biblatex: submitting to a journal –  strpeter Jan 16 at 9:25

I nearly always use the tikz package. Once you learn how to draw with it, you can do almost any vector graphic you need.

share|improve this answer
3  
You can produce almost any diagram with Tikz. Check the tikz examples page. texample.net/tikz/examples However, it is fairly complicated to get the hang on large diagrams since you have to type everything and nearly always you can't see what you are doing. But if you are using a Debian/KDE combination, you can use Ktikz/Qtikz which is really helpful since it compiles tikz code in real time. –  fabikw Nov 16 '10 at 0:42
15  
TikZ is awesome with a capital A. But load it by default? It takes up a lot of time and space. I would say only load it if you need it. –  Matthew Leingang Nov 22 '10 at 12:53
6  
@levesque: Tikz has a fairly steep learning curve, but it is beautifully documented and provides rich libraries. I find the vector graphics that I produce in tikz to be superior to those I produced in inkscape. It seems easier on my brain to stay in keyboard mode as well. –  philosodad Dec 29 '10 at 4:56

I'm surprised that no one has mentioned

\usepackage[margin=1in]{geometry} % set page margins automatically 

This is in every document I write (with varying margins, of course.)

share|improve this answer
2  
This is generally poor style. The design of the page is pretty involved and lots of thought has went into (La)TeX's default designs. If you're interested in just saving paper, consider the packages savetrees or fullpage. –  Quadrescence Apr 16 '11 at 23:15
13  
Both savetrees and fullpage change other things too; Anyway, the point of of the answer is that geometry is a must use package, no matter what margins you choose for it. The appropriateness of 1in margins also depends on the kind of documents you produce. –  Alan Munn Apr 16 '11 at 23:38
2  
It is not a must if you use a class from the KOMAscript bundle or memoir. –  Sveinung Jan 13 at 16:01

Since my files nowadays has UTF-8 character encoding, I use this

\usepackage[utf8]{inputenc}
share|improve this answer
22  
XeLaTeX or LuaLaTeX would be my choice for this –  Joseph Wright Aug 15 '10 at 13:05
1  
Isn't it \usepackage[utf8x]{inputenc}? –  Olivier Jul 19 '11 at 8:17
1  
I've experienced several cases where utf8x had a symbol that utf8 hadn't –  Mog Nov 24 '12 at 11:47
2  
@Olivier: utf8 is LaTeX base, while utf8x comes from the ucs package. So utf8 is portable. –  Martin Schröder Jun 27 '13 at 14:39
1  
I always use \usepackage[utf8]{inputenx} instead. –  Sveinung Jan 13 at 16:03

Another essential package combination is

\usepackage{booktabs}
\usepackage{array}

The booktabs package creates much nicer looking tables than the standard latex tables; the array package's ability to create custom columns is invaluable for formatting tabular material on a per-column basis.

share|improve this answer
1  
I just discovered booktabs -- it is great! –  Ben Jan 12 '11 at 22:37
1  
@Ben Yes, it's a great package. If you visit my profile web link you can find my own list of essential packages. –  Alan Munn Jan 12 '11 at 22:47

The 'rich' document classes such as memoir and KOMA-Script include a lot of functionality that is not available from the LaTeX kernel. So the packages you load when using the article class might be rather different from those when using memoir. A lot of packages that get used by many people with the base classes (things like float, caption, tocbibind and titlesec) are covered by the richer document classes.

share|improve this answer
12  
\begin{gripe} My problems with these richer document classes are that it makes it very difficult to pick and choose, and that it is a major pain when Big Shot Journal says "please rewrite your document to use our class file" (there's even a journal that won't let you send an accompanying style file). \end{gripe} –  Loop Space Jul 29 '10 at 13:19
7  
I tend to stick to article + packages, myself, so I can sympathise. All the more reason for me to get on and get LaTeX3 finished, so we can have a good set of abilities out of the box! –  Joseph Wright Jul 29 '10 at 14:33
7  
\begin{joke} Then stop wasting time here and get on with it! \end{joke} –  Loop Space Jul 29 '10 at 18:11
3  
If only it were that easy :-) If you want to see that things are happening, there is an RSS feed for SVN checkins: latex-project.org/latex3svn.rss –  Joseph Wright Jul 29 '10 at 21:36
11  
That gripe seems a gripe with the journals, rather than with the rich document classes. Also, if you're writing a journal article, memoir doesn't seem like an obvious way to go, if you are going to end up having to conform to some journal's style eventually. Again, that's not an issue with rich document classes, that's just a matter of picking the right tool for the job. And for journal submissions, minimal package requirements and basic document classes seems a good modus operandi –  Seamus Aug 1 '10 at 10:41
\usepackage{siunitx}

siunitx, for typesetting units and especially for the "S" column type, which allows numbers in tables to be easily aligned, e.g. on the decimal marker.

share|improve this answer
7  
\usepackage[allowlitunits]{siunitx} is my normal incantation, it allows you to use things like 20\milli\meter directly in math mode. –  Alex Hirzel May 1 '12 at 20:18
\usepackage{lmodern}  % better i18n Postscript version of Knuth's cm fonts
share|improve this answer

In addition to many packages already listed here, I always include mathtools. It provides implementations of \mathclap (and similar commands) as well as nice extensible arrow.

share|improve this answer
4  
\mathclap is great. I use it to great effect for things like \sum_{\mathclap{big long thing}}. (It's also amusingly named with at least one off-color meaning.) –  TH. Aug 27 '10 at 9:36
2  
\shortintertext is also provided by the \mathtools package and provids tighter vertical spacing compared to \intertext from the amsmath package. –  Peter Grill May 2 '12 at 0:47
\usepackage{graphicx}

For including figures, rotating or scaling text. I also use the \graphicspath command to specify a subfolder to help organize my figures and so I can easily change between, for example, a set of figures for internal used (with extra info) and final versions for distribution.

share|improve this answer

I can't live without listings --- pretty-printing (colours, formatting and all) algorithms and code is indispensable --- in pretty much any programming languages and dialects under the sun. Plus, I can import a source file directly from the repository, and the latest version will be automatically rendered.

share|improve this answer

The package xspace lets you define commands that don't eat up whitespace after them. So you can define an abbreviation like

\newcommand{\sA}{\mathcal{A}\xspace}

and then you can type objects of \sA are called widgets instead of objects of \sA\ are called widgets.

share|improve this answer
14  
On comp.text.tex there's a series of messages "xspace and italic correction" about spacing inconsistencies created by xspace. There, Will Robertson suggested "delimited macros" as an alternative to xspace. Using \newcommand* only to ensure that no existing command is overriden, the above example would look like this: \newcommand*{\sA}{}\def\sA/{\mathcal{A}} To quote Will Robertson: "In the source you must always type "\foo/" [here: "\sA/"] (or TeX will throw an error), and spaces after it won't be gobbled." –  lockstep Aug 6 '10 at 15:04
3  
The main advantage of \sa/ is that an error message will occur if you happen to forget the closing slash. On the contrary, if you happen to forget the closing backslash of \sA\ , you'll end with gobbled space without noticing it. –  lockstep Aug 11 '10 at 20:50
3  
I used xspace one time in a paper with other authors. It was a huge pain since some macros didn't behave like others. It led to all sort of confusion, especially when thinks like \foo bar no long work as you expect because \foo's definition ends with \xspace. I've never tried \foo/. The main advantage I see with that is if your macro is \m/... –  TH. Aug 27 '10 at 9:32
6  
I don't especially like the look of \sA/ but I can't think of a better delimiter to use. Perhaps a semicolon would be fine (after HTML): \sA;. My personal belief is that non-delimited macros without arguments (i.e., the ones that gobble spaces) are just plain wrong for document commands because of the spacing problems. Even experienced LaTeX authors trip up with them. –  Will Robertson Sep 2 '10 at 9:28

For papers on the arXiv (maths, physics and computer science mostly) there's a list of packages sorted by frequency of use.

The top twenty packages are:

  1. article
  2. graphicx
  3. amssymb
  4. amsmath
  5. revtex
  6. revtex4
  7. epsfig
  8. amsfonts
  9. bm
  10. latexsym
  11. amsart
  12. dcolumn
  13. amsthm
  14. graphics
  15. aastex
  16. amscd
  17. epsf
  18. color
  19. aa
  20. times
share|improve this answer
2  
That list is literally pain to my eyes. Loading bm?! Use proper bold math characters instead, please, and not poorman's bold. times? Outdated since ages, use mathptmx or XITS Math instead. I'll stop here... –  Ingo Jan 30 at 11:46

\usepackage{fixltx2e} fixes a few things in the LaTeX2e kernel.

Due to LaTeX's stability policy, these corrections have not been incorporated into the LaTeX2e kernel, but this package does things most people would agree are bugfixes. So to load this package is always recommended for newly created documents. The corrections have no commonalities, but the package's description has a nice summary:

  • ensure one-column floats don't get ahead of two-column floats;
  • correct page headers in twocolumn documents;
  • stop spaces disappearing in moving arguments;
  • allowing \fnsymbol to use text symbols;
  • allow the first word after a float to hyphenate;
  • \emph can produce caps/small caps text;
  • bugs in \setlength and flushbottom.
share|improve this answer

Nothing surprising here: I use natbib, hyperref and hypernat together.

Natbib for referencing.

Hyperref adds bookmarks for sections and lists and turns references and urls into links.

Hypernat allows natbib and hyperref to work together.

share|improve this answer
7  
I'm pretty sure that hypernat is superfluous these days. With only loading natbib and hyperref I get references as [1-5] with both 1 and 5 being hyperlinks. –  Lev Bishop Aug 8 '10 at 14:51
2  
And? Was it superfluous in 2010? Is it now? ;) –  K.-Michael Aye Nov 23 '12 at 5:18

To make sure you have ISO formated dates (YYYY-MM-DD).

\usepackage[english]{isodate}

or

\usepackage{datetime}
\renewcommand{\dateseparator}{-}
\newcommand{\todayiso}{\the\year \dateseparator \twodigit\month \dateseparator \twodigit\day}
share|improve this answer

To use the palatino font (it's just a nice looking font)

\usepackage[sc]{mathpazo}

Note that the old palatino package is deprecated.

share|improve this answer
9  
You should probably also load mathpazo with the [sc] option to get real small caps and better kerning. –  Will Robertson Sep 2 '10 at 9:24
2  
Depending on taste, you may want to use [osf] instead of [sc] to get old style numerals as well as the real small caps and better kerning. I for one find old style numerals prettier and classier than lining figures in text mode (using [osf] will keep lining figures in math mode). –  spet May 29 '13 at 8:52

For quickly setting multicolumn text in a single column document, the multicol package is another package that I use all the time.

\usepackage{multicol}
share|improve this answer
\usepackage[parfill]{parskip} 

I much prefer no indentation and space between paragraphs, so the parskip package is a must for me!

share|improve this answer
12  
Have a look at the KOMA-Script-classes - they include a parskip option that is more powerful than the package of the same name. –  lockstep Aug 8 '10 at 17:39

Edited by doncherry: Removed packages mentioned in separate answers.

The complete header Part of my header for most of my documents looks as follows:

\documentclass[ngerman,draft,parskip=half*,twoside]{scrreprt}
\usepackage{ifthen}

For some things I need if-then-constructs. This package provides an easy way to realise it.

\usepackage{index}

For generating an index.

\usepackage{xcolor}

xcolor is needed by several packages. For some historical reason I load it manually.

\usepackage{babel}
\usepackage{nicefrac}

nicefrac allows typesetting fractions like 1/2. It is sometimes more readable than \frac.

\usepackage[T1]{fontenc}
\usepackage[intlimits,leqno]{amsmath}
\usepackage[all,warning]{onlyamsmath}

This package warns if non-amsmath-environments are used.

\usepackage{amssymb}
\usepackage{fixmath}

Provides ISO conform greek letters.

\usepackage[euro]{isonums}

Defines comma as decimal delimiter.

\usepackage[amsmath,thmmarks,hyperref]{ntheorem}

for Theorems, definitions and stuff.

\usepackage{paralist}

Improves enumerate and itemize. Also provides some compact environments.

\usepackage{svn}

I work with VCS and svn displays some informations (keywords) from SVN.

\usepackage{ellipsis}

corrects \dots

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

These are the definitions for absolute value and norm.

\SVN $LastChangedRevision$
\SVN $LastChangedDate$
share|improve this answer
24  
"one thing (in this case, package) per answer" –  Jukka Suomela Jul 29 '10 at 19:02
4  
Could you break this up into multiple answers please, so they can be voted on? Having a dozen answers is ok! –  ShreevatsaR Jul 30 '10 at 14:41
1  
It is usually recommended to load hyperref last. –  Alex Hirzel May 1 '12 at 20:20

For mathematical texts I instead use amsmath & Co. One very useful package is onlyamsmath. I load it as

\usepackage[all,warning]{onlyamsmath}

So it looks for $$..$$, eqnarray and produces a warning if some of them are used. If you left out warning, it will result in an error and compile will stop. This package is normally very useful if you edit a text with many authors.

share|improve this answer

I almost always find myself using a tabularx environment as opposed to the regular tabular environment, as it allows for greater dynamism in column widths.

share|improve this answer

Another package I use is float. It allows for the placement H for floats, which is somewhat equivalent to h!, but a bit stronger, making sure the figure or table goes exactly where I want it to be.

share|improve this answer

I save my documents in an SVN repository. The svn package helps to extract some informations out of the version control system. The document has somewhere a hint what revision number and what date it is. For this you have to set svn keywords and declare in your LaTeX document what you need:

\SVN $LastChangedRevision$
\SVN $LastChangedDate$

Wihtin the document you can refer to that information with \SVNLastChangedRevision and \SVNDate.

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.