9

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?

5
  • 2
    Could you please provide some more specific information on the class file you use? Commented Dec 26, 2012 at 23:08
  • 1
    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
    Commented Dec 26, 2012 at 23:15
  • 3
    There's little defence from badly written classes that use \font. :(
    – egreg
    Commented Dec 26, 2012 at 23:21
  • Have a look at tex.stackexchange.com/questions/5148/…
    – smh
    Commented Dec 26, 2012 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
    Commented Dec 27, 2012 at 0:17

2 Answers 2

3

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

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

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.

4
  • OK, I'll try that. And what about changing the font size itself?
    – Big Dogg
    Commented 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 Dogg
    Commented 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.
    – smh
    Commented 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 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. Commented Dec 27, 2012 at 14:28

Not the answer you're looking for? Browse other questions tagged .