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 was reading some post here at SE and I noticed that many people load packages one by one. For example,

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}

and so on. Usually, I load those on a single command, like

\usepackage{amsfonts,amsthm,amsmath,amssymb}

Is this correct or some problems could appear?

I know that there are some packages which should be loaded before than others.

share|improve this question
    
IMHO there shouldn't be any problem. But how do you load options for packages in this way? This is the only drawback! –  Harish Kumar Dec 9 '12 at 12:42
2  
While you are at it add mathtools to the chain to have the full house :) –  percusse Dec 9 '12 at 13:02
4  
No need to load amsfonts and amssymb since amssymb internally loads amsfonts. –  Gonzalo Medina Dec 9 '12 at 13:05
3  
@percusse -- mathtools loads amsmath so there's no need to load the latter. i'd tend to load mathtools first, but there's no specific order required. –  barbara beeton Dec 9 '12 at 14:59
1  
See What does each AMS package do? for a list of AMS package dependencies to minimize your loading sequence. –  Werner Dec 9 '12 at 16:54
show 3 more comments

1 Answer 1

up vote 10 down vote accepted

Semantically,

\usepackage{amsfonts,amsthm,amsmath,amssymb}

is the same as

\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}

and clearly, the former looks more tidy and compact in the document.

The following reasons can make one still prefer the latter form:

  1. Package options would be given to all packages at once, which is not always desirable. If one has already written down the preamble and then notices an option needs to be added or removed, this is usually more convenient with one \usepackage call per package.
  2. It is easier to comment one package out (or in) this way.

I usually copy preambles between documents, and one package per line makes customizing easier.

Note that before LaTeX2e, there was only one \documentstyle call (giving the document class as mandatory argument) and all packages had to be given in a big option list to that. This initial command always looked like a total mess in my documents, spread over several lines with a lot of lines commented out.

Being able to say \usepackage was a big relief compared to that!

share|improve this answer
add comment

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.