summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/newtxtt/newtxtt-doc.tex
blob: c4197ff8c505206fed9a097f6fa589a6fa68a42f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
\documentclass{article}
\usepackage[margin=1in]{geometry} 
\usepackage[parfill]{parskip}% Begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}% do not use with mtpro2 except lite version
%SetFonts
% fbb+newtxmath
\usepackage{XCharter}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[zerostyle=a]{newtxtt} % TX typewriter
\usepackage[libertine,bigdelims]{newtxmath}
\useosf
\font\fonta newtxtta
\font\fontb newtxttb
\font\fontc newtxttc
\font\fontd newtxttd
\renewcommand*{\sfdefault}{lmtt}
%\usepackage[supstfm=libertinesups,%
%  supscaled=1.2,%
%  raised=-.13em]{superiors}
%SetFonts
\title{Using {\tt newtxtt} to Access the TX Typewriter Fonts}
\author{Michael Sharpe}
\date{\today}  % Activate to display a given date or no date

\begin{document}
\maketitle
There is a relative paucity of free serifed typewriter fonts available in \LaTeX---{\tt courier} and (extensions of) {\tt cmtt} are the most common.  In my opinion, {\tt cmtt} and its enhancements, especially {\tt zlmtt}, 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$.) This package provides an interface to another alternative---the typewriter fonts provided with {\tt txfonts}, with some enhancements. They have the same widths as {\tt cmtt}, but are taller, heavier, more geometric and less shapely, with  very low contrast, and are more suited to match Roman fonts of height and weight approximating that of Times. This small package, loaded with
\begin{verbatim}
\usepackage{newtxtt} % options can be added
\end{verbatim}
provides access to 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 essentially {\tt txtt}, but with a different `zero'. In addition, the package  provides italic (slanted) and bold versions, plus small caps in regular (medium) and bold weights, upright shape only. It is offered  only in T$1$ (plus full TS$1$) encoding.

The options you may use in loading this package are:
\begin{itemize}
\item {\tt scaled=.97} will load the fonts scaled to $.97$ times natural size. This is useful with Roman fonts having an x-height smaller than Times, for which {\tt txtt} was designed.
\item
{\tt zerostyle} selects the form of {\tt `zero'} from one of four forms: {\tt a, b, c, d}, ({\tt a} being the default) which result respectively in\\[6pt] 
{\fonta 0} ---form {\tt a}, narrower than capital {\tt O};\\
{\fontb 0} ---form {\tt b}, original version from {\tt txtt};\\
{\fontc 0} ---form {\tt c}, slashed, narrower than capital {\tt O};\\
{\fontd 0} ---form {\tt d}, dotted, narrower than capital {\tt O}.\\ 
\end{itemize}


This document uses the following font settings:
\begin{verbatim}
\usepackage[osf]{XCharter} % osf in text, lining figures in math
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[zerostyle=a]{newtxtt} % TX typewriter
\usepackage[libertine,bigdelims]{newtxmath}
\end{verbatim}

Comparison with Latin Modern Typewriter:

\textsf{LM Typewriter: This is just a line to illustrate typewriter 0123456789.}\\
\texttt{TX Typewriter: This is just a line to illustrate typewriter 0123456789.}

\end{document}