Debian Codegraph @

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

raw
1 % !TEX TS-program = pdflatexmk
2 % Template file for TeXShop by Michael Sharpe, LPPL
3 \documentclass[]{article}
4 \usepackage[margin=1in]{geometry}
5 \usepackage[parfill]{parskip}% Begin paragraphs with an empty line rather than an indent
6 \usepackage{trace}
7 \usepackage{graphicx}
8 %\usepackage{amssymb}% don't use with newtxmath
9 %SetFonts
10 % libertine+newtxmath
11 \pdfmapfile{+NotoMath.map}
12 \usepackage[T1]{fontenc}
13 %\usepackage[scaled=1.1]{zlmtt}
14 %\usepackage[scaled=1.1]{newtxtt}
15 \usepackage[scaled=1.12]{nimbusmononarrow}
16 \usepackage[sfdefault,vvarbb]{notomath}
17 %\usepackage{noto-serif}
18 %\usepackage{noto-sans}
19 %\usepackage{noto-mono}
20 %\usepackage{textcomp}
21 %%\usepackage[varqu,varl]{zi4}% inconsolata
22 %%\usepackage{amsmath,amsthm}
23 %\usepackage[noto,vvarbb]{newtxmath}
24 % option vvarbb gives you stix blackboard bold
25 \usepackage{bm}
26 \usepackage{fonttable}
27 %SetFonts
28 \title{Notomath---LaTeX math support for the noto package}
29 \author{Michael Sharpe}
30 \date{\today} % Activate to display a given date or no date
31
32 \begin{document}
33 \maketitle
34 %\traceon$D$\traceoff
35
36 This package provides math support for the Google font collection {\tt Noto}, a massive text font whose \LaTeX\ support has been available for several years using Bob Tennent's {\tt noto} package. The math support is based on {\tt newtxmath} but there are some wrinkles that make it desirable to craft a small package, {\tt notomath}, that can serve as a front end to simplify the business of lining up the text and math options, given that there are considerable size discrepancies between text and math at their natural sizes.
37
38 For the {\tt noto} option to {\tt newtxmath}, the Roman and Greek alphabets in the latter were substituted by those in {\tt Noto} scaled down by $10$\% to an x-height of $482$, which is a close enough match to the symbols in {\tt newtxmath} for all practical purposes.
39 %The support is handled by means of an option to {\tt newtxmath}, which would not normally warrant a separate package, but there are some unusual wrinkles in this case that might go unnoticed otherwise.
40
41 %\makeatletter
42 %\show\NotoSans@scale
43 %\makeatother
44 The Noto fonts comprise three different faces: {\tt NotoSerif}, {\tt NotoSans} and {\tt NotoSansMono}. Each face has its own {\tt.sty} file: {\tt noto-serif.sty}, {\tt noto-sans.sty} and {\tt noto-mono.sty}. There is also an integrated {\tt.sty} file, {\tt noto.sty}, though it is a bit less configurable. Most of the time, it should not be necessary to load any of these packages explicitly, that task being relegated to the package {\tt notomath}.
45
46
47 \section*{Usage}
48 For most users, it will likely suffice to place some small variant of the following line in the preamble:
49 \begin{verbatim}
50 \usepackage{notomath}
51 \end{verbatim}
52 The effect of this is:
53 \begin{itemize}
54 \item
55 load {\tt noto-serif} and {\tt noto-sans} scaled down by the factor .9 to an x-height of 482;
56 \item set the main text font to NotoSerif and set \verb|\sfdefault| to
57 NotoSans;
58 \item the only weight used from the nine available weights are {\tt regular} and {\tt bold}, as these are the weights used in {\tt newtxmath} with options {\tt noto} and {\tt notosans};
59 \item load {\tt newtxmath} with option {noto} at natural scale.
60 \end{itemize}
61
62 Alternatively, the package may be loaded with options that modify the above behaviors:
63 \begin{itemize}
64 \item {\tt mono} loads, in addition, {\tt noto-mono} at the same x-height as the other Noto text packages.
65 \item
66 {\tt scale} (or {\tt scaled}) allows you to rescale all the Noto text packages and newtxmath by the specified factor.
67 \item the figure style for NotoSerif and NotoSans may be controlled by the options {\tt proportional} (or {\tt pf}) and {\tt oldstyle} (or {\tt osf}), as in the {\tt noto} package. (The default setting is tabular, lining figures.)
68 \item You may add as an option to {\tt notomath} any newtxmath option that is relevant to {\tt noto}---these are simply passed along to {\tt newtxmath}, if truly relevant. (E.g., option {\tt vvarbb} would be passed along, but not {\tt garamondx} because that would change all the math italic alphabets to match garamondx.)
69 \item {\tt sfdefault} changes the main text font to NotoSans, but leaves the meaning of \verb|\rmdefault| unchanged, so that \verb|\textrm{}| prints its argument using NotoSerif.
70
71 \end{itemize}
72
73 \section*{Usage Notes}
74 \begin{itemize}
75 \item
76 There are a couple of issues that might lead you to avoid NotoSansMono as your Typewriter font:
77 \begin{itemize}
78 \item
79 In {\tt OT1} encoding, the glyphs are not laid out as {\tt TEX TYPEWRITER TEXT}, as, for example, {\tt cmtt}. This means you will get incorrect output from text that involves quotes, backslash, braces and the like. (This is not a problem in other encodings such as {\tt T1}.)
80 \item The {\tt NotoSansMono} fonts have no {\tt visiblespace} glyph, so \verb|\verb*| will fail to to render the space as something like {\usefont{OT1}{cmtt}{m}{n}\char"20}. If this is important to you, replace {\tt noto-mono} with a package like {\tt inconsolata}, if you want to try another sans mono font. The loading order is important---you should load {\tt inconsolata} before loading {\tt notomath}.
81 \end{itemize}
82
83 \item
84 If you chose the {\tt sfdefault} option so that NotoSans is the main text font, you may find that a SansMono font if too similar to be easily distinguished from the main font, in which case you may wish to switch to a serifed mono font. If not loading NotoSansMono by means of the option {\tt mono}, you should load a replacement TT package BEFORE loading {\tt notomath} if you wish to be able to use the macro \verb|\mathtt| using glyphs that match those used for \verb|\texttt|. There are three reasonable options, and possibly more that I'm not aware of. Each would need to be scaled up a bit.
85 \begin{itemize}
86
87 \item The TT package {\tt zlmtt} does have a {\tt visiblespace} glyph and its {\tt OT1} encoding is in {\tt TEX TYPEWRITER TEXT} so \verb|\verb| and \verb|\texttt| function correctly even in {\tt OT1} encoding. I find the caps too tall to be a very good match.
88 \item The TT package {\tt newtxtt} does have a {\tt visiblespace} glyph
89 and works well in {\tt T1} encoding. There is no {\tt OT1} encoded version currently. Caps are a bit too tall to be a very good match.
90 \item The TT package {\tt nimbusmononarrow} does have a {\tt visiblespace} glyph and its {\tt OT1} encoding is in {\tt TEX TYPEWRITER TEXT} so \verb|\verb| and \verb|\texttt| function correctly even in {\tt OT1} encoding. Caps are not too tall---this is my preferred serifed TT with NotoSans text.
91 \end{itemize}
92
93 \item
94 \end{itemize}
95
96
97 \section*{Example preamble fragments}
98 \textsc{Example 1:}
99 \begin{verbatim}
100 \usepackage[mono,vvarbb,upint]{notomath}
101 % load NotoSerif, NotoSans, NotoSansMono, mainfont=NotoSerif
102 % options vvarbb and upint passed to newtxmath, resulting in
103 % STIX Blackboard Bold and upright integrals rather than slanted
104 \end{verbatim}
105 The Noto fonts will be scaled to x-height 482, matching math symbols. The main text font will be NotoSerif.
106
107 \textsc{Example 2:}
108 \begin{verbatim}
109 \usepackage[varq,varl]{inconsolata} % inconsolata sans mono
110 \usepackage[vvarbb,uprightscript]{notomath}
111 % load NotoSerif, NotoSans, mainfont=NotoSerif
112 % options vvarbb and uprightscript passed to newtxmath, resulting in
113 % STIX Blackboard Bold and upright script
114 \end{verbatim}
115 The Noto fonts will be scaled to x-height 482, matching math symbols. The main text font will be NotoSerif.
116
117 \textsc{Example 3:}
118 \begin{verbatim}
119 \usepackage[scaled=1.12]{nimbusmononarrow}% typewriter font
120 \usepackage[sfdefault,subscriptcorrection]{notomath}
121 % load NotoSerif, NotoSans, mainfont=NotoSans
122 % option subscriptcorrection passed to newtxmath
123 \end{verbatim}
124 will output the Noto fonts scaled to x-height 482 with matching math symbols. The main text font will be NotoSans.
125
126 \textsc{Example 4:}
127 \begin{verbatim}
128 \usepackage[scaled=1.24]{nimbusmononarrow}% typewriter font
129 \usepackage[scale=1.11,sfdefault,pf,osf]{notomath}
130 % load NotoSerif, NotoSans, mainfont=NotoSans
131 % option subscriptcorrection passed to newtxmath
132 \end{verbatim}
133 will output the Noto fonts scaled to x-height $536$ with matching math symbols. The main text font will be NotoSans with proportional oldstyle figures except in math, which always uses tabular lining figures.
134
135 The examples above all work with {\tt pdflatex}, and with {\tt xelatex} if some additional rules are followed. With {\tt xelatex}, the lines in the above examples must precede the loading of {\tt fontspec}, which must use the option {\tt nomath}. After that, one may load any text fonts required for secondary use, or even replace the main Noto fonts.
136 \section*{Subscript Correction}
137 The spacing of math letters was adjusted so the superscripts would not collide with the base letters. This was necessary mainly for letters like $j$, $f$, $y$ and $\beta$ as superscripts and like $D$ and $\Omega$ as base letters. As a result of these adjustments, some of the formerly problematic superscript letters become problematic subscript letters. Two files are provided to make adjustments to the letter by inserting appropriate kerns when that letter is the first character in a subscript---one for NotoSerif and one for NotoSans letters, under the respective names
138 \begin{verbatim}
139 newtx-noto-subs.tex % for NotoSerif
140 newtx-notosans-subs.tex
141 \end{verbatim}
142 The appropriate file is read in by {\tt newtxmath} provided you add the option {\tt subscriptcorrection}. A line in the file of the form \verb|{j}{-2}| will translate to a kern of {\tt -2mu} being placed before a leading $j$ in a subscript.
143
144 \section*{Lower level settings}
145 It may be that you wish to make use of lower level settings in the individual {\tt noto-} packages. In that case, the following information may be useful.
146
147
148
149
150 Recall from the README to the {\tt noto}:
151 \begin{itemize}
152 \item
153 \verb|\usepackage{noto}|
154 \begin{itemize}
155 \item loads NotoSerif as \verb|\rmdefault|;
156 \item loads NotoSans as \verb|\sfdefault|;
157 \item loads NotoSansMono as \verb|\ttdefault|;
158 \item lets \verb|\familydefault| to \verb|\rmdefault|;
159 \item so, main body text is NotoSerif, \verb|\textsf| points to NotoSans and \verb|\texttt| to NotoSansMono.
160 \item The {\tt scale} option does not affect NotoSerif size.
161 \end{itemize}
162 \item
163 \verb|\usepackage{noto-serif}|
164 \begin{itemize}
165 \item loads NotoSerif as \verb|\rmdefault|;
166 \item lets \verb|\familydefault| to \verb|\rmdefault|;
167 \item neither NotoSans nor NotoSansMono is loaded.
168 \item {\tt scale} option available.
169 \end{itemize}
170 \item
171 \verb|\usepackage{noto-sans}|
172 \begin{itemize}
173 \item loads NotoSans as \verb|\sfdefault|;
174 \item does not modify \verb|\familydefault|;
175 \item neither NotoSerif or NotoSansMono is loaded.
176 \item {\tt scale} option available.
177 \end{itemize}
178 \item
179 \verb|\usepackage[sfdefault]{noto-sans}|
180 \begin{itemize}
181 \item loads NotoSans as \verb|\sfdefault|;
182 \item lets \verb|\familydefault| to \verb|\sfdefault|
183 \item neither NotoSerif or NotoSansMono is loaded and NotoSans becomes the main text font.
184 \item {\tt scale} option available.
185 \end{itemize}
186 \item
187 \verb|\usepackage{noto-mono}|
188 \begin{itemize}
189 \item loads NotoSansMono as \verb|\ttdefault|;
190 \item neither NotoSerif or NotoSans is loaded.
191 \item {\tt scale} option available.
192 \end{itemize}
193 \end{itemize}
194
195 At its lowest level, you invoke NotoMath in {\tt newtxmath} using the option {\tt noto}, and NotoSansMath using the option {\tt notosans}.
196
197 \section*{Math samples}
198 \def\bE{\mathbf{E}}
199 \def\bB{\mathbf{B}}
200 \def\bJ{\mathbf{J}}
201
202 \def\bx{\mathbf{x}}
203 \def\by{\mathbf{y}}
204 \def\bv{\mathbf{v}}
205 \def\bp{\mathbf{p}}
206 \def\bxdot{\mathbf{\dot x}}
207 \def\bal{\boldsymbol{\alpha}}
208 \def\bphi{\boldsymbol{\varphi}}
209 \def\e{\varepsilon}
210 \textbf{An inversion formula:} Let $g:\mathbb{R}^+\to \mathbb{R}$
211 be bounded and right continuous, and let
212 $\varphi(\alpha)\coloneq\int_0^\infty e^{-\alpha t}g(t)\,dt$ denote its Laplace transform. Then, for every $t>0$,
213 \begin{equation}
214 g(t)=\lim_{\mathstrut\e\to 0}\lim_{\mathstrut\lambda\to\infty}\e^{-1}\sum_{\lambda t<k\le (\lambda+\e)t}
215 \frac{(-1)^k}{k!}\lambda^k\varphi ^{(k)}(\lambda).
216 \end{equation}
217
218 \textbf{Solutions of systems of ODEs:} Let $\bv(\bx,\bal)$ denote a parametrized vector field ($\bx\in U$, $\bal\in A$) where $U$ is a domain in $\mathbb{R}^n$ and the parameter space $A$ is a domain in $\mathbb{R}^m$. We assume that $\bv$ is $C^k$-differentiable as a function of~$(\bx,\bal)$, where~$k\ge 2$. Consider a system of differential equations in~$U$:
219 \begin{equation}
220 \bxdot=\bv(\bx,\bal),\qquad \bx\in U\label{eq:first}
221 \end{equation}
222 Fix an initial point $\bp_0$ in the interior of $U$, and assume $\bv(\bp_0,\bal_0)\neq\mathbf{0}$. Then, for sufficiently small $t$, $|\bp-\bp_0|$ and $|\bal-\bal_0|$, the system~(\ref{eq:first}) has a unique solution $\bx_{\bal}(t)$ satisfying the initial condition $\bx_{\bal}(0)=\bp$, and that solution depends differentiably (of class~$C^k$) on $t$, $\bp$ and $\bal$.
223
224 \textbf{Stirling's formula:}
225 \begin{equation}
226 \Gamma(z)\sim e^{-z}z^{z-1/2}\sqrt{2\pi}\bigg[1+\frac{1}{12z}+\frac{1}{288z^2}-\frac{139}{51840z^3}+\ldots\bigg],\quad z\to\infty \text{ in $|\arg z|<\pi$}.
227 \end{equation}
228
229 \textbf{B\'ezier curves:} Given $z_1$,
230 $z_2$,
231 $z_3$,
232 $z_4$ in $\mathbb{C}$, define the B\'ezier
233 curve with control points $z_1$, $z_2$, $z_3$, $z_4$ by
234 \[z(t)\coloneq(1-t)^3z_1+3(1-t)^2tz_2+3(1-t)t^2z_3+t^3z_4,\qquad 0\le t\le 1.\]
235 Because $(1-t)^3+3(1-t)^2t+3(1-t)t^2+t^3=(1-t+t)^3=1$
236 and all summands are positive for $0\le t\le1$, $z(t)$
237 is a convex combination of the four points~$z_k$, hence
238 the curve defined by $z(t)$ lies in their convex hull. As $t$ varies from~$0$ to~$1$, the curve moves from
239 $z_1$ to~$z_4$ with initial direction $z_2-z_1$ and final direction $z_4-z_3$.
240
241 \textbf{Maxwell's equations:}
242 \begin{equation*}
243 \begin{aligned}
244 \bB'&=-c\nabla\times\bE\\
245 \bE'&=c\nabla\times\bB-4\pi \bJ.
246 \end{aligned}
247 \end{equation*}
248
249 \textbf{Residue theorem:} Let $f$ be analytic in the region $G$ except for the isolated singularities $a_1$, $a_2$, \ldots, $a_m$. If $\gamma$ is a closed rectifiable curve in $G$ which does not pass through any of the points $a_k$ and if $\gamma\approx 0$ in $G$, then
250 \[\frac{1}{2\pi i}\int_\gamma f=\sum_{k=1}^m n(\gamma;a_k)\,\mathrm{Res}(f;a_k).\]
251
252 \textbf{Maximum modulus principle:} Let $G$ be a bounded open set in $\mathbb{C}$ and suppose that $f$ is a continuous function on $\bar G$ which is analytic in $G$. Then
253 \[\max \{|f(z)| : z\in \bar G\}=\max\{|f(z)| : z\in \partial G\}.\]
254
255 \textbf{Jacobi's identity:} Define the \emph{theta function} $\vartheta$ by
256 \[\vartheta(t)=\sum_{n=-\infty}^\infty \exp(-\pi n^2 t),\qquad t>0.\]
257 Then
258 \[\vartheta(t)=t^{-1/2}\vartheta(1/t).\]
259
260 The following three samples show the previous three reworked using NotoSerif and its associated math fonts.
261
262 \includegraphics{samplerSerif-crop.pdf}
263 \newpage
264 \section*{Font Tables}
265 \textsc{Sans Math Letters}
266 \fonttable{notosansmi}
267
268 \newpage
269
270 \textsc{Sans Math LettersA}
271 \fonttable{notosansmia}
272
273 \newpage
274 \textsc{Serif Math Letters}
275 \fonttable{notomi}
276
277 \newpage
278
279 \textsc{Serif Math LettersA}
280 \fonttable{notomia}
281 %\setbox0\hbox{\textrm{x}}
282 %\showthe\ht0
283 \end{document}