texblog
because LaTeX matters
Changing the font size in LaTeX
Changing the font size in LaTeX can be done on two levels, either
affecting the whole document or parts/elements of it. Using a different
font size on a global level will affect all normal-sized text as well as
the size of headings, footnotes, etc. By changing the font size
locally, however, a single word, a few lines of text, a large table or a
heading throughout the document may be modified.
In most cases, the available font sizes for the standard classes are sufficient.
Other font sizes
Should you require a different font size for your document, use the extsizes package. It allows for the following font sizes:
The documentclass names are slightly different from the standard classes:
The KOMA-script and memoir class
The KOMA-script and memoir classes are more flexible when it comes to font sizes. Please see the documentation for more details.
A table of the exact font sizes in points can be found on wikibooks.
A good rule of thumb is don’t use too many different sizes and don’t make things too small/big.
There are two possible ways to use these font size modifier commands, inline or as environment:
The
A few more options
The moresize package adds two more to the list above,
While using
Note: The figure is scaled and therefore does not show the actual font size. It illustrates the difference between the font sizes.
The two arguments to
The following example shows font size 50pt/5pt and compares them with
That’s more like it! Again, this only works with a non-standard font type. And again, it does not show the actual font size. Try it with LaTeX!
Source with more details: here and there.
Changing the font size on a document-wide level
The standard classes, article, report and book support 3 different font sizes,10pt, 11pt, 12pt
(by default 10pt
). The font size is set through the optional argument, e.g.:
1
| \documentclass [12pt]{report} |
Other font sizes
Should you require a different font size for your document, use the extsizes package. It allows for the following font sizes:
8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt
.The documentclass names are slightly different from the standard classes:
1
2
3
4
| %Article \documentclass [9pt]{extarticle} %Report \documentclass [14pt]{extreport} |
The KOMA-script and memoir class
The KOMA-script and memoir classes are more flexible when it comes to font sizes. Please see the documentation for more details.
Changing the font size locally
LaTeX knows several font size modifier-commands (from biggest to smallest):
1
2
3
4
5
6
7
8
9
10
| \Huge \huge \LARGE \Large \large \normalsize (default) \small \footnotesize \scriptsize \tiny |
A table of the exact font sizes in points can be found on wikibooks.
A good rule of thumb is don’t use too many different sizes and don’t make things too small/big.
There are two possible ways to use these font size modifier commands, inline or as environment:
1
2
3
4
5
6
7
| % inline { \Large This is some large text \par } % environment \begin {footnotesize} ... \end {footnotesize} |
\par
at the end of the inline example adjusts baselineskip
, the minimum space between the bottom of two successive lines. See the example in Rob’s comment below.A few more options
The moresize package adds two more to the list above,
\HUGE
and \ssmall
. The latter fills the gap between \scriptsize
and \tiny
.While using
\HUGE
, LaTeX displays a warning saying the
font size is not available for the standard font and that it was
replaced by the next smaller (\Huge
). When using another font type, such as the Adobe Times Roman equivalent available in the PSNFSS package (see example below), however, you can benefit from that font size.
1
2
3
4
5
6
7
| \documentclass [11pt]{report} \usepackage {mathptmx} \usepackage [11pt]{moresize} ... { \HUGE A huge text} { \ssmall Can you still read this ``ssmall'' text?} |
Note: The figure is scaled and therefore does not show the actual font size. It illustrates the difference between the font sizes.
Still not enough?
Here is alternative, more flexible approach. The anyfontsize package scales the next bigger/smaller font size available to whatever size you like.The two arguments to
\fontsize
are the actual font size and the size of the baseline-skip. The baseline-skip should be set to roughly 1.2x the font size.\fontsize {size}{baselineskip} |
\Huge
and \tiny
.
1
2
3
4
5
6
7
| \documentclass [11pt]{report} \usepackage {mathptmx} \usepackage {anyfontsize} \usepackage {t1enc} ... { \fontsize {50}{60} \selectfont Foo}{ \fontsize {5}{6} \selectfont bar!} { \Huge Foo}{ \tiny bar!} |
That’s more like it! Again, this only works with a non-standard font type. And again, it does not show the actual font size. Try it with LaTeX!
Source with more details: here and there.
22 Comments
Leave a Reply
Thanks! Would you be able to provide a minimal working example of the issue you describe above?
Thanks, Tom.
\documentclass
{article}
\usepackage
[utf8]{inputenc}
\usepackage
[english]{babel}
\usepackage
{blindtext}
\begin
{document}
% Normalsize text
\blindtext
% Scriptsize text with normalsize line spacing
{
\scriptsize
\blindtext
}
% Scriptsize text with scriptsize line spacing
{
\scriptsize
\blindtext
}
% \par does the trick as well
{
\scriptsize
\blindtext
\par
}
\end
{document}
I wasn’t aware of that issue. Will change it in the post.
Best, Tom.
Thanks Humberto Munoz
Hope it helps,
Tom
So perhaps the solution for your doubt is to use
{
\tiny
Foo foo foo ... foo
\par
}
{
\Huge
Foo foo foo ... foo
\par
}
Thanks for your comment.
Are you referring to Rob’s comment?
Thanks, Tom.
Thanks for your question! The command
\par
ends the paragraph, that’s for sure. Now why\par
does the trick, I’m not entirely sure. Apparently, TeX reads the whole paragraph first for optimal space adjustment between words. And manually ending the paragraph seems to also adjust\baselineskip
when the font size is changed, whereas standard paragraph ending (blank line) does not. “The TeXbook” by Donald E. Knuth would be the right place to look for an answer :-).Cheers, Tom.
II seems ridiculous to change the math font size in big projects manually!
Interesting question, thanks! You want to use the command
\DeclareMathSizes
as explained in the answer to this question.Hope it helps,
Tom
I noticed some fonts have a scale option that can be passed to their usepackage command that corrects this issue but I have no clue how to go about adjusting my .sty for that.
This is the extent of my lucimono.sty file:
\NeedsTeXFormat
{LaTeX2e}
\ProvidesPackage
{lucimono}[2007/01/31 v.0.3 lucimono (Lucida Mono) package]
\RequirePackage
[T1]{fontenc}
\RequirePackage
{textcomp}
\renewcommand
*{
\ttdefault
}{2lm}
\endinput
Any clue on where I need to look to find out how to add a scale option to my lucimono.sty file?
Thank you.
Thanks for your question. I’m not an expert on fonts really. However, what I read while trying to better understand your problem is that people recommend using luximono instead, which supports scaling through an optional parameter (see code below). You can download and install the luximono font as described here. In case you really need to use
lucimono
fonts, take a look at theluximono
style file and how the scaling is done.\documentclass
[11pt]{article}
\usepackage
[scaled=0.87]{luximono}
\renewcommand
*
\familydefault
{
\ttdefault
}
\usepackage
[T1]{fontenc}
\usepackage
{textcomp}
\usepackage
{blindtext}
\begin
{document}
\blindtext
{
\fontencoding
{T1}
\fontfamily
{cmr}
\selectfont
\blindtext
}
\end
{document}
Thanks for this interesting question! You can find an informative discussion on the Gulliver font here. Briefly, the Gulliver font is proprietary and no similar free font exists. In case using this particular font for your thesis is a university requirement, they should have a license and be able to tell you how to install it on your system. Otherwise, you might want to take a look at the LaTeX font catalogue and pick another font you like. Sorry for the “bad” news.
Cheers, Tom