Text FormattingHow to Increase Font Size?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

How to Increase Font Size?

Post by LaTexLearner »

How can I increase the default font size?

My first line of code is:

Code: Select all

\documentclass[12pt,letterpaper,openright]{book}
This makes the default font size 12. But I work with young and special needs kids for whom this font size is too small. I tried increasing it to 14pt and 16 pt, but that did not compile.

What can I do?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to Increase Font Size?

Post by Johannes_B »

Class extbook provides larger font sizes.

If you have more special needs, have a look at Change font size with KOMA-script.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

How to Increase Font Size?

Post by Stefan Kottwitz »

Here is the link to the manual for the textbook class: extsizes.

However, I strongly recommend to use the class scrbook instead of book:

Code: Select all

\documentclass[fontsize=12pt, paper=letter, openright]{scrbook}
With scrbook, which is a KOMA-script class, very many task are much simpler than with the old basic book class. You can simply make a lot of settings for customization. There's a large manual for reference: scrguide. You don't need to read it all, but it helps in case of questions. And if you got any questions regarding a change to KOMA-Script, just let us know! Simply open a new topic. Such if you may have questions regarding the options.

And to cite here, what Johannes wrote on the other site regarding changing font size all the following is written by Johannes:

\changefontsizes is not really explained in the documentation, but is definitely in the experts section. So, hands off.

The correct way to change the size is to use the interface \KOMAoption{fontsize}{11pt}. Or if you are feeling funny you can choose 10.999999 pt. KOMA will look for an existing file with predefined settings, and if it doesn't find one, it uses \changefontsizes. You can read more about the mechanism in Clemens' good answer to Using fallback calculation to setup font sizes.

What happens with \changefontsizes? It takes one argument, the desired font size for \normalsize and does some calculations. In theory, you can put in any number, even non integers, the algorithm of scrextend does its job, calculates the relative sizes as well and uses those values as the now default ones. The command issues a warning that it now uses fallback calculations.

One thing we see as well is that not every font is available in every fontsize. LaTeX then decides to use next best font. I guess we all have seen warning like

Code: Select all

LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <3.7699> not
available
(Font)              size <5> substituted on input line 47.
One thing we need to remember: Use the interface the documentation describes, do not use internal or low-level or package author commands to do your every days work.

Code: Select all

\listfiles
\documentclass[11pt]{article}
\usepackage{scrfontsizes}

\makeatletter
\newcommand{\currentsize}{{\par current text size: \f@size pt\par}}
\newcommand{\currentfnsize}{{\par\footnotesize current footnote size: \f@size pt\par}}
\newcommand{\currentlargesize}{{\par\large current large size: \f@size pt\par}}
\makeatother

\newcommand{\explain}[1]{\bigbreak\emph{ #1:}}

\begin{document}
\explain{global option 12 pt}
\currentsize \currentfnsize \currentlargesize
\explain{Using the KOMA-interface}
\KOMAoption{fontsize}{11pt}\currentsize
\currentsize \currentfnsize \currentlargesize

\explain{\texttt{changefontsizes 11 pt}}
\changefontsizes{11}
\currentsize \currentfnsize \currentlargesize
\explain{You can even do 
\texttt{changefontsizes 11.375 pt}}
\changefontsizes{31.375}
\currentsize \currentfnsize \currentlargesize
\KOMAoption{fontsize}{3.141596pt}
\currentsize \currentfnsize \currentlargesize
\end{document}
font-samples.png
font-samples.png (69.42 KiB) Viewed 13181 times
If the need for the use of a non standard size exists, it is better to generate a clo file and not calculate the values every single time. You can also change that file and make adjustments where you see fit. Package scrfontsizes helps you achieving this task.

Code: Select all

\documentclass{minimal}%ok just this time
\usepackage{scrfontsizes}
\generatefontfile{texsx}{11bp}
\begin{document}\end{document}
You can now use the new font size, but need to define the prefix fix.

Code: Select all

\makeatletter
\newcommand*{\@fontsizefilebase}{texsx}
\makeatother
\documentclass[fontsize=11bp]{scrartcl}
\usepackage{blindtext}
\begin{document}
\blindtext
\end{document}
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

How to Increase Font Size?

Post by LaTexLearner »

Stefan_K wrote:...

However, I strongly recommend to use the class scrbook instead of book:

Code: Select all

\documentclass[fontsize=12pt, paper=letter, openright]{scrbook}
With scrbook, which is a KOMA-script class, very many task are much simpler than with the old basic book class. You can simply make a lot of settings for customization. There's a large manual for reference: scrguide. You don't need to read it all, but it helps in case of questions. And if you got any questions regarding a change to KOMA-Script, just let us know! Simply open a new topic. Such if you may have questions regarding the options.
I read a little about the package here (https://www.ctan.org/pkg/koma-script?lang=en) but still have no idea what a "KOMA-script class" is. A Google search didn't help much. :lol:
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: How to Increase Font Size?

Post by Johannes_B »

KOMA-script is a bundle of classes and packages that substiute the standard classes and enhance them in many many ways.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply