Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Why the command below don't change the size of the font? I have copied it from book.cls

\documentclass{book}

\makeatletter
\renewcommand*\@ptsize{2}
\makeatother

\newlength{\hallo}
\settowidth{\hallo}{m}

\begin{document}

Hallo World

\the\hallo

\end{document}

Could I have some problem with this way? For example if I put the \@newglobalfontsize{} command after some packgaes in the preamble?

\documentclass{book}

\makeatletter
\DeclareRobustCommand*{\@newglobalfontsize}[1]
{
    \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{bk#1.clo}
    \makeatother
}
\makeatother

\makeatletter
\@newglobalfontsize{10}
\makeatother

\newlength{\hallo}
\settowidth{\hallo}{m}

\begin{document}

Hallo World

\the\hallo

\end{document}

UPDATE

To avoid all problems this is the best way for me:

\documentclass{scrreprt}

\makeatletter

\DeclareRobustCommand*{\@newglobalfontsize}[1]{\changefontsizes[\dimexpr#1*1.2\relax]{#1}}

\@newglobalfontsize{8pt}

\makeatother


\begin{document}

test

\end{document}
share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

By the time you modify \@ptsize the document class already set up the font sizes, so the change is not realized. Using

\documentclass[12pt]{book}

is the preferred way. More specifically, the document class options are set up (with some defaults) and then processed, followed by the appropriate font setup (reading bk1\@ptsize.clo, for example) inside the document class (book.cls and the like).

From book.cls (with comments added):

128: ...
129: \ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright}% Defaults
130: \ProcessOptions% Process options passed by user + defaults
131: \input{bk1\@ptsize.clo}% Read/setup font-specific information
132: ...
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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