summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/newtx/newtxdoc.tex
blob: 398526dbd83cb518355627ac0db4748769f5649a (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry} 
\usepackage[parfill]{parskip}% Begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
%SetFonts
% libertine text and newtxmath
\usepackage{libertine}
\usepackage[TS1,T1]{fontenc}
\usepackage{textcomp}
\usepackage[scaled=.85]{beramono}
\usepackage{amsmath,amsthm}
\usepackage[libertine]{newtxmath}
\usepackage[bb=boondox,frak=boondox,scr=rsfso]{mathalfa}
\usepackage{bm}
\renewcommand*{\rmdefault}{fxlj} %old-style figures in text, not math
\def\libertine{\fontfamily{fxlj}\selectfont}
%SetFonts
\title{New TX font package}
\author{Michael Sharpe}
\date{\today}  % Activate to display a given date or no date

\begin{document}
\maketitle
\section{Introduction}
The {\tt txfonts} package by Young Ryu has been available for over ten years but has been corrected very little since its introduction. It is meant to be a complete text and math package with roman text font provided by Times or a Times clone, sans serif based on a \textsf{Helvetica} clone, typewriter faces, plus math symbol fonts whose math italic letters are from a Times Italic clone. The additional glyphs, whether taken from free sources or designed by him, are generally of high quality, but the accompanying metrics are not, making the math inconsistently spaced, but so cramped that neighboring symbols  collide not infrequently.

The goal of this new project is use his glyphs along with a few additions and with completely reworked metrics which are generally looser, but not as loose as Computer Modern math, to make a math package that works with not only Times, but also with fonts that are intermediate in weight between Computer Modern and Times. The free font Linux Libertine is one particular target, as it is of nearly the same x-height as Computer Modern, but, not being a \emph{modern} font, it does not have a high contrast ratio, and so appears  denser than Computer Modern but not as much so as Times. It is meant as a replacement for Times, but  differs from it in many characteristics, more similar to MinionPro than Times, and provides a better range of variants than Times---three weights (regular, semi-bold and bold) rather than just two, and has expert features in all weights: old-style figures, more extensive and more interesting ligatures,  and  small caps. In my opinion, material typeset in Linux Libertine looks better than the corresponding material typeset in Times. This seems especially true on the screen.

As a rough measure of weight in math mode, the default line width in Computer Modern math is 40{\tt em}, in MathTime Pro 2, it is 46{\tt em}, and in txfonts, the value is 56{\tt em}. (The Times default line width as estimated from the thickness of each line segment is its = sign is 65{\tt em}. Unlike \textsf{txfonts}, Mathtime Pro 2 geometric glyphs are not of uniform thickness, so a comparison based on just this number is somewhat misleading.)

The new version makes the following changes:
\begin{itemize}
\item
the new package is split into separate text and math packages that do not need to be used in conjunction;
\item both text and math packages offer options not present in the original package, described below, including the option to use \textsf{libertine} Latin and Greek letters to replace \textsf{Times};
\item wide accent glyphs have been corrected (they should have zero depth) so that they no longer collide with the underlying glyph;
\item for those who do not like the integral in \textsf{txfonts}, an emboldened version of the Computer Modern integral is made available, matching the weight of the \textsf{txfonts} symbols;
\item an upright partial derivative symbol has been added, named \verb|\uppartial|;
\item there is now an option to get braces more pleasing to older eyes;
\item macros have been added to bring the calls to Greek symbols more into conformity with \textsc{psnfss} and Mathtime Pro~2;
\item problems using \textsc{ams} macro packages before \textsf{txfonts} are settled;
\item The problem with the {\tt ogonek} accent  and tabular environments (bad definition of \verb|\k|) is fixed;
\item The default encoding for \textsf{newtxtext} is now T$1$, but support is offered also for OT$1$ and LY$1$. As some add-on packages are available only in T$1$, that seems the best current choice.
\end{itemize}
\section{Text mode options}
The text mode environment invoked by
\begin{verbatim}
\usepackage{newtxtext}
\end{verbatim}
has two options: you may write
\begin{verbatim}
\usepackage[scaled=.93]{newtxtext}
\end{verbatim}
to load the roman and typewriter text fonts at 93\% of normal size, and the sans serif (\textsf{Helvetica} clone) at scale $0.9*0.93$. This is not of much utility if the package is used with the math package {\tt newtxmath} to which it is already matched, but may be with other math packages. The option \texttt{osf} instructs the text fonts to use old-style figures \oldstylenums{1234567890} rather than the default lining figures $1234567890$.
\section{Math mode options}
The package invoked by
\begin{verbatim}
\usepackage{newtxmath}
\end{verbatim}
loads the math part of the {\tt txfonts} (with revised metrics and additional glyphs) and should be loaded \emph{after} the text font and its encoding have been specified, as it uses the text font settings to define how operators, numbers, math accents, \verb|\mathrm|, \verb|\mathbf| etc.\ are rendered. You should also load a Typewriter font so as not to generate mysterious error messages about \textsf{metafont} trying to generate \texttt{ectt10}. The package offers a number of options.
\begin{itemize}
\item {\tt varg} causes the math italic letters \verb|g,v,w,y| to be replaced by versions which are more distinctive---eg, useful for distinguishing math italic \verb|v| from \verb|\nu|;
\item {\tt libertine} loads different versions of math italic and bold math italic based on \textsf{Libertine} rather than \textsf{Times}---the {\tt varg} option is disabled in this case, as the equivalent variant forms are made available by default;
\item the {\tt libertine} option also replaces both slanted and upright Greek  symbols by their Libertine glyphs;
\item
{\tt cmintegrals} instructs \textsf{newtxmath} to load a thicker version of the Computer Modern integral in place of the \textsf{newtxmath} default---the txfonts integral (identical to the integral in the Wolfram fonts), which is not to everyone's taste---a consequence is that none of the special forms of \textsf{txfonts} integrals are available;
\item the combination
\begin{verbatim}
\usepackage{amsmath}% loads amstext, amsbsy, amsopn but not amssymb
\usepackage{newtxmath}
\end{verbatim}
causes no error, unlike the same combination with {\tt txfonts}, but does nothing significant. (Recall that {\tt amsmath} is loaded automatically if you use an \textsc{ams} document class such as {\tt amsart} or {\tt amsbook}, as is {\tt amsthm}.) The integrals are as defined in {\tt txfonts}. On the other hand,
\begin{verbatim}
\usepackage{amsmath}
\usepackage[cmintegrals]{newtxmath}
\end{verbatim}
allows you to use the forms \verb|\iint|, \verb|\iiint|, \verb|\iiiint| and \verb|\idotsint| defined in {\tt amsmath}, but using the pumped-up Computer Modern integral loaded by {\tt newtxmath}. 
\item {\tt uprightGreek} and {\tt slantedGreek} determine the form of Greek alphabet loaded---the default is {\tt uprightGreek}, which loads upright uppercase and slanted lowercase Greek symbols, as is customary in Anglo-American mathematical typesetting. With the option {\tt slantedGreek}, which you might want to use if you cared about ISO standards, all Greek symbols are slanted. No matter which is set, \verb|\Gammaup| (or \verb|\upGamma|) gives you upright \verb|\Gamma|, etc.
\item The option {\tt cmbraces} instructs {\tt newtxmath} to ignore the brace collections from {\tt txfonts}, substituting a collection based on thickened versions of the Computer Modern braces, which I find much easier to distinguish from other delimiters. This works quite well in regular weight but looks a bit clunky in bold.
\item The \textsf{newtxmath} package, like the original \textsf{txfonts}, contains two different Blackboard Bold alphabets, the default, triggered by \verb|\mathbb{}|, takes its glyphs from the font which replaces {\tt msam} and has the same overall appearance of a hollowed-out text font, which I find neither bold not blackboard-like. The other option, triggered by \verb|\varmathbb{}|, is more geometric and, in my opinion, preferable. The option {\tt varbb} makes \verb|\mathbb{}| behave like \verb|\varmathbb{}|.
\item {\tt amssymbols} (the default) and {\tt noamssymbols} determine whether the {\tt txfonts} versions of the \textsc{ams} symbols ({\tt msam}, {\tt msbm}) are loaded---if so, they override previous settings in {\tt amsmath}. If you use the option {\tt noamssymbols}, then \verb|\mathbb{}| is set to mean the same as \verb|\varmathbb{}|. (One advantage of {\tt noamssymbols} is that you save two of your precious math families for other purposes, such as setting a couple of external math alphabets by means of the \textsf{mathalfa} package.)
\end{itemize}
\textsc{Example 1:}
\begin{verbatim}
\usepackage{newtxtext} % T1, lining figures so math uses lf
\usepackage{textcomp} % required for special glyphs
\usepackage{amsmath}
\usepackage[varg,cmintegrals,cmbraces]{newtxmath}
\usepackage{bm} % load after all math to give access to bold math
\renewcommand{\rmdefault}{ntxrj} %old-style figures in text, not in math
\end{verbatim}
\textsc{Example 2:}
\begin{verbatim}
\usepackage[nf]{libertine} % a bit lighter than Times--no osf in math
\usepackage[T1]{fontenc} %the only LaTeX encoding that works with libertine
\usepackage{textcomp} % required to get special symbols
\renewcommand{\bfdefault}{z} % libertine package uses z, not sb, for semibold
\usepackage[scaled=.85]{beramono}% a typewriter font must be defined
\usepackage{amsmath,amsthm}
\usepackage[libertine,cmintegrals,cmbraces]{newtxmath}
\usepackage[scr=rsfso]{mathalfa}
\usepackage{bm}% load after all math to give access to bold math
\renewcommand*{\rmdefault}{fxlj} %old-style figures in text, not math
\def\libertine{\fontfamily{fxlj}\selectfont}
\end{verbatim}

\textbf{Caution:} In encodings {\tt T1} and {\tt LY1}, the macro \verb|\mathrm| does not produce what you might expect for Greek letters, due to the difference between those encodings and {\tt OT1}. But what were you expecting with \verb|\mathrm{Gamma}| anyway? In {\tt T1} and {\tt LY1}, you'll get a math accent.
\section{Bold math fonts}\label{sec:boldmath}
Every math font in the {\tt txfonts} package, and in the {\tt newtx} package, is accompanied by a bold version. Some usage examples are given below. Generally, one may use either \verb|\boldmath| to change an entire formula to bold, or \verb|\boldsymbol| to change one symbol, but the spacing generally works better after loading the {\tt bm} package and using the \verb|\bm| macro.

The text glyphs dotlessi (\verb|\i|) and dotlessj (\verb|\j|) are rarely needed in actual text---in many fonts, roman dotlessi is very similar to the numeral 1. They are however sometimes needed to build special math glyphs. The following table shows how to generate the mathematical forms of dotlessi and dotlessj. I illustrate with only dotlessi---dotlessj is entirely analogous.

\begin{center}
  \begin{tabular}{@{} llll @{}}
    \hline
    Type & Weight & Command & Result \\ 
    \hline
    Math Italic & Regular & \verb|$\hat{\imath}$| & $\hat{\imath}$ \\ 
    Math Italic & Bold & \verb|$\bm{\hat{\imath}}$| & $\bm{\hat{\imath}}$ \\ 
    Roman & Regular & \verb|$\hat{\textrm{\i}}$| & $\hat{\textrm{\i}}$\\ 
    Roman & Bold & \verb|$\bm{\hat{\textbf{\i}}}$| & $\bm{\hat{\textbf{\i}}}$\\ 
    \hline
  \end{tabular}
\end{center}
\newcommand{\xyvec}[2]{\ensuremath{#1\bm{\textbf{\i}}#2\bm{\textbf{\j}}}}

In math, bold roman characters are often used to indicate vector quantities, and for this one uses constructions like 
\begin{itemize}
\item
\verb|$\mathbf{x}$| produces $\mathbf{x}$;
\item
\verb|$\bm{\mathrm{x}}$| produces $\bm{\mathrm{x}}$ (same as previous but may offer improved spacing);
\item
\verb|$\bm{x}$| produces $\bm{x}$ (not roman);
\item
\verb|$\bm{\hat{\mathbf{x}}}$| produces $\bm{\hat{\mathbf{x}}}$ (with a bold accent);
\item \verb|$\bm{\dot{x}}$| produces $\bm{\dot{x}}$ (bold but not roman);
\item the macro definition
\begin{verbatim}
\newcommand{\xyvec}[2]{\ensuremath{#1\bm{\textbf{\i}}#2\bm{\textbf{\j}}}}
\end{verbatim}
allows you to write \verb|\xyvec{x}{+y}| to output $\xyvec{x}{+y}$;
\item \verb|$\bm{\Gamma}$| produces $\bm{\Gamma}$ (bold Gamma);
\item \verb|$\bm{\hat{\Gamma}}$| produces $\bm{\hat{\Gamma}}$ (bold Gamma with bold accent).
\end{itemize}
(The last two assume that you have effectively set the option {\tt uprightGreek}---the default.)

\section{Samples from free Times and Libertine packages}
\textsc{TXFONTS:}\\
\begin{verbatim}
\usepackage{txfonts}
\end{verbatim}
\[\includegraphics{sample-tx-crop}\]
\begin{itemize}
\item
Complete match between text and math size and weight;
\item first formula much too cramped;
\item upper limit of integral much too close to integral sign;
\item square on $t$ in integrand comes very close to colliding with it.\end{itemize}

\vspace{1pc}
\textsc{NEWTXFONTS:}\\
\begin{verbatim}
\usepackage{newtxtext}
\usepackage{newtxmath}
\end{verbatim}
\[\includegraphics{sample-ntx-crop}\]
\begin{itemize}
\item
Complete match between text and math size and weight;
\item first formula much less cramped;
\item upper limit of integral not too close to integral sign;
\item square not too close to $t$ in exponent.
\end{itemize}

\vspace{1pc}
\textsc{MathTimePro2:}\\
\begin{verbatim}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}
\end{verbatim}
\[\includegraphics{sample-mtp-crop}\]
\begin{itemize}
\item
Complete match between text and math size and weight;
\item first formula quite spread out;
\item upper limit of integral not too close to integral sign;
\item plenty of space between square and $t$ in exponent.
\end{itemize}

\vspace{1pc}
\textsc{Libertine and MathTimePro2:}\\
\begin{verbatim}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[lite]{mtpro2}
\end{verbatim}
\[\includegraphics{sample-libmtp-crop}\]
\begin{itemize}
\item
Mismatch of weight between text and math;
\item first formula quite spread out;
\item upper limit of integral not too close to integral sign;
\item plenty of space between square and $t$ in exponent.
\end{itemize}

\vspace{1pc}
\textsc{Libertine and newtxmath:}\\
\begin{verbatim}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[libertine]{newtxmath}
\end{verbatim}
\[\includegraphics{sample-lib-crop}\]
\begin{itemize}
\item
Very good match between text and math in size and weight;
\item first formula not cramped;
\item upper limit of integral not too close to integral sign;
\item space between square and $t$ in exponent.
\end{itemize}

\vspace{1pc}
\textsc{Mathptmx:}\\
\begin{verbatim}
\usepackage{mathptmx}
\end{verbatim}
\[\includegraphics{sample-ptmx-crop}\]
\begin{itemize}
\item
Good match between text and math size and weight, though the summation symbol (from the system {\tt symbol} font) is too small and too dark;
\item first formula well spread;
\item upper limit of integral not too close to integral sign;
\item space between square and $t$ in exponent;
\item there are no upright Greek lowercase letters in this package;
\item the package lacks a number of amenities that are present in other packages.
\end{itemize}
\section{Items installed} As well as a collection of PostScript fonts, virtual fonts, font definition files and the central {\tt newtxtext.sty} and {\tt newtxmath.sty} files, the package contains one map file {\tt ntx.map} that must be enabled for the package to function correctly. 

%It is the glue that allows. The two {\tt fxl*.pfb} files to which they refer are part of the Libertine-Legacy collection that is part of \TeX\ Live. The map file {\tt libertine.map} must not have been disabled. The other {\tt.pfb} files are either part of the \textsf{txfonts} or are fonts derived from them or from the \textsf{Computer Modern} fonts in some manner.
%\begin{verbatim}
%ntxexmods NTXEXMODS <ntxexmods.pfb
%ntxbexmods NTXBEXMODS <ntxbexmods.pfb
%ntxexb NTXEXB <ntxexb.pfb
%ntxbexb NTXBEXB <ntxbexb.pfb
%rtxmio rtxmi " -.167 SlantFont " <rtxmi.pfb
%rtxbmio rtxbmi " -.167 SlantFont " <rtxbmi.pfb
%rfxlri-alt LinLibertineI " LibertineAltEncoding ReEncodeFont " 
% <[libertinealt.enc <fxlri.pfb
%rfxlbi-alt LinLibertineBI " LibertineAltEncoding ReEncodeFont " 
% <[libertinealt.enc <fxlbi.pfb
%\end{verbatim}
The font files {\tt ntxexmods.pfb} and {\tt ntxbexmods.pfb} were derived from {\tt cmex10.pfb} by FontForgery, thickening the Computer Modern braces to match the weight of the \textsf{txfonts} braces. The pair {\tt ntxexb.pfb} and {ntxbexb.pfb} were similarly derived from {\tt cmsy7.pfb} and {\tt cmex10.pfb} to produce more braces and matching integral signs based on Computer Modern. The {\tt.tfm} files {rtx[b]mio.tfm} are simply unslanted versions of {\tt rtxmi}, from which we construct upright partial derivative symbols.
The last two entries provide us with a way to access custom-encoded versions of {\tt fxlri.pfb} and {\tt fxlbi.map} in order to access to some of the unencoded alternate glyphs---eg, Greek letters, {\tt J.alt} and {\tt v.alt}. 

This version contains optical versions of the math italic and symbol fonts at 7\texttt{pt} and 5\texttt{pt}, allowing better rendering in \verb|\scriptstyle| and \verb|\scriptscriptstyle|. 

\end{document}