4

This question already has an answer here:

How can I cange the fontsize mid document to have the same effect locally as setting the fontsize in the documentclass globally.

Consider the following minimal example:

\documentclass[a4paper,12pt]{article}

\pagestyle{empty}

\begin{document}

\section*{Text in 12pt}

Some text

\footnotesize footnotesize 
\small small 
\normalsize normalsize
\large large



\newlength{\FSize}
\setlength{\FSize}{10pt}
\newlength{\Baselineskip}
\setlength{\Baselineskip}{1.2\FSize} % Compare http://tex.stackexchange.com/a/94385/4011

\section*{Text in  10pt}

\fontsize{\FSize}{\Baselineskip}\selectfont

Some text

\footnotesize footnotesize 
\small small 
\normalsize normalsize
\large large


\end{document}

This gives the following output

output

As you can see, this is not what I wanted, setting the font size this way locally it doesn't have locally the same effect as correspeondingly setting the fontsize in the option of the documentclass globally. For example commands like \section or \small are not changed (but if I change the font in the documentclass they do change).

So is there an easy way to achieve this?

marked as duplicate by Andrew Swann, user13907, Werner, user31729, Benedikt Bauer Nov 1 '14 at 20:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    There is no standard way to do this (and it's not clear you should do:-) the standard classes only define one set of section headings, list spacing and document text size once, depending on the global class option (that's why it is a global option) the values for other sizes are not loaded at all so not directly available. – David Carlisle Oct 29 '14 at 18:06
  • 1
    Couldn't the relsize package (ctan.org/pkg/relsize) be a first approach? – Ruben Oct 29 '14 at 18:10
  • 1
  • And there is no standard set of definitions corresponding to 8pt. [If you specified 8pt as a class option, you'd just get 10pt.] – cfr Oct 30 '14 at 0:11
  • @cfr I just canged the example! – student Oct 30 '14 at 10:10
2

Well, this is setup by sizeXX.clo. There most of the font size changing commands are set by \newcommand so you need to undefine them before loading this file.

Sample output

\documentclass[a4paper,12pt]{article}

\pagestyle{empty}

\begin{document}

\section*{Text in 12pt}

Some text

\footnotesize footnotesize 
\small small 
\normalsize normalsize
\large large

\makeatletter
\let\small\@undefined
\let\footnotesize\@undefined
\let\scriptsize\@undefined
\let\tiny\@undefined
\let\large\@undefined
\let\Large\@undefined
\let\LARGE\@undefined
\let\huge\@undefined
\let\Huge\@undefined
\input{size10.clo}\makeatother
\section*{Text in  10pt}

Some text

\footnotesize footnotesize 
\small small 
\normalsize normalsize
\large large


\end{document}

Probably you want to do a \clearpage before the switch.

  • See Also: This Answer which does the same thing, but fiddles with \newcommand rather than undefine all the sizing commands. – Dean Serenevy Nov 1 '14 at 19:40
  • @DeanSerenevy Thanks for that clean solution. It looks like this question should be closed as a duplicate. – Andrew Swann Nov 1 '14 at 19:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.