# How to scale all fonts (in the whole document) by certain factor or percentage?

Is there a way to scale the font size of all text in a LaTeX document by a certain factor, something like \scalealltext{factor=0.95}?

Edit: Text should reflow, so as to fit (a bit) more text on a page and ultimately trim down the number of pages.

Edit2: Apart from wanting to apply it to a specific problem, my question is more general. So giving specific fonts for the specific document I had when this question was raised is IMO not of much use.

-
I don't think that the people you're submitting the document to will be fooled by this trick. :) – egreg Sep 5 '12 at 13:24
@egreg: I am aware of that :-), but it is not for an official submission anyway. – Rabarberski Sep 5 '12 at 14:49
Please, add a minimal example with the class and font setting you're applying. – egreg Sep 5 '12 at 15:03
If the goal is to fit everything in a certain number of pages, one can enlarge the paper size (say, +5mm and +7mm respectively, which gives almost the same ratio), the text area (in a somewhat proportionate way, ≈4mm) and just set “Fit to printable area” when printing. The font size will stay the same, but the page size will increase, thus giving the same effect of font size reduction relative to the page. Worked for me when a file with written ideas was slowly growing and I wanted to constrain it to 8 pages. – Andreï Kostyrka Jan 26 at 22:17

You could load the relsize package and issue the command

\relscale{0.95} % or whatever scaling is desired


at the start of the document.

-
Including it just after \begin{document} indeed produces the expected result. Only the title is not scaled, don't know why, but not a big deal for me. Also, it seems the scaling works in steps as there is no difference between e.g. 0.82 and 0.84 but a big difference when going to 0.85 – Rabarberski Sep 5 '12 at 12:35
@Rabarberski - Depending on which font family you use (e.g., the default, Computer Modern), you may also want to load the cmsuper package. This should enable finer steps in the use of \relscale. – Mico Sep 5 '12 at 12:51
@Rabarberski This happens when the fonts are available only on fixed sizes, such as the original Computer Modern fonts. Try \RequirePackage{fix-cm} before the \documentclass line. – egreg Sep 5 '12 at 12:53
@Mico: cmsuper (or cm-super) could not be found by my Mixtek installation, although I see it is available on CTAN. – Rabarberski Sep 5 '12 at 13:02
@egreg: using fix-cm didn't make any difference. In any case, the steps aren't a real issue to me. – Rabarberski Sep 5 '12 at 13:03

it depends to the font if it is scalable or not and if there is a LaTeX support. It is easy if you can use OpenType fonts with xelatex or lualatex. With pdflatex you can scale down the complete output. But this influences also all lengths, like \textwidth:

\documentclass{article}
\usepackage{lipsum}
\AtBeginDocument{\pdfliteral { 0.95 0 0 0.95 0 0 cm }}% set TMatrix
\begin{document}
\lipsum
\end{document}

-
Scaling the complete output is not an option, as the goal is to reflow to text so that I can trim a document to one page less. I've edited my question to reflect this. – Rabarberski Sep 5 '12 at 11:51
What is the solution with xelatex and lualatex, by the way? I've just been looking for it in the fontspec documentation and couldn't see how to do it. – Loop Space Sep 5 '12 at 12:09
\setmainfont[Scale=0.95]{...} or \addfontfeature{Scale=0.95} – Herbert Sep 5 '12 at 12:14
@Rabarberski: As I wrote, it depends to your used fonts and you told us nothing about that ... – Herbert Sep 5 '12 at 12:15
@Herbert: I don't know which font is used, currently I use the IEEEtran documentclass. But my question is meant general, irrespective of the used documentclass (and hence, font). – Rabarberski Sep 5 '12 at 12:18

Why not add \linespread{0.95}, it reduces the space between two lines with 5%, so there will be more text on your page.

-

You could use the extsizes package:

\usepackage[20pt]{extsizes}


The standard Latex classes (article, report etc) support ten, eleven and twelve point text. These are the commonest sizes used in publishing. However, for certain applications there may be a need for other sizes. The extsizes classes (extarticle, extreport, extbook, extletter, and extproc) provide support for sizes eight, nine, ten, eleven, twelve, fourteen, seventeen and twenty points.

See for example change font size of moderncv.

-