Hi Ryan,
welcome to the board!
Ryan Henderson wrote:Can I declare fonts in the preamble, or just at the points of their use in the document?
Declare used fonts and settings in the preamble. Within the document body, use only switches to change from one predefined font to another one. Even better: define logical styles, so you don't have to specify fonts within the text. This makes it much easier to change the font later.
Good documents usually don't have a big mix of fonts. Often there's a serif (roman) font for the body text, a sans serif font (for example for headings), an italic font shape (for emphasizing), a typewriter font (for code snippets), and more - but rarely several roman fonts or different sans serif fonts. So, in many cases one defines the specific font just by loading the font package in the preamble, while in the document the style is just switched.
To explain what I mean with logical styles, an example: it's much better to define a keyword style, such as by
Code: Select all
\newcommand*{\keyword}[1]{\textbf{\texttt{#1}}}
and later use
\keyword{code}
instead of frequently using
\textbf{\texttt{code}}
in the document. It's much easier to change the style later on in the preamble, instead of replacing every instance in the text. You could even extend the macro later, if you like, such as
Code: Select all
\newcommand{\keyword}[1]{\textbf{\texttt{#1}}\index{#1}}
for an automatically generated index.
So, avoid using such
\renewcommand*
lines in the document body.
Stefan