% -*-latex-*-
% Document name: /u/sy/beebe/tex/tg-sampler.ltx
% Creator: Nelson H. F. Beebe [beebe@math.utah.edu]
% Creation Date: Tue Nov  3 11:54:11 2015
\documentclass[]{article}

\usepackage{amsfonts}           % needed only for \mathfrak in last section
\usepackage{tgbonum}
\newcommand{\oldrmdefault}{qbk}
\newcommand{\bs}{\texttt{\char `\\}}

\title{\headercolor \Huge \bf A Font Family Sampler}

\author{%
        \Large \bf \authorcolor Nelson H. F. Beebe \\[1ex]
        \Large \bf \addresscolor Department of Mathematics \\
        \Large \bf \addresscolor University of Utah \\
        \Large \bf \addresscolor Salt Lake City, UT 84112-0090, USA
}

\date{\Large \bf \datecolor 11 February 2021 \\[1ex]
      Version 1.6}

\pagestyle{headings}
\markright{{\rm \fontfamily{\oldrmdefault}\selectfont A Font Family Sampler}}

% \usepackage[dvips]{color}
\usepackage[pdftex]{color}
\usepackage{rgb}

\usepackage[T1]{fontenc}           % T1 is only encoding available for LuxiMono
\usepackage[scaled=0.85]{luximono}
\usepackage[scaled=0.85]{noto}

\usepackage[utf8]{inputenc}

\usepackage{url}

%%% --------------------------------------------------------------------

\definecolor{gray25}{rgb}{0.25,0.25,0.25}
\definecolor{gray50}{rgb}{0.50,0.50,0.50}
\definecolor{gray75}{rgb}{0.75,0.75,0.75}
\definecolor{utahred}{rgb}{0.8,0,0}

\newcommand{\addresscolor} {\color{gray50}}
\newcommand{\authorcolor}  {\color{gray25}}
\newcommand{\datecolor}    {\color{gray75}}
\newcommand{\headercolor}  {\color{utahred}}

\newcommand{\ocirc} [1]    {{\accent'027#1}}   % normal LaTeX definition
\renewcommand{\ocirc} [1]    {{\accent'006#1}} % TeX Gyre definition
\newcommand{\eth}          {\char240}
\newcommand{\Eth}          {\char208}

%%% --------------------------------------------------------------------

\makeatletter

%%% Redefine the third argument of the internal sectioning commands to
%%% get headings outdented into the left margin, for much improved
%%% visibility.

\renewcommand{\section}         {\@startsection{section}{1}{-2em}%
                                               {-3.5ex \@plus -1ex \@minus -.2ex}%
                                               {2.3ex \@plus.2ex}%
                                               {\ignorespaces \normalfont \Large \bfseries
                                                \headercolor }}

\renewcommand{\subsection}      {\@startsection{subsection}{2}{-2em}%
                                               {-3.25ex\@plus -1ex \@minus -.2ex}%
                                               {1.5ex \@plus .2ex}%
                                               {\ignorespaces \normalfont \large \bfseries
                                                \headercolor }}

\makeatother

%%% --------------------------------------------------------------------

\newcommand{\sample}[2] {\par%
                         \renewcommand{\rmdefault}{#2}
                         %% \renewcommand{\bfdefault}{#2}
                         \subsection*{\char`\\usepackage\{#1\} \hfill \% {\small #2}}%
                         \rm\sloppypar
                         Lorem ipsum dolor sit amet, aenean nulla
                         tellus metus odio non maecenas, pariatur
                         vitae congue laoreet semper, nulla adipiscing
                         cursus neque dolor dui, faucibus aliquam
                         quis. Lacus curae fermentum, morbi vestibulum
                         vel arcu sapien bibendum per.
%%:                          Integer id scelerisque orci sit felis
%%:                          pharetra, odio et cubilia tempor sapien,
%%:                          praesent dui lectus, ante suscipit nunc
%%:                          vestibulum porttitor.  Neque ultricies,
%%:                          aliquet nibh, neque tincidunt id amet,
%%:                          sit turpis a, sit felis leo. Eget augue
%%:                          non mattis proin integer, leo iaculis eu
%%:                          nunc gravida vel, quisque hendrerit
%%:                          sollicitudin, aliquam magna, scelerisque
%%:                          molestie diam facilisis ad aenean curae.
                         \par
                         \medskip
                         \small
                         \noindent
                         UPPERCASE: A~B~C~D~E~F~G~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~Z~~~{\AE}~{\O}~{\AA}~~~{\"A}~{\"O}~{\OE}~~~{\c{C}}~{\~N}
                         \par
                         \noindent
                         Lowercase: a~b~c~d~e~f~g~h~i~j~k~l~m~n~o~p~q~r~s~t~u~v~w~x~y~z~~~{\ae}~{\o}~{\aa}~~~{\"a}~{\"o}~{\oe}~~~{\c{c}}~{\~n}~{\ss}
                         \par
                         \noindent
                         Digits: 0~1~2~3~4~5~6~7~8~9~~~~~~~~~~Letters: O~{\O}~Q~I~l~S~B
                         % \par $$ f(x) = \sqrt{x^2 + \int_0^\infty \sin(t x)\,dt} $$\par
                         \par
                         \noindent
                         Special symbols: \dag~~\ddag~~\S~~\P~~\copyright~~\pounds~~\$~~\texteuro
                         \par
                         \it
                         \noindent
                         UPPERCASE: A~B~C~D~E~F~G~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~Z~~~{\AE}~{\O}~{\AA}~~~{\"A}~{\"O}~{\OE}~~~{\c{C}}~{\~N}
                         \par
                         \noindent
                         Lowercase: a~b~c~d~e~f~g~h~i~j~k~l~m~n~o~p~q~r~s~t~u~v~w~x~y~z~~~{\ae}~{\o}~{\aa}~~~{\"a}~{\"o}~{\oe}~~~{\c{c}}~{\~n}~{\ss}
                         \par
                         \noindent
                         Digits: 0~1~2~3~4~5~6~7~8~9~~~~~~~~~~Letters: O~{\O}~Q~I~l~S~B
                         % \par $$ f(x) = \sqrt{x^2 + \int_0^\infty \sin(t x)\,dt} $$\par
                         \par
                         \noindent
                         Special symbols: \dag~~\ddag~~\S~~\P~~\copyright~~\pounds~~\$~~\texteuro
                         \par
                         \bf
                         \noindent
                         UPPERCASE: A~B~C~D~E~F~G~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~Z~~~{\AE}~{\O}~{\AA}~~~{\"A}~{\"O}~{\OE}~~~{\c{C}}~{\~N}
                         \par
                         \noindent
                         Lowercase: a~b~c~d~e~f~g~h~i~j~k~l~m~n~o~p~q~r~s~t~u~v~w~x~y~z~~~{\ae}~{\o}~{\aa}~~~{\"a}~{\"o}~{\oe}~~~{\c{c}}~{\~n}~{\ss}
                         \par
                         \noindent
                         Digits: 0~1~2~3~4~5~6~7~8~9~~~~~~~~~~Letters: O~{\O}~Q~I~l~S~B
                         % \par $$ f(x) = \sqrt{x^2 + \int_0^\infty \sin(t x)\,dt} $$\par
                         \par
                         \noindent
                         Special symbols: \dag~~\ddag~~\S~~\P~~\copyright~~\pounds~~\$~~\texteuro
                         \par
                         \rmfamily
                         \normalsize
                         \rm
                         }

%%% --------------------------------------------------------------------

\begin{document}

\maketitle

To assist in producing greater font face variation in university
dissertations and theses, this document illustrates font family
selection with a \LaTeX{} document preamble command
%
\begin{verbatim}
    \usepackage{FAMILY}
\end{verbatim}
%
where \texttt{FAMILY} is given in the subsection titles below.

The body font in this document is from the \emph{\TeX{} Gyre Bonum} family,
selected by a \verb=\usepackage{tgbonum}= command in the document
preamble, but the samples illustrate scores other font families.

Like \emph{Computer Modern}, \emph{Latin Modern}, and the commercial
\emph{Lucida} and \emph{MathTime} families, the \emph{\TeX{} Gyre}
families offer extensive collections of mathematical characters that
are designed to resemble their companion text characters, making them
good choices for scientific and mathematical typesetting.  The
\emph{\TeX{} Gyre} families also contain many additional
specially designed single glyphs for accented letters needed by
several European languages, such as
\Eth,
\eth,
% \Th,
% \th,
\k{A},
\k{a},
\k{E},
\k{e},
\L,
\l,
{\"O},
{\"o},
{\H{O}},
{\H{o}},
{\"U},
{\"u},
{\H{U}},
{\H{u}},
\c{S},
\c{s},
\ocirc{T},
\ocirc{t},
\c{T},
\c{t},
\ocirc{U},
and
\ocirc{u}.

%%:  0: {\accent 0u}\par
%%:  1: {\accent 1u}\par
%%:  2: {\accent 2u}\par
%%:  3: {\accent 3u}\par
%%:  4: {\accent 4u}\par
%%:  5: {\accent 5u}\par
%%:  6: {\accent 6u}\par
%%:  7: {\accent 7u}\par
%%:  8: {\accent 8u}\par
%%:  9: {\accent 9u}\par
%%: 10: {\accent 10u}\par
%%: 11: {\accent 11u}\par
%%: 12: {\accent 12u}\par
%%: 13: {\accent 13u}\par
%%: 14: {\accent 14u}\par
%%: 15: {\accent 15u}\par
%%: 16: {\accent 16u}\par
%%: 17: {\accent 17u}\par
%%: 18: {\accent 18u}\par
%%: 19: {\accent 19u}\par
%%: 20: {\accent 20u}\par
%%: 21: {\accent 21u}\par
%%: 22: {\accent 22u}\par
%%: 23: {\accent 23u}\par
%%: 24: {\accent 24u}\par
%%: 25: {\accent 25u}\par
%%: 26: {\accent 26u}\par
%%: 27: {\accent 27u}\par
%%: 28: {\accent 28u}\par
%%: 29: {\accent 29u}\par
%%: 30: {\accent 30u}\par
%%: 31: {\accent 31u}\par


%%% ====================================================================

\section*{Comparison of text fonts}

Some of the families illustrated in this section include
distinct mathematics faces, but for brevity, we show only
prose.  When a font family is not chosen, the \LaTeX{} and
Plain \TeX{} default is the traditional \emph{Computer
Modern} family used to typeset the \emph{Art of Computer
Programming} books, and shown in the first subsection.

NB: The LuxiMono font has rather large characters: it is used here in
15\% reduced size via these preamble commands:
%
\begin{verbatim}
    \usepackage[T1]{fontenc} % only encoding available for LuxiMono
    \usepackage[scaled=0.85]{luximono}
\end{verbatim}
%

\sample{}{cmr}               \medskip
                             % \noindent
                             \fontfamily{\oldrmdefault}\selectfont
                             The sample is in the default \emph{Computer
                             Modern} family in \LaTeX{} and \TeX{},
                             patterned after the classic \emph{Monotype
                             Modern 8A} family.  It is what you get
                             when you do not supply a
                             \verb=\usepackage= command to select a
                             nondefault font.  The \emph{Computer Modern}
                             family has regular, bold, italic,
                             sans-serif, slanted, and typewriter
                             variants, as well as an extensive
                             repertoire of mathematics glyphs.  Few
                             other font families supply mathematical
                             characters, so for them, \TeX{} falls
                             back to \emph{Computer Modern}.
% No file TS1aer.fd: \sample{ae}{aer}
\sample{avantgarde}{pag}
% \sample{basker}{pnb}
% \sample{bembo}{pbb}
% NO: missing backslash character: \sample{bodoni}{bodoni}
\sample{bookman}{pbk}
% NO: missing font data: \sample{brushscr}{pbsi}
% No file TS1pbsi.fd:    \sample{brushscr}{pbsi}
\sample{caladea}{Caladea-TLF}
% \sample{centaur}{pur}
\sample{chancery}{pzc}
\sample{charter}{bch}
\sample{cochineal}{Cochineal-TLF}
\sample{comicneue}{ComicNeue-TLF}
\sample{comfortaa}{fco}
\sample{concrete}{ccr}       \medskip
                             % \noindent
                             \fontfamily{\oldrmdefault}\selectfont
                             Like the default \emph{Computer Modern}
                             family, the \emph{Concrete} family has
                             regular, bold, italic, sans-serif,
                             slanted, and typewriter variants, as well
                             as an extensive repertoire of mathematics
                             glyphs.
\sample{courier}{pcr}
\sample{crimson}{Crimson-TLF}
\sample{DejaVuSans}{DejaVuSans-TLF}
\sample{DejaVuSansCondensed}{DejaVuSansCondensed-TLF}
\sample{DejaVuSerif}{DejaVuSerif-TLF}
\sample{DejaVuSerifCondensed}{DejaVuSerifCondensed-TLF}
\sample{ebgaramond}{EBGaramond-TLF}
% No file TS1cmor.fd. \sample{eco}{cmor}
% No file T1eu1lmr.fd \sample{euler}{eu1lmr}
% No file T1eu2lmr.fd \sample{euler}{eu2lmr}
\sample{fourier}{futx}
% \sample{garamond}{pgm}
\sample{gfsartemisia}{artemisia}
\sample{gfsartemisia-euler}{artemisiaeuler}
% NO: only d iffers CMR in italics: \sample{gillcm}{cmg}
\sample{gillius}{GilliusADF-LF}
\sample{gillius2}{GilliusADFNoTwo-LF}
% \sample{gillsans}{mgs}
% \sample{gillsans}{pgs}
\sample{GoSans}{Go-TLF}      \medskip
                             {%
                                 \renewcommand{\ttdefault}{GoMono-TLF}
                                 This is a new font family released in
                                 November 2016 under an open-source
                                 license as part of the Go Project,
                                 and designed by the Bigelow \& Holmes
                                 type foundry.  For more information,
                                 and many type samples, see
                                 \url{https://blog.golang.org/go-fonts}.
                                 The fonts are available in the CTAN
                                 archive
                                 \url{http://mirrors.ibiblio.org/CTAN/fonts/gofonts/},
                                 but at the time of release, were not
                                 yet in the \TeX{} Live 2016
                                 distribution tree.  However, they
                                 have been installed manually in the
                                 \TeX{} Live 2016
                                 \texttt{texmf-var/fonts} tree on
                                 local systems.
                             }

\sample{helvet}{phv}
\sample{heuristica}{Heuristica-TLF}
% NO: missing backslash charter: \sample{humanist}{hmin}
% No file TS1mak.fd: \sample{kerkis}{mak}
\sample{kpfonts}{jkpf}
\sample{kerkis}{mak}
\sample{libertine}{LinuxLibertineT-TLF}
\sample{librebaskerville}{LibreBaskerville-TLF}
\sample{LibreBodoni}{LibreBodoni-TLF}
\sample{librecaslon}{LibreCaslonText-OsF}
\sample{lmodern}{lmr}        \medskip
                             % \noindent
                             \fontfamily{\oldrmdefault}\selectfont
                             The sample is in the new \emph{Latin
                             Modern} family that extends the default
                             \emph{Computer Modern} family with
                             additional accented letters for European
                             languages, as well as adding many new
                             mathematical glyphs.
\sample{lmodern}{lmtt}       \medskip
                             % \noindent
                             \fontfamily{\oldrmdefault}\selectfont
                             The sample is in the typewriter font of
                             the new \emph{Latin Modern} family that extends
                             the default \emph{Computer Modern} family.
\sample{LobsterTwo}{LobsterTwo-LF}
% \sample{lucmin}{zmn}
\sample{luximono}{ul9}
\sample{mathpazo}{ppl}
\sample{mathptm}{ptm}
\sample{merriweather}{MerriweatherSans-TLF}

% \sample{minion}{pmn}
\sample{mintspirit}{MintSpirit-TLF}
\sample{mintspirit2}{MintSpiritNoTwo-TLF}

% \sample{mtimes}{mnt}
\sample{newcent}{pnc}
% \sample{nimbus}{unm}
\sample{nimbusserif}{NimbusSerif}
\sample{nimbussans}{NimbusSans}
\sample{noto}{NotoSerif-TLF} \medskip
                             % \noindent
                             \fontfamily{\oldrmdefault}\selectfont
                             The sample was typeset with the default serifed
                              roman fonts or {\tt \{\bs rmfamily
                              \ldots{}\}} or {\tt \bs
                              textrm\{\ldots{}\}}.
                             \par
                             The \emph{Google Noto} free font family
                             supplies thousands of Unicode characters
                             in many scripts, with reasonable family
                             resemblance across alphabetic scripts.
\sample{noto}{NotoSans-TLF}  \medskip
                             % \noindent
                             \fontfamily{\oldrmdefault}\selectfont
                             The sample was typeset with {\tt \{\bs sffamily
                             \ldots{}\}} or {\tt \bs textsf\{\ldots{}\}}.
\sample{oldstandard}{OldStandard-TLF}
\sample{overlock}{Overlock-LF}
\sample{palatino}{ppl}
% No file T1panr.fd: \sample{pandora}{panr}
\sample{PlayfairDisplay}{PlayfairDisplay-LF}
\sample{quattrocento}{Quattrocento-TLF}
\sample{roboto}{Roboto-TLF}
\sample{tgadventor}{qag}
\sample{tgbonum}{qbk}
\sample{tgchorus}{qzc}
\sample{tgcursor}{qcr}
\sample{tgheros}{qhv}
\sample{tgpagella}{qpl}
\sample{tgschola}{qcs}
\sample{tgtermes}{qtm}
\sample{times}{ptm}
\sample{universalis}{UniversalisADFStd-LF}
\sample{utopia}{put}

% \clearpage

%%% ====================================================================

\newcommand{\showtt}[1]{\renewcommand{\ttdefault}{ul9}
                        {\headercolor \bf \texttt{\bs renewcommand\{\bs ttdefault\}\{#1\}}}
                        \renewcommand{\ttdefault}{#1}}

\newcommand{\showvariants}[1]{%
%%: \begin{itemize}
%%:   \item  {\tt \bs bfseries: \bfseries http://www.math.utah.edu/}
%%:   \item  {\tt \bs itshape:  \itshape  http://www.math.utah.edu/}
%%:   \item  {\tt \bs slshape:  \slshape  http://www.math.utah.edu/}
%%:   \item  {\tt \bs bfseries \bs itshape: \bfseries \itshape  http://www.math.utah.edu/}
%%: \end{itemize}
\begin{center}
    \renewcommand{\ttdefault}{#1}%
    \begin{tabular}{ll}
      \hline
      \multicolumn{2}{c}{\bf Series and shape variants} \\
      \hline
      {\tt \bs ttfamily}             & {\tt \ttfamily           http://www.math.utah.edu/} \\
      {\tt \bs mdseries}             & {\tt \mdseries           http://www.math.utah.edu/} \\
      {\tt \bs bfseries}             & {\tt \bfseries           http://www.math.utah.edu/} \\
      {\tt \bs itshape}              & {\tt \itshape            http://www.math.utah.edu/} \\
      {\tt \bs slshape}              & {\tt \slshape            http://www.math.utah.edu/} \\
      {\tt \bs bfseries \bs itshape} & {\tt \bfseries \itshape  http://www.math.utah.edu/} \\
      \hline
    \end{tabular}
\end{center}
}

\renewcommand{\rmdefault}{\oldrmdefault} % revert to original font
\renewcommand{\ttdefault}{ul9}           % use LuxiMono outside the samples

%%% ====================================================================

\section*{Comparison of typewriter fonts}

To change the typewriter (usually, fixed-width) font in a \LaTeX{}
document, issue the command
%
\begin{verbatim}
    \renewcommand{\ttdefault}{ABBREV}
\end{verbatim}
%
where \texttt{ABBREV} is the short name of a \LaTeX{} font
family.  You can do that multiple times, as we do in this
section, but normally, you should be consistent and use a
single typewriter font for your document.

The short names used here were found by searching numerous
style files for the string \texttt{\bs ttdefault}.  The
subsection titles are the long font family names, and
are \emph{not} \LaTeX{} package names.

In the examples, the first two lines of each verbatim
display indicate column numbers.  That is a useful one-time
trick if you change \verb=\textwidth= in your document,
because you then know how long subsequent verbatim lines can
be, and you can adjust them accordingly to avoid overfull boxes.

Notice the dramatic variations in text widths in the
families shown below.  For the common application of
typesetting computer input and output in \LaTeX{}
\verb|verbatim| displays, you may prefer a narrow font face
to maximize the number of characters per line.

Notice also that the \emph{Eco} family typewriter font has
\emph{old-style} digits, where half the numerals descend below
the baseline.

Some typewriter font families offer variants in series (bold) and
shape (italic and slanted), so each subsection ends with a table
illustrating those variants.

%%% --------------------------------------------------------------------

\subsection*{Algol Revived}

\hfuzz = \maxdimen              % be silent about overfull boxes

\showtt{AlgolRevived-TLF}

Although the typeface shown in this section is a typewriter style,
unusually, it is a \emph{proportional} font, as can be seen in the
lack of strict vertical alignment of letters and digits:
%
\begin{verbatim}
ABCDEFGHIJKLMNOPQRSTUVWXYZ      abcdefghijklmnopqrstuvwxyz    
BCDEFGHIJKLMNOPQRSTUVWXYZA      bcdefghijklmnopqrstuvwxyza    
CDEFGHIJKLMNOPQRSTUVWXYZAB      cdefghijklmnopqrstuvwxyzab    
DEFGHIJKLMNOPQRSTUVWXYZABC      defghijklmnopqrstuvwxyzabc    
EFGHIJKLMNOPQRSTUVWXYZABCD      efghijklmnopqrstuvwxyzabcd    
FGHIJKLMNOPQRSTUVWXYZABCDE      fghijklmnopqrstuvwxyzabcde    
GHIJKLMNOPQRSTUVWXYZABCDEF      ghijklmnopqrstuvwxyzabcdef    
HIJKLMNOPQRSTUVWXYZABCDEFG      hijklmnopqrstuvwxyzabcdefg    
IJKLMNOPQRSTUVWXYZABCDEFGH      ijklmnopqrstuvwxyzabcdefgh    
JKLMNOPQRSTUVWXYZABCDEFGHI      jklmnopqrstuvwxyzabcdefghi    
KLMNOPQRSTUVWXYZABCDEFGHIJ      klmnopqrstuvwxyzabcdefghij    
LMNOPQRSTUVWXYZABCDEFGHIJK      lmnopqrstuvwxyzabcdefghijk    
MNOPQRSTUVWXYZABCDEFGHIJKL      mnopqrstuvwxyzabcdefghijkl    
NOPQRSTUVWXYZABCDEFGHIJKLM      nopqrstuvwxyzabcdefghijklm    
OPQRSTUVWXYZABCDEFGHIJKLMN      opqrstuvwxyzabcdefghijklmn    
PQRSTUVWXYZABCDEFGHIJKLMNO      pqrstuvwxyzabcdefghijklmno    
QRSTUVWXYZABCDEFGHIJKLMNOP      qrstuvwxyzabcdefghijklmnop    
RSTUVWXYZABCDEFGHIJKLMNOPQ      rstuvwxyzabcdefghijklmnopq    
STUVWXYZABCDEFGHIJKLMNOPQR      stuvwxyzabcdefghijklmnopqr    
TUVWXYZABCDEFGHIJKLMNOPQRS      tuvwxyzabcdefghijklmnopqrs    
UVWXYZABCDEFGHIJKLMNOPQRST      uvwxyzabcdefghijklmnopqrst    
VWXYZABCDEFGHIJKLMNOPQRSTU      vwxyzabcdefghijklmnopqrstu    
WXYZABCDEFGHIJKLMNOPQRSTUV      wxyzabcdefghijklmnopqrstuv    
XYZABCDEFGHIJKLMNOPQRSTUVW      xyzabcdefghijklmnopqrstuvw    
YZABCDEFGHIJKLMNOPQRSTUVWX      yzabcdefghijklmnopqrstuvwx    
ZABCDEFGHIJKLMNOPQRSTUVWXY      zabcdefghijklmnopqrstuvwxy    

00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{AlgolRevived-TLF}

%%% --------------------------------------------------------------------

\subsection*{Bera Mono}

\hfuzz = \maxdimen              % be silent about overfull boxes

\showtt{fvm}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{fvm}

%%% --------------------------------------------------------------------

\subsection*{CMBright}

\showtt{cmtl}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{cmtl}

%%% --------------------------------------------------------------------

\subsection*{Computer Modern}

\showtt{cmtt}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{cmtt}

%%% --------------------------------------------------------------------

\subsection*{Courier}

\showtt{pcr}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{pcr}

%%% --------------------------------------------------------------------

\subsection*{DejaVu Sans Mono}

\showtt{DejaVuSansMono-TLF}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

To scale the font, put something like this in your document preamble:

\begin{verbatim}
\usepackage[scaled = 0.8]{DejaVuSansMono}
\end{verbatim}
%

\showvariants{DejaVuSansMono-TLF}

%%% --------------------------------------------------------------------

\subsection*{Droid Sans Mono}

\showtt{fdm}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{fdm}

%%% --------------------------------------------------------------------

\subsection*{Eco}

\showtt{cmott}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{cmott}

%%% --------------------------------------------------------------------

\subsection*{GoMono}

\showtt{GoMono-TLF}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

To scale the font, put something like this in your document preamble:
%
\begin{verbatim}
\usepackage[scaled = 0.8]{GoSans}
\usepackage[scaled = 0.8]{GoMono}
\end{verbatim}
%

\showvariants{GoMono-TLF}

%%% --------------------------------------------------------------------

\subsection*{Inconsolata}

\showtt{zi4}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{zi4}

%%% --------------------------------------------------------------------

\subsection*{Johannes Kepler}

\showtt{jkptt}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{jkptt}

%%% --------------------------------------------------------------------

\subsection*{Latin Modern}

\showtt{lmtt}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{lmtt}

%%% --------------------------------------------------------------------

\subsection*{Libertine Mono}

\showtt{LinuxLibertineMonoT-TLF}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{LinuxLibertineMonoT-TLF}

%%% --------------------------------------------------------------------

\subsection*{LuxiMono}

\showtt{ul9}

\begin{verbatim}
This sample was produced with the package option \texttt{scaled = 0.85}:

00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

To scale the font, put something like this in your document preamble:
%
\begin{verbatim}
\usepackage[scaled = 0.8]{LuxiMono}
\end{verbatim}
%

\showvariants{ul9}

%%: %%% --------------------------------------------------------------------
%%:
%%: \subsection*{OCR-B}
%%:
%%: \showtt{ocb}
%%:
%%: \inputencoding{OT1}
%%:
%%: \begin{verbatim}
%%: 00000000011111111112222222222333333333344444444445555555555666666666677777777778
%%: 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.
%%:
%%: Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
%%: non maecenas, pariatur vitae congue laoreet semper, nulla
%%: adipiscing cursus neque dolor dui, faucibus aliquam quis.
%%: \end{verbatim}
%%:
%%: \inputencoding{T1}
%%:
%%% --------------------------------------------------------------------

\subsection*{New TXTT}

\showtt{ntxtt}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla
tellus metus odio non maecenas, \ldots.
\end{verbatim}

\showvariants{ntxtt}

%%% --------------------------------------------------------------------

\subsection*{NimbusMono}

\showtt{NimbusMono}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{NimbusMono}

%%% --------------------------------------------------------------------

\subsection*{NimbusMonoNarrow}

\showtt{NimbusMonoN}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{NimbusMonoN}

%%% --------------------------------------------------------------------

\subsection*{NotoMono}

\showtt{NotoMono-TLF}

\begin{verbatim}
This sample was produced with the package option \texttt{scaled = 0.85}:

00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla
tellus metus odio non maecenas, \ldots.
\end{verbatim}

To scale the font, put something like this in your document preamble:
%
\begin{verbatim}
\usepackage[scaled = 0.8]{noto}
\end{verbatim}
%

\showvariants{NotoMono-TLF}

%%% --------------------------------------------------------------------

\subsection*{\TeX{} Gyre Cursor}

\showtt{qcr}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla tellus metus odio
non maecenas, pariatur vitae congue laoreet semper, nulla
adipiscing cursus neque dolor dui, faucibus aliquam quis.
0 1 5 8    O l S B
\end{verbatim}

\showvariants{qcr}

%%% --------------------------------------------------------------------

\subsection*{TXTT}

\showtt{txtt}

\begin{verbatim}
00000000011111111112222222222333333333344444444445555555555666666666677777777778
123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.

Lorem ipsum dolor sit amet, aenean nulla
tellus metus odio non maecenas, \ldots.
\end{verbatim}

\showvariants{txtt}

%%% ====================================================================

\section*{Scaling fonts}

A few fixed-width font families allow the font to be scaled
uniformly by a package declaration in the document preamble like
\texttt{\bs usepackage[scaled = 0.8]\{\it font-package-name\}},
as noted in earlier subsections.  That is helpful when
the default monospaced character height differs from that of the
prevailing prose font, which, except for \TeX's own font families of
\emph{Computer Modern} and \emph{Concrete}, and the commercial
\emph{Lucida} and \emph{MathTime} fonts, is likely to be of a
completely different design.

Regrettably, it does not seem to be possible to precisely control font
scaling within a single document with standard \LaTeX{} commands,
other than by selection of the usual \LaTeX{} size-changing commands:
\verb=\footnotesize=,
\verb=\tiny=,
\verb=\scriptsize=,
\verb=\small=,
\verb=\normalsize=,
\verb=\large=,
\verb=\Large=,
\verb=\LARGE=,
\verb=\huge=, and
\verb=\Huge=, and their corresponding environments like
\verb=\begin{footnotesize}= \ldots{} \verb=\end{footnotesize}=.

One can achieve arbitrary dynamic font sizing by descending to
low-level \TeX{} font commands, such as with the input
%
\begin{verbatim}
    {\font \dyntt = ul9r8t at  7pt \dyntt  7pt text},
    {\font \dyntt = ul9r8t at  8pt \dyntt  8pt text},
    {\font \dyntt = ul9r8t at  9pt \dyntt  9pt text},
    {\font \dyntt = ul9r8t at 10pt \dyntt 10pt text},
    {\font \dyntt = ul9r8t at 11pt \dyntt 11pt text}, and
    {\font \dyntt = ul9r8t at 12pt \dyntt 12pt text}
\end{verbatim}
%
that produces
{\font \dyntt = ul9r8t at  7pt \dyntt  7pt text},
{\font \dyntt = ul9r8t at  8pt \dyntt  8pt text},
{\font \dyntt = ul9r8t at  9pt \dyntt  9pt text},
{\font \dyntt = ul9r8t at 10pt \dyntt 10pt text},
{\font \dyntt = ul9r8t at 11pt \dyntt 11pt text}, and
{\font \dyntt = ul9r8t at 12pt \dyntt 12pt text}.

Proportional scaling is generally preferred to absolute font sizing,
because it behaves as expected when the overall document font size is
changed in the leading \verb=\documentclass= command.  You can scale
fonts proportionally with the input
%
\begin{verbatim}
    {\font \dyntt = ul9r8t scaled  700 \dyntt  70\%-scaled text},
    {\font \dyntt = ul9r8t scaled  800 \dyntt  80\%-scaled text},
    {\font \dyntt = ul9r8t scaled  900 \dyntt  90\%-scaled text},
    {\font \dyntt = ul9r8t scaled 1000 \dyntt 100\%-scaled text},
    {\font \dyntt = ul9r8t scaled 1100 \dyntt 110\%-scaled text},
    and
    {\font \dyntt = ul9r8t scaled 1200 \dyntt 120\%-scaled text}
\end{verbatim}
%
to produce
{\font \dyntt = ul9r8t scaled  700 \dyntt  70\%-scaled text},
{\font \dyntt = ul9r8t scaled  800 \dyntt  80\%-scaled text},
{\font \dyntt = ul9r8t scaled  900 \dyntt  90\%-scaled text},
{\font \dyntt = ul9r8t scaled 1000 \dyntt 100\%-scaled text},
{\font \dyntt = ul9r8t scaled 1100 \dyntt 110\%-scaled text},
and
{\font \dyntt = ul9r8t scaled 1200 \dyntt 120\%-scaled text}.

Clearly, such input is tedious to write, and hard to keep consistent
throughout a large document.  One solution is a private macro that is
defined in the document preamble, or better, a private style file:
%
\begin{verbatim}
\newcommand{\mytt}[2]
{% Usage: \mytt{scale-in-0-to-1}{text}
    {%
        \dimen0 = 1000sp
        \dimen0 = #1\dimen0
        \count0 = \dimen0
        \font \dyntt = ul9r8t scaled \count0
        \dyntt #2%
    }%
}
\end{verbatim}
It is later used with input
\begin{verbatim}
 \mytt{0.7}{ 70\%-scaled text},
 \mytt{0.8}{ 80\%-scaled text},
 \mytt{0.9}{ 90\%-scaled text},
 \mytt{1.0}{100\%-scaled text},
 \mytt{1.1}{110\%-scaled text}, and
 \mytt{1.2}{120\%-scaled text}
\end{verbatim}
%
to produce
\newcommand{\mytt}[2]
{% Usage: \mytt{scale-in-0-to-1}{text}
    {%
        \dimen0 = 1000sp
        \dimen0 = #1\dimen0
        \count0 = \dimen0
        \font \dyntt = ul9r8t scaled \count0
        \dyntt #2%
    }%
}
\mytt{0.7}{ 70\%-scaled text},
\mytt{0.8}{ 80\%-scaled text},
\mytt{0.9}{ 90\%-scaled text},
\mytt{1.0}{100\%-scaled text},
\mytt{1.1}{110\%-scaled text}, and
\mytt{1.2}{120\%-scaled text}.
%

Low-level font definitions with raw \TeX{} code are not affected by
standard \LaTeX{} size-changing commands: compare
%
\begin{verbatim}
{\tiny \texttt{tiny typewriter text}}
\end{verbatim}
%
to produce {\tiny \texttt{tiny typewriter text}} with
%
\begin{verbatim}
{\tiny \mytt{1.0}{tiny (whoops!)\ typewriter text}}
\end{verbatim}
%
to typeset {\tiny \mytt{1.0}{tiny (whoops!)\ typewriter text}}.

Despite our cautions about not conforming to \LaTeX{} size-changing
commands, in documents that need to show a lot of computer input and
output, our private macro is nevertheless a useful tool to squeeze
long verbatim lines into the document line width, without having to
introduce possibly confusing line wrapping.

%%% ====================================================================

\section*{Font color and style}

It is easy to get colored text into a document using
these preamble declarations
%
\begin{verbatim}
\usepackage[pdftex]{color}
\usepackage{rgb}
\end{verbatim}
%
to define a number of \LaTeX{} macros, and color names.

The \texttt{rgb} package is a Utah addition that provides
\LaTeX{} definitions of all of the named colors supplied
by the X11 Window System on desktop Unix(-like) systems.

You can see X11's roughly 800 color definitions in the
system-dependent files
\texttt{/usr/openwin/lib/X11/rgb.txt} and
\texttt{/usr/share/X11/rgb.txt}, or view them interactively in a
terminal window like this:
% From on a Sun Solaris SPARC system (CentOS 7 output differs radically in order)
\begin{verbatim}
% showrgb | less
199  21 133             medium violet red
176 196 222             light steel blue
102 139 139             paleturquoise4
159 121 238             mediumpurple2
...
 61  61  61             gray24
255 255 255             white
  0 205 205             cyan3
  0   0   0             black
\end{verbatim}

For use in \LaTeX{}, X11 color names are downcased, and embedded
spaces are removed, so the first output line corresponds to
the \LaTeX{} color \texttt{mediumvioletred}, which the \texttt{rgb}
package defines like this:
%
\begin{verbatim}
\definecolor{mediumvioletred}{rgb}{0.780,0.082,0.522}
    % #c71585 199 21 133 MediumVioletRed
\end{verbatim}
%
The sharp-prefixed value in the comment is the hexadecimal
equivalent that could be used in place of a named color
in a command-line color option, such as these equivalent
commands:
%
\begin{verbatim}
% xterm -bg 'medium violet red' -fg white     &
% xterm -bg '#c71585'           -fg '#ffffff' &
\end{verbatim}
%
Knowing the hexadecimal values makes it easy to produce families of
windows with slightly varying shades of color, such as these examples
that use three-character hexadecimal colors differing by one digit in
each primary color:
%
\begin{verbatim}
% xterm -bg '#4d8' &
% xterm -bg '#5e9' &
% xterm -bg '#6fa' &
\end{verbatim}

The X11 color names have varied over time, so if you find a color name
in \texttt{showrgb} output on your system that is not in the
\texttt{rgb} package, scale its integer red, green, and blue values
from the range [0,255] to the range [0,1] to provide a new definition
like this:
%
\begin{verbatim}
\definecolor{teal}{rgb}{0, 0.502, 0.502} % #008080 0 128 128 teal
\end{verbatim}
%
\definecolor{teal}{rgb}{0, 0.502, 0.502} % #008080 0 128 128 teal

As described in Appendix C.14.3 of the \emph{\LaTeX{} User Guide and
Reference Manual}, the \texttt{color} package provides macros
for coloring foreground and background of typeset material.
For example, \verb=\textcolor{red}{red text}= produces
\textcolor{red}{red text}, and
\verb=\textcolor{blue}{\bf bold blue text}= produces
\textcolor{blue}{\bf bold blue text}.

You can also supply background colors with
\begin{verbatim}
\colorbox{skyblue}{black on skyblue}
\end{verbatim}
to get
\colorbox{skyblue}{black on skyblue}, or
embellish that further with
\begin{verbatim}
\fcolorbox{red}{skyblue}{red-bordered black-on-skyblue text}
\end{verbatim}
to typeset
\fcolorbox{red}{skyblue}{red-bordered black-on-skyblue text}.

The text color inside the box can be changed as well, with input
\verb=\colorbox{teal}{\textcolor{yellow}{yellow on teal}}=
to typeset
\colorbox{teal}{\textcolor{yellow}{yellow on teal}}.

Boxing interferes with line breaking, because color boxes are
unbreakable horizontal material.  You need to use them judiciously,
and you may have to rewrite prose containing color boxes to help
\TeX{}'s line breaking.

However, what if you want to color all verbatim text?  You cannot
include such text as an argument to other macros, so you have to dig
into \LaTeX{} internal to find how the verbatim font is selected, and
then insert a suitable color command.  The standard file
\texttt{latex.ltx} that defines the core of \LaTeX{} contains the
one-line definition
%
\begin{verbatim}
\def\verbatim@font{\normalfont\ttfamily}
\end{verbatim}
%
that sets the font for the \texttt{verbatim} environment, as well as
for the \verb=\verb= macro.  Because it contains an at-sign, you need
to redefine it in a private style file, where such characters are
permitted in macro names.

Here is a reasonable set of definitions that allow you to dynamically
change the default \texttt{verbatim} font color and style:
%
\begin{verbatim}
%%% Internal macros
\def \verbatim@style {}     % default value
\def \verbatim@color {blue} % default value
\def \verbatim@font  {\normalfont \color{\verbatim@color}
                      \ttfamily \verbatim@style}
%%% Public macros for GLOBAL color and style changes:
\def \verbatimcolor #1{\def \verbatim@color {#1}}
\def \verbatimstyle #1{\def \verbatim@style {#1}}
\end{verbatim}

\makeatletter
%%% Internal macros
\def \verbatim@style {}     % default value
\def \verbatim@color {blue} % default value
\def \verbatim@font  {\normalfont \color{\verbatim@color}
                      \ttfamily \verbatim@style}
%%% Public macros for GLOBAL color and style changes:
\def \verbatimcolor #1{\def \verbatim@color {#1}}
\def \verbatimstyle #1{\def \verbatim@style {#1}}
\makeatother

\verbatimcolor{black}       % restore document default

You can then temporarily change colors inside a braced group with
%
\begin{verbatim}
{%
    \verbatimcolor{red}     \verb=red=,
    \verbatimcolor{blue}    \verb=blue=, and
    \verbatimcolor{hotpink} \verb=hotpink=
}
\end{verbatim}
%
to typeset
{%
    \verbatimcolor{red}     \verb=red=,
    \verbatimcolor{blue}    \verb=blue=, and
    \verbatimcolor{hotpink} \verb=hotpink=
    verbatim text.
}

You can also change styles, if the fixed-width font family permits,
with
%
\begin{verbatim}
{%
    \verbatimstyle{\bfseries} \verb=bold=,
    \verbatimstyle{\itshape}  \verb=italic=, and
    \verbatimstyle{\slshape}  \verb=slanted=
}
\end{verbatim}
%
to typeset
{%
    \verbatimstyle{\bfseries} \verb=bold=,
    \verbatimstyle{\itshape}  \verb=italic=, and
    \verbatimstyle{\slshape}  \verb=slanted=
    verbatim text.
}

Finally, you can combine color and style with input
%
\begin{verbatim}
{%
    \definecolor   {utahred} {rgb} {0.8, 0, 0}%
    \verbatimstyle {\bfseries \itshape}%
    \verbatimcolor {utahred}%
    \verb=Utah red bold italic=%
}
\end{verbatim}
%
to typeset
{%
    \definecolor   {utahred} {rgb} {0.8, 0, 0}%
    \verbatimstyle {\bfseries \itshape}%
    \verbatimcolor {utahred}%
    \verb=Utah red bold italic=%
}
verbatim text.

Dark colors on light backgrounds generally work best.

Remember that color reproduction fidelity varies across output
devices, and color perception by humans is often affected by culture,
and by retinal differences.  Notably, up to 6\% of human males have
difficulty distinguishing \textcolor{red}{red} and
\textcolor{green}{green}: both may resemble shades of
\textcolor{brown}{brown}.  If the three color names in the preceding
sentence look similar to you, then you may have a degree of red--green
perception difficulty.

Human color perception is also affected by viewing distance and
ambient lighting.  Prepare a lecture slide with black, blue, and red
text on a light background, and then view it from different places in
the classroom: you will likely find it hard to distinguish the text
colors at long distances, unless the font is large and bold.

%%% ====================================================================

\section*{Dangerous digits}

In most font designs, decimal digits have equal widths, and
thus, line up neatly in \LaTeX{} \texttt{array} and
\texttt{tabular} displays.  However, there \emph{are} fonts
where digits vary in width, and when that is the case,
numerical displays may look quite peculiar.  Pay attention
to that point if you explore the font world more widely than
we do in this document!

In font families that include a repertoire of mathematical
characters, the text and math digits are usually identical,
but that is not always the case.  When they are not, you
need to be particularly careful in marking your input. Here
is an example:
%
\begin{verbatim}
    A magician pulled $27$ rabbits out of a hat in 1933,
    which is mathematically interesting, because $27 = 3^3$.
\end{verbatim}
%
Digits that form a word, such as a calendar year, are
\emph{text} digits, whereas digits that count something are
better treated as \emph{math} digits.

The \emph{Chicago Manual of Style} (16th edition, 2010)
says on page~464 in its section \emph{Numerals versus
Words}:

\begin{quotation}
    \setlength{\parindent}{0pt}
    \noindent
    In nontechnical contents, Chicago advises spelling out
    whole numbers from zero through one hundred and certain
    round multiples of those numbers.\par

    \ldots{}

    Many publications, including those in scientific or
    journalistic contexts, follow the simple rule of
    spelling out only single-digit numbers and using
    numerals for all others.
\end{quotation}
%
Thus, the CMS recommends writing text like this:
%
\begin{verbatim}
    The Senator owns seventeen houses, three condos, and
    two forest cabins.
\end{verbatim}

There are exceptions, and it later suggests favoring
consistency over the rule when several numbers are used in
the same sentence, paragraph, or series of paragraphs:
%
\begin{verbatim}
    A 12th Century Italian farmer named Bonacci had 0 fish,
    1 dog, 1 rabbit, 2 cows, 3 cats, 5 goats, 8 sheep, and
    13 chickens.  His son later became quite famous for that
    peculiar number sequence.
\end{verbatim}
%
% Recognize the numbers from this sequence?:  1 1 2 3 5 8 13 21 34 55 89 144 233 377 ...

%%% ====================================================================

\section*{Confusing characters}

The character shapes for several European-language letters and digits
are subject to confusion, notably for the uppercase letters
\textbf{O}, \textbf{\O}, and \textbf{Q} and the digit \textbf{0}; the
letters lowercase \textbf{l}, uppercase \textbf{I}, and the digit
\textbf{1}; the digit \textbf{5} and uppercase \textbf{S}; and the
digit \textbf{8} and uppercase \textbf{B}.

\TeX{} does not even supply separate macros for Greek letters who
shapes are normally identical to corresponding Latin letters, such as
uppercase alpha, beta, epsilon, and omicron, and lowercase omicron.

Look carefully at the font samples earlier in this document to see how
well, or poorly, the fonts distinguish the problem glyphs.  Some
typewriter fonts have a right-leaning stroke through the
digit \textbf{0}, like \emph{Inconsolata}'s
{\renewcommand{\ttdefault}{zi4} \tt 0}, but that looks too much like
the penultimate letters of the Danish and Norwegian alphabets,
\textbf{\O} and \textbf{\o}.
The left-leaning stroke in the zero in the \emph{TXTT} fonts
{\renewcommand{\ttdefault}{ntxtt} \tt 0}, and the dotted-zero
{\renewcommand{\ttdefault}{fvm} \tt 0} of \emph{Bera Mono} and
\emph{DejaVu Sans Mono} remove the Scandinavian ambiguity.

The glyph shape distinctions may not matter much for a novel, where
context generally removes ambiguities. However, in scientific writing,
clear differences in character shapes are essential, and you need to
choose your prose, mathematical, and typewriter fonts carefully.

In mathematics text, you should probably never use the lowercase
letter \textbf{l}; instead, write \verb=\ell= for {\boldmath $\ell$}.
Similarly, avoid the letter \textbf{O} unless it is suitably
distinguished: in \TeX{} math mode and \LaTeX{} mathematical
environments, write
\verb={\cal O}(n)=     for {\boldmath ${\cal O}(n)$},
\verb=\mathcal{O}(n)=  for {\boldmath $\mathcal{O}(n)$},
\verb=\mathit{O}(n)=   for {\boldmath $\mathit{O}(n)$},
\verb=\mathsf{O}(n)=   for {\boldmath $\mathsf{O}(n)$}, or
\verb=\mathfrak{O}(n)= for {\boldmath $\mathfrak{O}(n)$}.

When such material appears repeatedly, encapsulate it in a private
macro that tells what it is, not what it looks like, with input
%
\begin{verbatim}
\newcommand {\Order} {\mathcal{O}}
...
\emph{\textbf{Warning}: Gaussian elimination on $ n \times n $
      matrices takes $\Order(n^3)$ operations.}
\end{verbatim}
%
to get
\newcommand {\Order} {\mathcal{O}}
\emph{\textbf{Warning}: Gaussian elimination on $ n \times n $
      matrices takes $\Order(n^3)$ operations.}
\end{document}
