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 haven't used more than one font package. But I noticed some people use multiple font packages. Shortly speaking, which one will win if we load multiple font packages?

Is there a rule for loading multiple font packages?

share|improve this question
2  
The last one ;-) –  Marco Daniel Aug 10 '12 at 16:36
    
@MarcoDaniel: only the last one? –  Who is crazy first Aug 10 '12 at 16:37
3  
@GarbageCollector It depends on what they do. For example, \usepackage{mathptmx,helvet,courier} will work fine, as the first alters the serif font, the second the sanserif and the last the monospaced. –  Joseph Wright Aug 10 '12 at 16:40

1 Answer 1

up vote 7 down vote accepted

It depends.

Generally speaking, the font you get is the last one you specified. Thus usually when you use multiple font packages, the last one wins.

However, it depends on the actual commands in the packages. A font package do not always do the same thing as another font package, some times they work together.

An example is:

\usepackage{times}
\usepackage{utopia}

If you use the two packages in your document, you will see the main font is Utopia. You may say utopia wins. That isn't the truth. You might also notice that \textsf becomes Helvetica and \texttt becomes Courier, that's times package's effect.

When you look into the code of the packages, you will know why:

% in times.sty
\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\ttdefault}{pcr}

% in utopia.sty
\renewcommand{\rmdefault}{put}
\renewcommand\bfdefault{b}

What we obtain at last is the same as:

% mixed
\renewcommand{\sfdefault}{phv}
\renewcommand{\ttdefault}{pcr}
\renewcommand{\rmdefault}{put}
\renewcommand\bfdefault{b}
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.