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?
2 Answers
I just found something over at Stack Overflow that works for me:
\begingroup
\fontsize{7pt}{9pt}\selectfont
<whatever>
\endgroup
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 DoggCommented Dec 27, 2012 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 DoggCommented Dec 27, 2012 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.– smhCommented Dec 27, 2012 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 fromfontdef.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 localfontmath.cfg
file if one is using fonts other than computer modern. Commented Dec 27, 2012 at 14:28
\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.\font
. :(