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
- LaTeX the file via
latex file_name.tex
- dvips the file via
dvips file_name
- 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[]
.
LaTeX | Output |
---|---|
{\tiny Some Text} | ![]() |
{\scriptsize Some Text} | ![]() |
{\footnotesize Some Text} | ![]() |
{\small Some Text} | ![]() |
Some Text | ![]() |
{\large Some Text} | ![]() |
{\Large Some Text} | ![]() |
{\LARGE Some Text} | ![]() |
{\huge 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
LaTeX | Output |
---|---|
Some Text | ![]() |
\textit{SomeText} | ![]() |
\textsl{SomeText} | ![]() |
\textup{SomeText} | ![]() |
\textrm{SomeText} | ![]() |
\textsf{SomeText} | ![]() |
\textbf{SomeText} | ![]() |
\textsc{SomeText} | ![]() |
\texttt{SomeText} | ![]() |
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
Figure 3.3 - Result of line 3 in previous code
This concludes lesson 3.