Lesson Three - LaTeX Lessons - Resources - Mathematics and Statistics - University of Canterbury - New Zealand

LaTeX Lessons

Lesson Three: Introduction to Fonts

Changing the size of the font

To change the size of the font, one must specify a size from the table below. For example with the sample file shown below one can easily change the size of a font via the use of brackets {} and \Large.

\documentclass[12pt]{article}
\begin{document}
{\Large Assignment 1}\\
To calculate the ...etc.
\end{document}

Download: latsam3a.tex

If you follow the procedure mentioned earlier of

  1. LaTeX the file via latex file_name.tex
  2. dvips the file via dvips file_name
  3. ps2pdf the file via ps2pdf file_name.ps

You will see the effect of the \Large.

Edit the file, i.e.

xemacs latsam3a.tex &

Now try out various different font sizes and re-latex and dvips them, making sure that you remember the brackets.

Notes:

  • Not using brackets will just result in the document having that font from then on.
  • You must use the brackets {} not () or [].
LaTeXOutput
{\tiny Some Text}Some Text
{\scriptsize Some Text}Some Text
{\footnotesize Some Text}Some Text
{\small Some Text}Some Text
Some TextSome Text
{\large Some Text}Some Text
{\Large Some Text}Some Text
{\LARGE Some Text}Some Text
{\huge Some Text}Some Text

Figure 3.1 - Various Font Sizes

Changing the style of the font

To change the style of the font, one must specify which style you wish from the table below, see example below.

\documentclass[12pt]{article}
\begin{document}
\noindent \textbf{Assignment 1}\\
To calculate the ...etc.
\end{document}

Download: latsam3b.tex

LaTeXOutput
Some TextSome Text
\textit{SomeText}Some Text
\textsl{SomeText}Some Text
\textup{SomeText}Some Text
\textrm{SomeText}Some Text
\textsf{SomeText}Some Text
\textbf{SomeText}Some Text
\textsc{SomeText}Some Text
\texttt{SomeText}Some Text

Figure 3.2 - Various Font Styles

Combining different styles and sizes

One can combine font styles and font sizes together so that you can have for instance bold italics size large. See below for a working example.

\documentclass[12pt]{article}
\begin{document}
\textbf{{\Large O}nce more onto the breech dear \textit{friends}}
Let this be our summer of discontent
\end{document}

Download: latsam3c.tex

Once more onto the breech dear friends
Figure 3.3 - Result of line 3 in previous code

This concludes lesson 3.


Next >>