5

I'd like to define a new font size, e.g. \sidenotesize , just like \tiny and \huge already exist, such that it is proportional to the document font size (or somehow else, I just need to get a proportional/customizable scaling).

How to do that? Would it affect math mode too?

  • Do you mean the size would be relative to the main size, or that the font shapes would be scaled up or down from a different optical size? For the first, what's wrong with the normal font-size commands like \small? For the second, see tex.stackexchange.com/questions/225027/… – musarithmia Jan 27 '15 at 11:41
  • Well, I meant the second of course. Following your link I found out \DeclareFontShape command, that should do the job - as soon as I learn how it works. Thank you! – Piero Gherbaz Jan 27 '15 at 12:06
10

You can use relsize package.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{relsize}

\begin{document}
Some text      %% not scaled

{\relsize{-3}Some text}  %% this is -3*1.2 times scaled

{\relsize{4}Some text}   %% this is 4*1.2 times scaled

\end{document}

enter image description here

For details read the manual → texdoc relsize from command prompt/terminal.

6

Every document class has at least five or six font sizes, which should be more than enough, provided that it is not recommended, from a design point of view, to display an array of font sizes, because their very difference will be distracting.

In spite of this advice, if you want to add another size, or you want to be in control of your fonts, it is a good idea to define not one but all of them. Of course, with the following code you can define only one new size or redefine an existing one.

The basic code to redefine an existing font is:

\renewcommand{\NAMEOFTHEFONTSIZE}{\fontsize{SIZEINPOINTS}{LEADINGINPOINTS}\selectfont}

The basic code to define a new fontsize:

\newcommand{\NAMEOFTHEFONTSIZE}{\fontsize{SIZEINPOINTS}{LEADINGINPOINTS}\selectfont}

An example:

\renewcommand{\tiny}{\fontsize{6}{9}\selectfont}
\renewcommand{\scriptsize}{\fontsize{8}{12}\selectfont}
\newcommand{\notesize}{\fontsize{9}{13.5}\selectfont} %<-- New fontsize
\renewcommand{\footnotesize}{\fontsize{10}{15}\selectfont}
\renewcommand{\small}{\fontsize{11}{16.5}\selectfont}
\renewcommand{\normalsize}{\fontsize{12}{18}\selectfont}
\renewcommand{\large}{\fontsize{14}{21}\selectfont}
\renewcommand{\Large}{\fontsize{16}{24}\selectfont}
\renewcommand{\huge}{\fontsize{18}{27}\selectfont}
\renewcommand{\Huge}{\fontsize{22}{33}\selectfont}

In this case, the leading (space between lines) is kept proportional (150% relative to the fontsize), but change it to your liking.

1

If you are using OPmac then you can use \typoscale macro. Example

\input opmac

\def\smaller{\typoscale[850/]}
\def\bigger{\typoscale[1200/]}

Hello {\smaller hello {\smaller hello {\smaller hello}}} hi.

\medskip

Hello {\bigger hello {\bigger hello {\bigger hello}}} hi.

\end

typoscale

Note that optical sizes of the font (if they are available) are chosen, not only geometric scaling.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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