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

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

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 SpaceAug 4 '10 at 7:03

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 RudolphSep 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 SalamonSep 11 '10 at 10:45

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)

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

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. NavarroJul 29 '10 at 10:51

1

can you please add comments like \ usepackage{foo} % to get following features within your code?
–
DimaJul 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 SpaceJul 29 '10 at 13:04

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

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:

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 PMay 7 '14 at 10:17

@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/…,
–
FvDJun 28 '13 at 13:17

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

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.

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.

Sometimes I make tables with multiline cells in several columns, where the total width must be just \textwidth. Use tabular with p{} columns here is a pain since one must take into account \tabcolsep.

For this, the sibling tabularx (cited in another answer) could make a good work ( X columns take all the available space), but often I need columns weighted according to the amount of text rather and with different alignments, but X columns of tabularx share equally that space.

Instead, tabulary allow the use L, C, R and J columns o automatic variable width. Not always a column layouts as LLCRL produce the desired result but since it is possible mix L,C,R columns with basic types (l,r,c,p{}, m{}...) find the best fit (i.e., some like Lcp{5em}RL) is a child play.