# Specify font and font size for equations and math mode? [closed]

I am using a class file that defines commands to change the font and font sizes for normal text for different sections of the document, but it leaves the math mode and equation font and font sizes unchanged. Consequently, in one of the sections, all the math is huge compared to the text (and in the wrong font). How do I change the font and font size for all the math in a particular section?

-

## closed as too localized by Andrew Swann, Claudio Fiandrino, Werner, Kurt, Martin SchröderDec 28 '12 at 22:25

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Could you please provide some more specific information on the class file you use? – Peter Jansson Dec 26 '12 at 23:08
Sure, it contains something like \font\somefont=\frutiger at 7pt and then a command defining a section \def\somesection{\vskip6pt \parskip=8pt \somefont}. Then in the main document the section is enclosed in \begin{somesection} and \end{somesection} commands. – Big Dogg Dec 26 '12 at 23:15
There's little defence from badly written classes that use \font. :( – egreg Dec 26 '12 at 23:21
Have a look at tex.stackexchange.com/questions/5148/… – smh Dec 26 '12 at 23:59
Thanks for the pointer smh, but I looked at that quesiton before asking this one and DeclareMathSizes has no effect for me. – Big Dogg Dec 27 '12 at 0:17

The first number in \DeclareMathSizes shows which point size have you used in your document class. for example, if you have a preamble \documentclass[12pt]{book}, the first number in \DeclareMathSizes should be 12, i.e. \DeclareMathSizes{12}{...}{...}{...}. But unfortunately, there is inconsistency between document classes with 11 point size and \DeclareMathSizes. So, if you have a preamble \documentclass[11pt]{...}, you have to use \DeclareMathSizes{10.95}{...}{...}{...} to take effect.

-
OK, I'll try that. And what about changing the font size itself? – Big Dogg Dec 27 '12 at 3:26
Yeah, \DeclareMathSizes doesn't do anything for me. The main text is 7pt in the section I'm trying to modify, but \DeclareMathSizes{7}{7}{6}{5}, for example, doesn't change anything. – Big Dogg Dec 27 '12 at 4:24
As you know, we have only three predefined point sizes for a whole document: 10pt, 11pt, and 12pt. \DeclareMathSizes works only with these three point sizes, i.e. \DeclareMathSizes{10}{}{}{}, \DeclareMathSizes{10.95}{}{}{}, and \DeclareMathSizes{12}{}{}{}. So, you have to use one of these three commands to take effect. – smh Dec 27 '12 at 7:45
@smh -- if you look in the the file fontmath.ltx there are a lot more instances of \DeclareMathSizes, and this is what makes the cm math fonts work properly in footnotes et al. fontmath.ltx was generated from fontdef.dtx; i haven't yet found a pdf output file for this, but reading the comments in the .dtx is highly informative. among other things, it suggests creating a local fontmath.cfg file if one is using fonts other than computer modern. – barbara beeton Dec 27 '12 at 14:28

I just found something over at Stack Overflow that works for me:

\begingroup
\fontsize{7pt}{9pt}\selectfont
<whatever>
\endgroup

-