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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is my understanding that \DeclareMathVersion can be used to switch between math font variants. I am wondering how this can be used in a document that leverages two fonts: Times Roman for body text and Garamond for captions and headings. (The style is certainly unconventional, but works quite nicely.)

Times, through \usepackage{txfonts} and Garamond through \usepackage[urw-garamond]{mathdesign} both provide math fonts. What is required for the following example to typeset?

While I believe \DeclareMathVersion is the solution, documentation is on it is sparse. However, I have seen several LaTeX typeset books which pull this switching off. May be related to Change math font only in some parts of a document?



% ...

 % This will be in times
 \[ \int e^{ax}\sin(bx+c)dx \]
 % We want this in Garamond
 % ...
 \[ \int e^{ax}\sin(bx+c)dx \]
share|improve this question
TeX allows only 16 math font families (\fam) in one document. This restriction is not easy to raise. If you use \DeclareMathVersion to switch math fonts, you may meet the problem. – Leo Liu May 28 '11 at 1:32
Correction: 16 math alphabet families (Variable family). – Leo Liu May 28 '11 at 3:57
up vote 13 down vote accepted

After defining new math versions with \DeclareMathVersion, you can use \DeclareMathAlphabet, \SetMathAlphabet, \DeclareSymbolFont and \SetSymbolFont to set all math families manually. You must rename the math family names. You must be sure there are no more than 16 math alphabet families (but symbol familis can be more). And there may be encoding problems.

Anyway, although it's quite complex, it is posible:

enter image description here

%%% text fonts

%%% New math versions

%%% Math symbol fonts
%%% some examples only
% Math letters from txfonts and mdugm
% Math operators
% Math symbols
% Large symbols

%%% Math alphabets, at most 16 families
%%% some examples only



This is Times font. $a^2 + b^2 = c^2$. Math font
  \sum_i \int_a^b \left( \frac1{K+1} \oplus\alpha_i \right) \,\mathrm{d}x = 0
and bold math font
  \sum_i \int_a^b \left( \frac1{K+1} \oplus\alpha_i \right) \,\mathrm{d}x = 0

This is Garamond font. $a^2 + b^2 = c^2$. Math font
  \sum_i \int_a^b \left( \frac1{K+1} \oplus\alpha_i \right) \,\mathrm{d}x = 0
and bold math font
  \sum_i \int_a^b \left( \frac1{K+1} \oplus\alpha_i \right) \,\mathrm{d}x = 0

share|improve this answer

Your Answer


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.