Debian Codegraph @

texmf-dist/doc/fonts/zlmtt/zlmtt-doc.tex

raw
1 \documentclass[11pt]{article}
2 \usepackage[margin=1in]{geometry}
3 \usepackage[parfill]{parskip}% Begin paragraphs with an empty line rather than an indent
4 \usepackage{graphicx}
5 \usepackage{amssymb}% do not use with mtpro2 except lite version
6 %SetFonts
7 % fbb+newtxmath
8 \usepackage[lining]{etbb}
9 \usepackage[T1]{fontenc}
10 %\usepackage{textcomp}
11 \usepackage[scaled=1.07]{zlmtt} % lmodern typewriter
12 \usepackage{amsmath,amsthm}
13 \usepackage[libertine]{newtxmath}
14 \useosf
15 \linespread{1.05}
16 %\usepackage[supstfm=libertinesups,%
17 % supscaled=1.2,%
18 % raised=-.13em]{superiors}
19 %SetFonts
20 \title{Using {\tt zlmtt} to Access the Latin Modern Typewriter Fonts}
21 \author{Michael Sharpe}
22 \date{\today} % Activate to display a given date or no date
23
24 \begin{document}
25 \maketitle
26 Two serifed typewriter fonts are in common use in \LaTeX---{\tt courier} and (extensions of) {\tt cmtt}. (Many now prefer the sans serif monowidth fonts BeraSansMono or Inconsolata, though their appearance is less reminiscent of typewritten output.) The recently released STIX fonts have a typewriter alphabet that seems to be a slight variant of {\tt cmtt}, with height to match Times and thinner vertical stems, in only medium series. In my opinion, {\tt cmtt} and its enhancements are a much better choice than {\tt courier} in almost every circumstance, as the latter is so light and so wide that it looks poor on screen and causes endless problems with overfull boxes. (The ratio of their glyph widths is $723/525\approx1.38$.) The GUST extension of Computer Modern contains a very substantial enhancement of {\tt cmtt} called {\tt lmtt} (Latin Modern Typewriter). This small package, loaded with
27 \begin{verbatim}
28 \usepackage{zlmtt} % options may be added
29 \end{verbatim}
30 provides access to all its features, no matter what other text fonts you might be using. It should be placed after all your other text font loading packages that might contain instructions to change \verb|\ttdefault|, and before loading math packages so that the math packages can make a suitable definition of \verb|\mathtt|. With no options specified, as above, you'll get full functionality as a monospaced typewriter font family, with typewriter text rendered using {\tt lmtt}, and with italic and bold versions, plus small caps in regular (medium) weight only.
31
32 First, here's a quick review of what the Latin Modern Typewriter fonts offer. (The typewriter letters in parentheses, like ({\tt m}), denote the abbreviations for the font series used in the {\tt.fd} files.)
33 \begin{itemize}
34 \item
35 Three weights---light ({\tt l}), medium ({\tt m}) and bold ({\tt b}). (Bold is only slightly so, with stems less than $20$\% thicker than in medium weight, so that glyph widths can be the same as in medium weight.)
36 \item Light weight has a {\tt \fontseries{lc}\selectfont condensed variant} ({\tt lc}).
37 \item Medium weight has a {\tt \textsc{Small Caps}} variant ({\tt sc}) in upright shape only.
38 \item Each weight has a \proptt{proportionally spaced variant} (i.e., not monospaced) with fewer features.
39 \item Each weight has an {\tt \fontshape{it}\selectfont italic style} in addition to the default upright style. This style is not simply a slanted version of the upright style except in the proportionally spaced variant.
40 \item Support is provided for the following encodings: T$1$, TS$1$, LY$1$, OT$1$, IL$2$, L$7$x, OT$4$, QX, T$5$.
41 \end{itemize}
42 \newpage
43 The options you may use in loading this package are:
44 \begin{itemize}
45 \item {\tt scaled=1.05} (or {\tt scale=1.05}) will load the fonts scaled to $1.05$ times natural size. This is useful with Roman fonts having an x-height greater than Computer Modern.
46 \item
47 {\tt proportional} (or just {\tt p}) loads the proportionally spaced version of the fonts. (By default, typewriter text is {\tt monospaced}.)
48 \item The defaults for \verb|\mdseries| and \verb|\bfseries|, which determine the series used to render medium and bold, are ({\tt m}) and ({\tt b}). You may change these defaults without affecting the settings for Roman and Sans Serif fonts as follows:
49 \begin{itemize}
50 \item
51 {\tt light} (or just {\tt l}) makes \verb|\mdseries| render using ({\tt l}).
52 \item
53 {\tt lightcondensed} (or just {\tt lc}) makes \verb|\mdseries| render using ({\tt lc}).
54 \item
55 {\tt med} (or just {\tt m}) makes \verb|\bfseries| render using ({\tt m}).
56 \end{itemize}
57 \end{itemize}
58 (The non-defaults weights are not available unless the package detects the code from the {\tt mweights} package is loaded. AS of LaTeX 2020-02-02 or newer, its code is built into the kernel. Those using prior versions of LaTeX will have to rely on the continuing presence of the actual {\tt mweights} package.)
59 %Note that the weight options depend on the {\tt mweights} package which was introduced in July $2013$.
60
61 The package defines two macros, \verb|\proptt| and \verb|\monott| that allow you to use proportional typewriter mode or monospace typewriter mode whether or not you selected the {\tt proportional} option. This document uses {\tt monospace} mode, but I can write \verb|\proptt{proportional spacing}| and get \proptt{proportional spacing}, or \verb|\textit{\proptt{proportionally spaced slanted}}| to get \textit{\proptt{proportionally spaced slanted}}. The macro \verb|\lctt| prints its argument in light-condensed weight, monospaced mode, and uses a slanted font if italic shape is in force. E.g., \verb|\lctt{light condensed}| produces \lctt{light condensed}, and \verb|\textit{\lctt{light condensed italic}}| produces \textit{\lctt{light condensed italic}}.
62
63 As of version {\tt 1.02}, \verb|\proptt| and \verb|\monott| do not switch to medium weight if in your preamble you specified that regular means light.
64
65 This package supports all the encodings supported by the {\tt lmodern} package.
66
67 {\bf Examples}
68 \begin{verbatim}
69 \usepackage[scaled=1.1,lc]{zlmtt} % scale up 10\%, medium->light condensed
70 \usepackage[scaled=1.1,p]{zlmtt} % scale up 10\%, proportional tt mode
71 \end{verbatim}
72 This document used the following font settings:
73 \begin{verbatim}
74 \usepackage[lining]{etbb} % Tufte Bembo, lining figures in math mode
75 \usepackage[T1]{fontenc}
76 %\usepackage{textcomp}
77 \usepackage[scaled=1.07]{zlmtt} % lmodern typewriter
78 \usepackage{amsmath,amsthm}
79 \usepackage[libertine]{newtxmath}
80 \useosf % oldstyle figures in text mode
81 \linespread{1.05} % etbb has tall ascenders
82 \end{verbatim}
83
84 \end{document}