48 lines
3.5 KiB
TeX
48 lines
3.5 KiB
TeX
\chapter{Styling Text in \LaTeX{}}
|
|
|
|
One of the most confusing things in \LaTeX{} for some people is how to format text, especially when you are creating some custom macros that change the appearance of text.
|
|
|
|
There are two key concepts to keep in mind here. The first concept to keep in mind here is that \LaTeX{} has both \textit{commands} and \textit{environments} to style text. The second concept is that ``text'' is not just a collection of characters, but a collection of characters with \textit{distinct groups of characteristics}.
|
|
|
|
Those characteristics include:
|
|
|
|
\begin{itemize}[noitemsep]
|
|
\item Typeface
|
|
\item Shape
|
|
\item Series
|
|
\item Size
|
|
\end{itemize}
|
|
|
|
Let's look at each of these in turn.\footnote{For the illustrations here, I am hugely grateful to the StackExhange user \kref{https://tex.stackexchange.com/users/4918/tobi}{Tobi}, who provided examples at \kref{https://tex.stackexchange.com/a/139592/245702}{https://tex.stackexchange.com/a/139592/245702}.}
|
|
|
|
\section{Typefaces}
|
|
|
|
For better or for worse, the rise of the Apple Macintosh led to a blurring between the words ``typeface'' and ``font''. What most people mean when they say ``font'' and what your GUI-based word-processing program is actually referring to in its ``Font'' menu is actually a \textit{typeface}, which means a collection of characters styled in a particular way. ``Times New Roman'' is a typeface, ``Verdana'' and ``Arial'' are others.
|
|
|
|
A font, on the other hand, actually refers to a collection of characteristics, including shape, series, and size. ``Times New Roman'' is a typeface; ``Times New Roman bold italic 10 point'' is a font. This distinction goes back to the days when typefaces were physical objects made of lead.
|
|
|
|
\section{Shape}
|
|
|
|
The \textit{shape} of a font refers to how the individual characters are formed.\footnote{This is a terrible definition, but it is what it is. I didn't make the rules here.} Shape can be upright (i.e., ``normal''), italic, slanted, and small caps.
|
|
|
|
Both italic and slanted shapes lean to the right. The main difference between the two occurs when you apply this to a \textit{serif} typeface—that is, a typeface that has little bits regularly attahced to the end of a larger stroke. A slanted shape is just that: it's as if you had written out the text on a flexible substrate and then just stretched it a bit so it leans to the right. An italic shape, however, actually has completely different, somewhat more curvy shape to each character.
|
|
|
|
This is what they look like in a Roman (i.e., a ``serif'' typeface):
|
|
|
|
\ksamp{large}{Normal abc}{-3mm}{-2mm}
|
|
|
|
\noindent{}and here is what they look like in a sans-serif typeface:
|
|
|
|
\textsf{\ksamp{large}{Normal abc}{-6mm}{-2mm}}
|
|
|
|
Small Caps is shorthand for ``small capitals'' and refers to text in which all the lower-case characters are substituted by their upper-case equivalents.
|
|
|
|
\section{Series}
|
|
|
|
Series is usually known as \textit{weight}, or how bold a particular bit of text is. In theory, you could have a number of different series or weights (and CSS does allow for this) but in reality, most typefaces are available either as \textit{normal} (i.e., not bold) or \textit{bold}. (A few also have a ``light'' option, but this is rare in my experience.)
|
|
|
|
Almost all of the text you read is ``normal'' weight, but \textbf{this bit is in bold} (which is also called ``boldface'').
|
|
|
|
\section{Size}
|
|
|
|
Size is easy to figure out: it just refers to how large a bit of text appears, either on screen or on paper. In reality, a typeface's size is much more complicated than that. |