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.)

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 VermeerJul 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 RachumJul 30 '10 at 11:30

56 Answers
56

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.

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.
–
ChristianJun 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.

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

3

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.
–
StanAug 24 '14 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.

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):

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 SuomelaJul 31 '10 at 9:36

1

Congrats on getting yet one more "great" answer!
–
MicoJan 18 at 19:12

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).
–
MarkMar 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.
–
DomJun 12 '13 at 10:53

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".

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.
–
fabikwNov 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 LeingangNov 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.
–
philosodadDec 29 '10 at 4:56

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.
–
QuadrescenceApr 16 '11 at 23:15

14

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 MunnApr 16 '11 at 23:38

4

It is not a must if you use a class from the KOMAscript bundle or memoir.
–
SveinungJan 13 '14 at 16:01

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.

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.

\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 SpaceJul 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 SpaceJul 29 '10 at 18: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
–
SeamusAug 1 '10 at 10:41

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.

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.

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."
–
lockstepAug 6 '10 at 15:04

4

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.
–
lockstepAug 11 '10 at 20:50

4

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

7

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 RobertsonSep 2 '10 at 9:28

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:

You should probably also load mathpazo with the [sc] option to get real small caps and better kerning.
–
Will RobertsonSep 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).
–
spetMay 29 '13 at 8:52

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

Hypernat allows natbib and hyperref to work together. -- Note (added 2015/02/11): natbib and hyperref have been working together just fine for at least ten years. hypernat is no longer needed for any TeX distribution with a vintage more recent than ca 2002.

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.

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.

Actually not equivalent to h! at all. h! floats still "float"- they can be moved around by LaTeX in an attempt to optimize the document layout. Figures using the H specifier are not floats at all, they are treated like one big character and are put exactly where they appear in the text.
–
SharpieAug 1 '10 at 3:59