# Setting font size AFTER \documentclass

I've seen a few related questions, but can't find one that actually answers this question. What I want to do is to specify the font size AFTER \documentclass. I don't want to change the command line, nor have to define something like \def\pointsize{12pt} beforehand, and then use that in the \documentclass[\pointsize] as per Norman's solution to setting class options after documentclass. So, what I am looking for is the definition of \SetFontSize below so that it has the same effect as if I had said \documentclass[12pt]{some_class} in terms of text location and size:

\documentclass{some_class}
\SetFontSize{12pt}{15pt}


I am also not sure that 12,15 are the correct numbers to match with the [12pt] option. I tried the following, but this does not producing identical output as \documentclass[12pt]{article}:

\documentclass{article}
\fontsize{12pt}{15pt}\selectfont

\begin{document}
blah blah
\end{document}


Based on lockstep's link, I believe that the solution is:

\makeatletter
\input{size12.clo}
\makeatother


This seems to be working for the {article} class. But according the same link this may not work for all classes.

-
Have a look at this question. BTW, your example doesn't work as expected because \begin{document} triggers \normalsize. –  lockstep Apr 30 '11 at 19:10
Note that instead of using \def\pointsize{12pt} ... \documentclass[\pointsize]{<class>} using \PassOptionsToClass{12pt}{<class>} ... \documentclass{<class>} is better. I'm aware that you try to avoid this, but just like to point it out. –  Martin Scharrer Apr 30 '11 at 19:17
@lockstep: I included the solution from the link you provided above. This seems to work, but does concern me that it may not work if I decide to switch \documentclass later. @Martin: I like your solution, but I have other people working with me and would prefer not to require them to adjust their software setup beyond including my header files. –  Peter Grill Apr 30 '11 at 19:34
So been using this solution, but found out that had to load the geometry package AFTER and not before changing the fonts. –  Peter Grill Apr 30 '11 at 21:15

\documentclass{article}
\let\small\relax
\let\footnotesize\relax
\let\scriptsize\relax
\let\tiny\relax
\let\large\relax
\let\Large\relax
\let\LARGE\relax
\let\huge\relax
\let\Huge\relax
\makeatletter
\input{size12.clo}
\makeatother
\begin{document}

foo

\end{document}

-
While your solution is correct for size12.clo (which contains \let\Huge=\huge), I think it is safer to add \let\Huge\relax to make things work for other .clo files. –  lockstep Apr 30 '11 at 19:58
@lockstep: yes, I'd forgotten this one –  Herbert Apr 30 '11 at 20:04

With KOMA-Script classes it's easily possible to change the base font size after \documentclass, for example:

\KOMAoptions{fontsize=15pt}


Other sizes depending on the base font size will automatically be adjusted. You could use any size and any TeX unit, such as ex, in and mm if you like.

If you use typearea for calculating the layout, you could also adjust that to the new base font size by

\recalctypeara


This is just an example of many additional features which are available in KOMA classes.

-