Debian Codegraph @

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

raw
1 % !TEX TS-program = lualatex
2 \documentclass[11pt]{article}
3 %\pdfcompresslevel=0
4 %\pdfgentounicode=1
5 %\input glyphtounicode.tex
6 %\InputIfFileExists{glyphtounicode-cmr.tex}{}{}
7 %\InputIfFileExists{glyphtounicode-ntx.tex}{}{}
8 %\usepackage[a-1b]{pdfx} % version 1.6.4 or higher
9 \usepackage{trace}
10 \usepackage[margin=1in]{geometry}
11 \usepackage[parfill]{parskip}
12 \usepackage{graphicx,xcolor}
13 \ifluatex\else%
14 \ifxetex\pdfmapfile{+XCharter.map}\pdfmapfile{+newtx.map}%
15 \else
16 \pdfmapfile{=XCharter.map}\pdfmapfile{=newtx.map}%
17 \fi\fi
18 \usepackage[scaled=1.03,varqu,varl]{inconsolata}
19 \usepackage[type1]{sourcesanspro}
20
21 \usepackage[OT2,T2A,T1]{fontenc}
22
23 %\traceon
24 \usepackage[xcharter,osf,p,mathscale=1.05,textscale=0,uprightscript,vvarbb]{newtx}
25 %\usepackage[scaled=.98,osf,otfmath]{XCharter}
26 \iftutex\setmonofont{lmmono10-regular.otf}[Scale=1.08]\fi
27 %\linespread{1.04}
28 %\usepackage[uprightscript,vvarbb,scaled=1.05]{newtxmath}
29 %\usepackage[cal=boondoxo]{mathalfa}
30 \makeatother
31 \iftutex
32 \newfontface\georgia{Georgia}[Extension = .ttf, Path = ./, Scale=.99]
33 \newfontface\gelasio{Gelasio-Regular}[Extension = .otf, Path = ./, Scale=.99]
34 \newfontface\osffnt{XCharter-Roman}[Numbers={Proportional,OldStyle}, CharacterVariant={1:0}]% , Scale = \XCharter@scale]
35 \newfontface\osfIfnt{XCharter-Roman}[Numbers={Proportional,OldStyle}]%, Scale = \XCharter@scale]
36 \else
37 \font\osfIfnt=XCharter-Roman-osf-t1 at 11pt
38 \font\osffnt=XCharter1-Roman-osf-t1 at 11pt
39 \fi
40 \makeatletter
41 \usepackage{fonttable}
42 \usepackage{booktabs}
43 \usepackage{url}
44 \def\Sha{{\usefont{OT2}{XCharter-TLF}{m}{n}\char88 }}
45 \newcommand\cyrtext{\fontfamily{XCharter-TLF}\fontencoding{OT2}\selectfont} % declaration
46 \DeclareTextFontCommand{\textcyr}{\cyrtext} %macro with argument
47 %\usepackage[cal=rsfso]{mathalfa}
48 %\usepackage{bm}% load after all math to give access to bold math
49 \title{The XCharter Font Package}
50 \author{Michael Sharpe}
51 %\date{}
52 \begin{document}
53 %%\traceon
54 %{\addfontfeatures{RawFeature=+lnum;+tnum}0123456789}\\
55 %{\addfontfeatures{RawFeature=+lnum;+pnum}0123456789}\\
56 %{\addfontfeatures{RawFeature=+tnum}0123456789}\\
57 %0123456789\\
58 %{\addfontfeatures{Numbers={Lining,Tabular}}0123456789}\\
59 %{\addfontfeatures{Numbers={Lining,Proportional}}0123456789}\\
60 %{\addfontfeatures{Numbers={OldStyle,Monospaced}}0123456789}\\
61 %%\traceoff
62 %\end{document}
63 \maketitle
64 %\expandafter\show\csname oldstylenums \endcsname
65 %\traceon\oldstylenums{1}\traceoff
66 \section{Package Features}
67 The \emph{XCharter} fonts are extensions of the Bitstream Charter fonts, adding oldstyle figures, superior figures and small caps in all styles. The original Charter fonts were created by famed font designer Matthew Carter in the late 1980's to enhance legibility of the output from printers of that era (laser, dot matrix, thermal and inkjet) with resolutions that would now be considered low---not far from modern screen resolutions. Their low contrasts, high x-heights and use of piecewise linear outlines where possible may make them interesting again as fonts that will render well on small devices and perhaps projected slides.
68
69 It's worth noting that the same designer provided Georgia for Microsoft. It is widely considered to be one of the clearest serifed fonts for viewing on screen, and bears many similarities to Charter, though with rounder finials, flatter serifs and curvier transitions. Their x-heights are the same for all practical purposes but Georgia has Cap-height and Ascender-height about 2\% more than Charter.
70
71 {\georgia (This paragraph is processed using Georgia reduced by 1\%.) The vertical stem widths of Georgia are about 10\% thicker than those of Charter and Georgia has distinctly greater contrast. As you can see, it appears to render blacker. and occupies about 3\% less horizontal space than Charter.}
72
73 {\gelasio (This paragraph is processed using Gelasio-Regular reduced by 1\%. Gelasio is a free, open source font that is metrically equivalent to Georgia. Like Georgia, it has no small caps, but work is in progress to add these via virtual fonts based on XCharter, and to add math fonts based on {\tt newtx}.)}
74
75 As of version 1.09 (2017-06-25) there is a new collection of Cyrillic glyphs in \emph{XCharter}, copied from Andrey Panov's \emph{Khartiya}, an extension of the free Charter fonts, with small caps included. Some new figure styles were also copied from \emph{Khartiya}---inferiors, numerators and denominators. Along with these additions, there are now slanted versions for those who wish to have both slanted and italic text available to meet distinct semantic purposes. Note that figures and uppercase slanted and italic are almost identical (except for slanted \textsl{Q} and italic \textit{Q}) but lower-case forms are distinct.
76
77 Starting with version 1.1, support has been added for typesetting in the Serbian variant of Cyrillic, with some changes to the Italic and BoldItalic Cyrillic glyphs and a new option in the main package. These are described more fully below.
78
79 Support files are provided for T$1$, TS$1$, LY$1$, T$2$A and OT$2$ encodings, the last two being to support the Cyrillic component of \emph{XCharter}. The package has a number of options:
80 \begin{itemize}
81 \item
82 {\tt scaled=.98}, for example, scales all text to 98\% of specified size;
83 \item {\tt lining} (or just {\tt lf}) makes lining figures ($0123456789$) the default for text---this is set automatically and does not need to be entered explicitly;
84 \item {\tt oldstyle} (or {\tt osf}) sets the figure style in text mode to oldstyle ({\osffnt 0123456789}) with numeral one like a shortened $1$, but math mode will always use lining figures;
85 \item {\tt proportional} (or {\tt p}), new as of version 1.23, changes the default tabular figure style to proportional.
86 \item {\tt oldstyleI} (or {\tt osfI}) sets the figure style in text mode to oldstyle ({\osfIfnt0123456789}) with numeral one like a shortened I, but math mode will always use lining figures;
87 \item {\tt sups} sets the style for superscript figures (e.g., footnote markers) to XCharter's superior figures rather than using the default text inserts in mathematical superscripts. This option has no effect if a KOMA class is in force.
88 \item {\tt scosf} makes oldstyle figures the default in small cap text, no matter what the global figure setting may be.
89 \item {\tt serbianc} is useful only with the T$2$A encoding. It modifies
90 one slot in upright and slanted shapes and five slots in italic shapes, as expected in Serbian Cyrillic. See the last section for examples.
91 \end{itemize}
92 \subsection*{Changes in version 1.23}
93 There are some substantial additions in version 1.23, some requiring {\tt newtx}, version 1.71 or higher:
94 \begin{itemize}
95 \item
96 {\tt XCharter.sty} now works with all flavors of LaTeX---unicode and non-unicode---but there may be some small differences in output. Essentially all previous options and macros are supported and there are new ones available, some of which are limited to unicode engines.
97 \item Previous versions of {\tt XCharter} had only two normal figure styles: {\tt tabular lining} (the default) and {\tt proportional oldstyle}. Version 1.23 adds two more so there are separate {\tt TLF (tabular lining figures)}, {\tt LF (proportional lining figures)}, {\tt TOsF (tabular oldstyle figures)} and {\tt OsF (proportional oldstyle figures)}. Two new options have been added to globally select the default figures style. Option {\tt p} (or {\tt proportional}) and {\tt t} (or {\tt tabular}). A new command \verb|\useproportional| (preamble only) has the same effect as option {\tt proportional}.
98 \item With the new figures came new macros to select them, no matter what the defaults may be. There are two forms, one that switches the figures until further notice and the other a macro with an argument.
99 \begin{center}
100 \begin{tabular}{@{} cccc @{}}
101 \toprule
102 Switch& Command & Effect & Example \\
103 \midrule
104 \verb|\tlfstyle| &\verb|\texttlf| & TLF & \verb|{\tlfstyle123}, \texttlf{123}| \\
105 \verb|\lfstyle| &\verb|\textlf| & LF & \verb|{\lfstyle123},\textlf{123}| \\
106 \verb|\tosfstyle| &\verb|\texttosf| & TOsF & \verb|{\tosfstyle123},\texttosf{123}| \\
107 \verb|\osfstyle| &\verb|\textosf| & OsF & \verb|{\osfstyle123}, \textosf{123}| \\
108 \bottomrule
109 \end{tabular}
110 \end{center}
111 There are also the text font switches \verb|\liningnums|, \verb|\tabularnums|, \verb|\oldstylenums| and \verb|\proportionalnums|, each of which changes only one attribute of the figure style and alignment. For example, \verb|\liningnums| changes the style to {\tt lining} and \verb|\tabularnums| changes the figure alignment to {\tt tabular}.
112 \item
113 There is a theorem font option similar to those in newtx and newpx. A new font family named {\tt XCharterTH} is made from the italic and bold italic faces of {\tt XCharter}, but having upright figures and punctuation that, IMO, look better than slanted ones in theorem statements and the like. For details, consult the brief descriptions below and the more discursive version in the documentation to {\tt newtx}. There is a {\tt theoremfont} option to {\tt XCharter} that works exactly the same as in {\tt newtx}.
114 \item The figure style in {\tt theoremfont} will by default be the same as your chosen figure style. Option {\tt thmlining} will ensure that lining figures are always used.
115 \item {\tt oldSS} specifies the preference for the old Capital Sharp S rather than the newer form, {\tt U+1E9E}\iftutex, \SS\fi.
116 \item There are new options that affect only unicode engines:
117 \begin{itemize}
118 %\item
119 %{\tt nofontspec} prevents {\tt XCharter.sty} from loading {\tt fontspec}.
120 \item {\tt type1text} (or {\tt type1}) specifies processing the text font using {\tt type1} mode. This does not prevent {\tt fontspec} from loading.
121 \item {\tt defaultfeatures=} gives you a place to set the default text font features for {\tt fontspec}.
122 \end{itemize}
123 \end{itemize}
124
125
126
127 \textsc{Special Macros:}
128 \begin{itemize}
129 \item \verb|\useproportional| (usable only in the preamble) may be used for changing the text figure alignment to {\tt proportional} though math mode will use tabular lining figures. (New in 1.23.)
130 \item
131 \verb|\useosf| (usable only in the preamble) may be used for changing the text figure style to {\tt osf} though math mode will use lining figures.
132 \item \verb|\useosfI| (usable only in the preamble) may be used for changing the text figure style to {\tt osfI} though math mode will use lining figures.
133 \item \verb|\textsu| prints its argument in superior figures, e.g., \verb|\textsu{12}| results in \textsu{12}. The effect is the same with \verb|{\sustyle 12}|.
134 \item \verb|\textinf| prints its argument in inferior figures, e.g., \verb|\textinf{12}| results in \textinf{12}. The effect is the same with \verb|{\instyle 12}|. (In versions of {\tt XCharter} prior to $1.221$, \verb|\textinf| was named \verb|\textin|, but the latter conflicts with {\tt hyperref} which redefines it to point to U+2208.)
135 \item \verb|\textlf| prints its argument in lining figures, e.g., \verb|\textlf{12}| results in \textlf{12}. The effect is the same with \verb|{\lfstyle 12}|.
136 \item \verb|{\osfstyle 23}| prints \textosf{23} ({\tt OldStyle,Proportional}) while \verb|{\liningnums 23}| prints {\liningnums 23}, {\tt Lining} with whatever figure alignment is in force. There are also macros \verb|\tabularnums|, \verb|\proportionalnums|, \verb|\oldstylenums|, \verb|\tosfstyle| and \verb|\tlfstyle| with the expected behaviors.
137 %\item \verb|\textosf| prints its argument in oldstyle figures using, in effect, the {\tt osf} option---e.g., \verb|\textosf{12}| results in \textosf{12}.
138 %\item \verb|\textosfI| prints its argument in oldstyle figures using, in effect, the {\tt osfI} option---e.g., \verb|\textosfI{12}| results in \textosfI{12}.
139 \item Numerators and denominators are normally used only for constructing fractions, but may if needed be called using \verb|\textnumerator| and \verb|\textdenominator|. They are about 7\% smaller than superiors and inferiors. You may use \verb|\textde| and \verb|\textnu| as abbreviations, though the latter will not be available if {\tt babel} is loaded with {\tt greek} option. As of version 1.24, you may prevent \verb|\textnu| from overwriting the babel/greek definition by using the new option {\tt notextnu} to {\tt XCharter}. In any case, a new command \verb|\textnum| takes the place of the old {\tt XCharter} \verb|\textnu|.
140 \item The \verb|\textfrac| macro allows you to write, e.g., \verb|\textfrac{31}{32}| to get the simple fraction \textfrac{31}{32}, and \verb|\textfrac[2]{31}{32}| to get \textfrac[2]{31}{32}. (The optional argument, $2$ in the latter case, is always typeset in lining figures.)
141 \item The \verb|\textsfrac| macro, available only when you use the {\tt newtx} package with option {\tt xcharter} to load {\tt XCharter} with {\tt newtxmath}, allows you to write, e.g., \verb|\textsfrac{31}{32}| to get the simple stacked fraction
142 \iftutex
143 \textsfrac{31}{32},\fi
144 and \verb|\textsfrac[2]{31}{32}|
145 \iftutex
146 to get \textsfrac[2]{31}{32}\fi%
147 . (The optional argument, $2$ in the latter case, is always typeset in lining figures.)
148
149 \item \verb|\textcircled| renders its argument in raised and reduced small caps encircled by the {\tt bigcircle} glyph. E.g., \verb|\textcircled{M}| and \verb|\textcircled{m}| both render as \textcircled{M}. The macro works also for numerals: \verb|\textcircled{2}| renders as \textcircled{2}.
150 \item \verb|\textth| (and also \verb|\textthit|) render their arguments using the theorem fonts. For example:\\
151 \verb|\textth{Theorem font (01234):!}| renders as \textth{Theorem font (01234):!}---note the upright figures and punctuation. (There is no Bold theorem font---if you attempt it using the specification \verb|\textbf{\textth{Theorem font (01234):!}}|, you will find that it renders as \textbf{\textth{Theorem font (01234):!}}.) The related font switch \verb|\thfamily| is defined so that \verb|{\thfamily A12!}| and \verb|\textth{A12!}| are equivalent. In opentype processing, the {\tt StylisticSet 05} controls whether figures and punctuation are upright in italic shaped faces.
152
153 \end{itemize}
154
155 \def\testupgreek{%
156 \test\Gamma \test\Delta
157 \test\Theta \test\Lambda \test\Xi \test\Pi \test\Sigma
158 \test\Upsilon \test\Phi \test\Psi \test\Omega }
159
160 \def\testupgreekit{%
161 \test\Gammait \test\Deltait
162 \test\Thetait \test\Lambdait \test\Xiit \test\Piit \test\Sigmait
163 \test\Upsilonit \test\Phiit \test\Psiit \test\Omegait }
164 \def\testlowgreeki{%
165 \test\alpha \test\beta \test\gamma \test\delta \test\epsilon
166 \test\zeta \test\eta \test\theta \test\iota \test\kappa \test\lambda
167 \test\mu }
168 \def\testlowgreekii{%
169 \test\nu \test\xi \test o \test\pi \test\rho \test\sigma \test\tau
170 \test\upsilon \test\phi \test\chi \test\psi \test\omega }
171 \def\testlowgreekiii{%
172 \test\varepsilon \test\vartheta \test\varpi \test\varrho
173 \test\varsigma \test\varphi \test\varkappa \test\ell \test\wp}
174 \def\testlowgreekiu{%
175 \test\upalpha \test\upbeta \test\upgamma \test\updelta \test\upepsilon
176 \test\upzeta \test\upeta \test\uptheta \test\upiota \test\upkappa \test\uplambda
177 \test\upmu }
178 \def\testlowgreekiiu{%
179 \test\upnu \test\upxi \test o \test\uppi \test\uprho \test\upsigma \test\uptau
180 \test\upupsilon \test\upphi \test\upchi \test\uppsi \test\upomega }
181 \def\testlowgreekiiiu{%
182 \test\upvarepsilon \test\upvartheta \test\upvarpi \test\upvarrho
183 \test\upvarsigma \test\upvarphi \test\upvarkappa}
184 \def\testlowgreek{%
185 \testlowgreeki\testlowgreekii\testlowgreekiii}
186 \def\testlowgreeku{%
187 \testlowgreekiu\testlowgreekiiu\testlowgreekiiiu}
188 \def\test#1{\; #1}
189
190 %\newpage
191 \subsection*{Greek letters in version 1.11:} \[\testupgreek\]
192 \[\testupgreekit\]
193 \[\testlowgreek\]
194 \[\testlowgreeku\]
195 {\boldmath
196 \[\testupgreek\]
197 \[\testupgreekit\]
198 \[\testlowgreek\]
199 \[\testlowgreeku\]
200 }
201
202 \section{Math/text package choices}
203
204 \subsection*{All unicode}
205 There is now a unicode math package, {\tt XCharter-Math} that may be run with a simple preamble containing
206 \begin{verbatim}
207 \usepackage{fontspec}
208 \setmainfont{XCharter} % reads XCharter.fontspec
209 \usepackage{unicode-math}
210 \setmathfont{XCharter-Math.otf}
211 \end{verbatim}
212 or, even better, as described in the documentation for {\tt XCharter-Math},
213 \begin{verbatim}
214 \usepackage{xcharter-otf}
215 \end{verbatim}
216 but in order to get the options and macros described in this documentation, you should use instead, for the same effect
217 \begin{verbatim}
218 \usepackage[otfmath]{XCharter}
219 % loads fontspec, unicode-math, and sets XCharter-Math.otf
220 \end{verbatim}
221 \textsc{Notes on the last preamble fragment:}
222 \begin{itemize}
223 \item
224 Unless option {\tt otfmath} is specified, math will be processed by {\tt newtxmath} with {\tt xcharter} option. (See examples 2--6 below.)
225 \item All options passed to {\tt XCharter} that are not understood by {\tt XCharter} will be passed along to {\tt xcharter-otf} provided option {\tt otfmath} was specified.
226 \end{itemize}
227 \subsection*{Non-unicode only} Three non-unicode math packages seem to provide reasonable companions for \textsf{XCharter}. The first example uses Charter italics as math italics, but doesn't provide arbitrary scaling and doesn't sufficiently distinguish math italic v from mathematical Greek \verb|\nu|. Moreover, it is not easy to redefine \verb|\mathcal| to get a better math calligraphic alphabet---e.g., the {\tt mathalpha} package fails. The second uses \textsf{libertine} italics and Greek in math mode, which is a good match to Charter in style and weight after scaling up, is arbitrarily scalable, has distinct math italic v and mathematical Greek \verb|\nu|, and is completely compatible with {\tt mathalpha}. The third is a new revision of {\tt newtxmath} with option {\tt charter} (or, equivalently, {\tt xcharter}), which substitutes Charter italics as math italics and, as of version 1.11, uses a newly developed family of Greek symbols in \{regular, bold\} $\times$ \{upright, italic\} to match the style and italic angle of XCharter. This version is scalable and has a math italic v (plus a matching w) distinct from \verb|\nu|. (The option {\tt noxchvw} to {\tt newtxmath} changes the v and w to be the original Charter italic glyphs, which may lead to issues with \verb|\nu|.)
228 % The option {\tt alty} to {\tt newtxmath/charter}, new as of version {\tt 1.203}, substitutes $y$ for the default \emph{y} which, IMO, works better in combination with other math symbols because it lacks the problematic tail of \emph{y}.)
229 %\newpage
230
231 \textsc{Example 1:}
232 \begin{verbatim}
233 % [pdf]latex only
234 \usepackage[charter,expert]{mathdesign}
235 \usepackage[scaled=.96,osf]{XCharter}% matches the size used in math
236 \linespread{1.04}
237 \end{verbatim}
238
239 \textsc{Example 2:}
240 \begin{verbatim}
241 % [pdf]latex only
242 \usepackage[scaled=.98,sups,osf]{XCharter}% lining figures in math, osf in text
243 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata typewriter
244 \usepackage[type1]{sourcesanspro}% sans serif
245 \usepackage[uprightscript,libertine,vvarbb,scaled=1.05]{newtxmath}
246 \linespread{1.04}
247 \end{verbatim}
248
249 \subsection*{Non-unicode using {\tt newtxmath}}
250
251
252 \textsc{Example 3:}
253 \begin{verbatim}
254 % [pdf]latex only
255 \usepackage[scaled=.98,sups,osf]{XCharter}% lining figures in math, osf in text
256 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata typewriter
257 \usepackage[type1]{sourcesanspro}% sans serif
258 \usepackage[uprightscript,charter,vvarbb,scaled=1.05]{newtxmath}
259 \linespread{1.04}
260 \end{verbatim}
261
262 \textsc{Example 4:}
263 \begin{verbatim}
264 % [pdf]latex only
265 \usepackage[<specify babel languages>]{babel}% load before XCharter
266 \usepackage[scaled=.98,sups,osf]{XCharter}% osf in text, lining figures in math
267 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata typewriter
268 \usepackage[type1]{sourcesanspro}% sans serif
269 \usepackage[uprightscript,charter,vvarbb,scaled=1.05]{newtxmath}
270 \linespread{1.04}
271 \end{verbatim}
272
273 \textsc{Example 5:}
274 \begin{verbatim}
275 % an example using newtx.sty, works with all latex engines
276 \usepackage[<specify babel languages>]{babel}% load before newtx
277 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata tt
278 \usepackage[type1]{sourcesanspro}% sans serif for math
279 \usepackage[T1]{fontenc} % encoding to use for mathtt, etc
280 \usepackage[xcharter,osf,p,mathscale=1.05,textscale=0,uprightscript,vvarbb]{newtx}
281 % loads newtxmath
282 % newtx loads fontspec with unicode engines
283 \setmonofont{lmmono10-regular.otf}[Scale=1.08] % typewriter for text
284 \linespread{1.04}
285 % load polyglossia after newtx, if using
286 \end{verbatim}
287 %\newpage
288
289 \textsc{Example 6:}
290 \begin{verbatim}
291 % Adds instructions to produce a pdf conforming to PDF/A-1b
292 %\pdfcompresslevel=0 % uncomment for debugging the pdf
293 %\pdfgentounicode=1
294 %\input glyphtounicode.tex % now part of latex
295 \InputIfFileExists{glyphtounicode-cmr.tex}{}{}
296 \InputIfFileExists{glyphtounicode-ntx.tex}{}{}
297 \usepackage[a-1b]{pdfx} % version 1.6.4 or higher
298 \usepackage[<specify babel languages>]{babel}% load before XCharter
299 \usepackage[scaled=.98,sups,osf]{XCharter}% osf in text, lining figures in math
300 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata typewriter
301 \usepackage[type1]{sourcesanspro}% sans serif
302 \usepackage[uprightscript,charter,vvarbb,scaled=1.05]{newtxmath}
303 \linespread{1.04}
304 \end{verbatim}
305
306 Here is a short sample based on the preamble of \textsc{Example 3}:\\[4pt]
307 \def\Pr{\ensuremath{\mathbb{P}}}
308 \def\rmd{\mathrm{d}}
309 The typeset math below follows the ISO recommendations that only variables
310 be set in italic. Note the use of upright shapes for $\rmd$, $\mathrm{e}$
311 and $\uppi$. (The first two are entered as \verb|\mathrm{d}| and
312 \verb|\mathrm{e}|, and in fonts derived from {\tt newtxmath} or {\tt mtpro2},
313 the latter is entered as \verb|\uppi|.)
314
315 \textbf{Simplest form of the \textit{Central Limit Theorem}:} \textit{Let
316 $X_1$, $X_2,\cdots$ be a sequence of iid random variables with mean $0$
317 and variance $1$ on a probability space $(\Omega,\mathcal{F},\Pr)$. Then}
318 \[\Pr\left(\frac{X_1+\cdots+X_n}{\sqrt{n}}\le y\right)\to\mathfrak{N}(y)\coloneq
319 \int_{-\infty}^y \frac{\mathrm{e}^{-v^2/2}}{\sqrt{2\uppi}}\,
320 \mathrm{d}v\quad\mbox{as $n\to\infty$,}\]
321 \textit{or, equivalently, letting} $S_n\coloneq\sum_1^n X_k$,
322 \[\mathbb{E} f\left(S_n/\sqrt{n}\right)\to \int_{-\infty}^\infty f(v)
323 \frac{\mathrm{e}^{-v^2/2}}{\sqrt{2\uppi}}\,\mathrm{d}v
324 \quad\mbox{as $n\to\infty$, for every $f\in\mathrm{b}
325 \mathcal{C}(\mathbb{R})$.}\]
326 \subsection*{Unicode text, non-unicode math}
327 The following examples cover using a unicode latex engine ({\tt lualatex} or {\tt xelatex}) with XCharter otf fonts for text accompanied by newtxmath. They are simple variants of examples 5 and 6 from the prior subsection.
328
329 \textsc{Example 7:}
330 \begin{verbatim}
331 % an example using newtx.sty, works with all latex engines
332 \usepackage[<specify babel languages>]{babel}% load before newtx
333 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata tt
334 \usepackage[type1]{sourcesanspro}% sans serif for math
335 \usepackage[T1]{fontenc} % encoding to use for mathtt, etc
336 \usepackage[xcharter,osf,p,mathscale=1.05,textscale=0,uprightscript,vvarbb]{newtx}
337 % loads newtxmath
338 % newtx loads fontspec with unicode engines
339 \setmonofont{lmmono10-regular.otf}[Scale=1.08] % typewriter for text
340 \linespread{1.04}
341 % load polyglossia after newtx, if using
342 \end{verbatim}
343 %\newpage
344
345 \textsc{Example 8:}
346 \begin{verbatim}
347 % Adds instructions to produce a pdf conforming to PDF/A-1b
348 %\pdfcompresslevel=0 % uncomment for debugging the pdf
349 %\pdfgentounicode=1
350 %\input glyphtounicode.tex % now part of latex
351 \InputIfFileExists{glyphtounicode-cmr.tex}{}{}
352 \InputIfFileExists{glyphtounicode-ntx.tex}{}{}
353 \usepackage[a-1b]{pdfx} % version 1.6.4 or higher
354 \usepackage[<specify babel languages>]{babel}% load before XCharter
355 \usepackage[scaled=.98,sups,osf]{XCharter}% osf in text, lining figures in math
356 \usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata typewriter
357 \usepackage[type1]{sourcesanspro}% sans serif
358 \usepackage[uprightscript,charter,vvarbb,scaled=1.05]{newtxmath}
359 \linespread{1.04}
360 \end{verbatim}
361
362 \section{Text effects under \texttt{fontaxes}}
363 This package loads the {\tt fontaxes} package in order to access italic and slanted small caps. You should pay attention to the fact that {\tt fontaxes} modifies the behavior of some basic \LaTeX\ text macros such as \verb|\textsc| and \verb|\textup|. Under normal \LaTeX, some text effects are combined, so that, for example, \verb|\textbf{\textit{a}}| produces bold italic {\tt a}, while other effects are not, e.g., \verb|\textsc{\textup{a}}| has the same effect as \verb|\textup{a}|, producing the letter {\tt a} in upright, not small cap, style. With {\tt fontaxes}, \verb|\textsc{\textup{a}}| produces instead upright small cap {\tt a}. It offers a macro \verb|\textulc| that undoes small caps, so that, e.g., \verb|\textsc{\textulc{a}}| produces {\tt a} in non-small cap mode, with whatever other style choices were in force, such as bold or italics.
364
365 \section{Text Companion Issues}
366 As of version $1.206$, {\tt XCharter} has essentially full support for {\tt textcomp} and there should be no issues in using any of the macros like \verb|\textregistered| and \verb|\textinterrobang| (\textregistered, \textinterrobang.)
367
368 \textsc{XCharter-Roman-ts1}
369 \fonttable{XCharter-Roman-ts1}
370 %\newpage
371 \section{Usage with fontspec}
372 Because the package supplies a file named {\tt XCharter.fontspec} whose contents list the {\tt otf} files that correspond to each of Regular, Bold, Italic, BoldItalic, Slanted and BoldSlanted, you may load XCharter with just
373 \begin{verbatim}
374 \usepackage{fontspec}
375 \setmainfont{XCharter}
376 \end{verbatim}
377 With unicode-encoded text, you will, in particular, have complete access to the Cyrillic glyphs.
378
379 \section{XCharter and PDF/A}
380 There are a number of PDF/A validators available, though their outputs can and do differ when applied to the same document. I've tried the following.
381 \begin{itemize}
382 \item
383 Adobe Acrobat Pro. Almost all XCharter documents validate PDF/A-1b.
384 \item
385 \url{https://www.pdf-online.com/osa/validate.aspx} is a free online validator. Almost all XCharter documents validate PDF/A-1b.
386 \item
387 The free {\tt veraPDF} validator is much stricter. Recent documents produced using XCharter since version 1.24 have validated correctly.
388 \end{itemize}
389 \newpage
390
391 \section{Using Cyrillic with pdflatex}
392 The OT$2$ encoding, now considered as obsolete because it is 7-bit, is nonetheless useful to scholars who wish to write short segments using a Cyrillic script from a Western keyboard. There are two means of doing this, one using control sequences for the characters (e.g., \verb|\CYRA| for Cyrillic A) and the other using ligatures to access the characters. Tables setting out the substitutions available may be consulted at \url{http://herbert.the-little-red-haired-girl.org/dvi/pdf/cyrillic.pdf}.
393
394 Note that, while the OT$2$ encoded font is complete, there are many gaps in the T$2$A encoded version, so that only Modern Russian and Ukrainian are fully covered, along with a number of characters from Old Russian and other Slavic languages.
395
396 %\fonttable{XCharter-Roman-tfl-ot2.tfm}
397 %{\usefont{OT2}{XCharter-TLF}{m}{n} \char"41}
398 \textsc{XCharter-Roman-tlf-ot2.tfm}:\\
399 \vspace*{-12pt}
400 \fonttable{XCharter-Roman-tlf-ot2}
401
402 This encoding contains the upright {\tt Sha} glyph in slot 88. This may be used in mathematical formulas by defining
403 \verb|\def\Sha{{\usefont{OT2}{XCharter-TLF}{m}{n}\char88 }}|
404 so that one may write \verb|$\text{\Sha}(A/K)$| for the Tate–Shafarevich group $\text{\Sha}(A/K)$.
405
406 \textsc{Example OT$2$ Preamble:}
407
408 \begin{verbatim}
409 \documentclass{article}
410 \usepackage[OT2,T1]{fontenc} % loads ot2enc.def
411 \newcommand\cyrtext{%
412 \fontfamily{XCharter-TLF}\fontencoding{OT2}\selectfont} % declaration
413 \DeclareTextFontCommand{\textcyr}{\cyrtext} %macro with argument
414 \end{verbatim}
415 The Russian part of the following sentence is entered as \verb|\textcyr{a e1to --- po-russki}|.
416
417 This is text in English, then Russian:
418 \textcyr{a e1to --- po-russki}.
419 \newpage
420
421 \textsc{Using T$2$A with T$1$:}
422
423 Here's an example of using {\tt XCharter} text and math, set up to allow the use of Russian with English as the main language.
424 \begin{verbatim}
425 \usepackage[OT2,T2A,T1]{fontenc} % spell out all text encodings to be used
426 \usepackage[utf8]{inputenc} %
427 \usepackage{substitutefont} % so we can use fonts other than those specified in babel
428 \usepackage[russian,english]{babel}
429 \usepackage{XCharter} %
430 \usepackage[charter,vvarbb,scaled=1.07]{newtxmath}
431 \useosf % use oldstyle figures except in math
432 \substitutefont{T2A}{\rmdefault}{XCharter} % use XCharter to render Russian
433 %\substitutefont{OT2}{\rmdefault}{XCharter} % poor man's version
434 \end{verbatim}
435 Any {\tt utf8}-encoded text typed outside of a \verb|\foreignlanguage{}{}| block will be rendered as T$1$-encoded {\tt XCharter}, while that within \verb|\foreignlanguage{russian}{}| will render as T$2$A-encoded Cyrillic.
436
437 \newpage
438 \textsc{XCharter-Roman-tlf-t2a.tfm}:\\
439 \fonttable{XCharter-Roman-tlf-t2a.tfm}
440 \newpage
441 \textsc{XCharter-Italic-tlf-t2a.tfm}:\\
442 \fonttable{XCharter-Italic-tlf-t2a.tfm}
443
444 %\textsc{Note:} Currently, the \LaTeX\ support files for T$2$A encoded \emph{XCharter} cover the figure styles {\tt tabular lining}, {\tt tabular oldstyle}, {\tt proportional lining}, {\tt proportional oldstyle} and {\tt superiors}.
445 \section{Serbian Cyrillic}
446 Serbian and Russian Cyrillic differ in the following ways.
447
448 \font\russc=XCharter-Roman-tlf-t2a at 11pt
449 \font\serbc=XCharter-Roman-tlf-t2asrb at 11pt
450 \font\russci=XCharter-Italic-tlf-t2a at 11pt
451 \font\serbci=XCharter-Italic-tlf-t2asrb at 11pt
452 \begin{center}
453 \begin{tabular}{@{} cccc @{}}
454 \toprule
455 Character & Shape & Russian & Serbian \\
456 \midrule
457 U+0431 & Upright & {\russc\char"E1} & {\serbc\char"E1} \\
458 U+0431 & Italic & {\russci\char"E1} & {\serbci\char"E1} \\
459 U+0433 & Italic & {\russci\char"E3} & {\serbci\char"E3} \\
460 U+0434 & Italic & {\russci\char"E4} & {\serbci\char"E4} \\
461 U+043F & Italic & {\russci\char"EF} & {\serbci\char"EF} \\
462 U+0442 & Italic & {\russci\char"F2} & {\serbci\char"F2} \\
463 \bottomrule
464 \end{tabular}
465 \end{center}
466
467 Usage under LuaLaTeX and XeLaTeX is simple. Your preamble should include
468 \begin{verbatim}
469 \usepackage{polyglossia}
470 \usepackage{fontspec}
471 \setmainfont{XCharter}[%
472 Language=Serbian,
473 Script=Cyrillic
474 ]
475 \end{verbatim}
476 Then all (unicode) input characters will be typeset using the above substitution table.
477
478 The story is a bit more complicated with \LaTeX\ processing.
479
480 \textsc{Example 1: Serbian Cyrillic as default text.}
481 \begin{verbatim}
482 \usepackage[utf8x]{inputenc}
483 \usepackage[serbianc]{babel}
484 \usepackage[serbianc]{XCharter}
485 \usepackage[T2A]{fontenc}
486 \end{verbatim}
487 This will produce essentially the same output as the {\tt fontspec} example above, with unicode input.
488
489 It may be be possible to work out a scheme that would allow multiple scripts and languages to be used with {\tt serbianc} as the main or as a secondary language in {\tt babel}, but I have not succeeded in doing this with XCharter, and know of no other example that I might crib from.
490 %\textsc{Example 2:
491
492 \section*{Opentype processing and German orthography}
493 Prior to version {\tt1.12}, {\tt XCharter} offered only basic support for German orthography, having all required accented glyphs and the lower case \ss, as well as a small caps \textsc{\ss}. Under non-unicode LaTeX, the T$1$ encoding contained \verb|S_S|. With unicode tex processing:
494 \begin{verbatim}
495 {\addfontfeature{StylisticSet=1}\ss\ \textsc{\ss}}
496 \end{verbatim}
497 typesets, as in non-unicode LaTeX processing, to
498
499 \ss\ \textsc{\ss}
500
501 Note also that in unicode processing, in order to obtain the expected case change behavior, it may be necessary to add in your preamble:
502 \begin{verbatim}
503 \uccode`ß="1E9E
504 \end{verbatim}
505
506
507 As of version {\tt1.12} of {\tt XCharter}, there are now glyphs in each style for {\tt U+1E9E} and for its small caps version, accessible under unicode TeX. The glyphs may be used as the uppercase and small caps versions of {\tt germandbls}. Currently, the new glyphs are not available in any of the LaTeX encodings and must be used via unicode TeX.
508
509 The following tables show how to access the new glyphs in unicode TeX. Note that you will need to set {\tt StylisticSet=1} if you wish not to use the new sharp-s glyphs.
510
511 %\includegraphics{newgermanfxch-crop}
512 \noindent \textbf{New symbols in XCharter:}
513 \begin{center}
514 \begin{tabular}{@{} lcl @{}}
515 \hline
516 Glyph name & glyph & macro\\
517 \hline
518 {\tt uni1E9E} & \symbol{"1E9E} &\verb|\symbol{"1E9E}|\\
519 {\tt uni1E9E.ss01} & {\addfontfeature{StylisticSet=1}\symbol{"1E9E}} & \verb|{\addfontfeature{StylisticSet=1}\symbol{"1E9E}}| \\
520 {\tt germandbls.sc} & \textsc{\ss} & \verb|{\textsc{\ss}}| \\
521 {\tt germandbls.sc.ss01} & {\addfontfeature{StylisticSet=1}\textsc{\ss}} & \verb|{\addfontfeature{StylisticSet=1}\textsc{\ss}}| \\
522 \hline
523 \end{tabular}
524 \end{center}
525
526 %{\bfseries
527 %\begin{center}
528 % \begin{tabular}{@{} lcl @{}}
529 % \hline
530 % Glyph name & glyph & macro\\
531 % \hline
532 % {\tt uni1E9E} & \symbol{"1E9E} &\verb|\symbol{"1E9E}|\\
533 % {\tt uni1E9E.alt} & {\addfontfeature{StylisticSet=1}\symbol{"1E9E}} & \verb|{\addfontfeature{StylisticSet=1}\symbol{"1E9E}}| \\
534 % {\tt germandbls.sc.ss02} & {\addfontfeature{StylisticSet=1}\textsc{\ss}} & \verb|{\addfontfeature{StylisticSet=1}\textsc{\ss}}| \\
535 % \hline
536 % \end{tabular}
537 %\end{center}
538 %}
539 \noindent \textbf{Effect of choice of {\tt StylisticSet}:}
540
541 \begin{center}
542 \begin{tabular}{@{} ccccc @{}}
543 \hline
544 StylisticSet & \verb|\ss| & \verb|\SS| & \verb|\MakeUppercase{\ss}| & \verb|\textsc{\ss}| \\
545 \hline
546 None & \ss & \SS & \MakeUppercase{\ss} & \textsc{\ss}\\
547
548 =1 & {\addfontfeature{StylisticSet=1}\ss} & {\addfontfeature{StylisticSet=1}\SS} & {\addfontfeature{StylisticSet=1}\MakeUppercase{\ss}} & {\addfontfeature{StylisticSet=1}\textsc{\ss}}\\
549 \hline
550 \end{tabular}
551 \end{center}
552
553 \noindent \textbf{Choosing the shape of the oldstyle figure ``one'':}\\
554
555 The default is \oldstylenums{1}. The choice is controlled by the feature \texttt{cv01}. To change this globally when you load XCharter, you may make oldstyle numbers the default with the alternate shape for ``one'':
556 \begin{verbatim}
557 \setmainfont{XCharter}[CharacterVariant={1:0},Numbers={OldStyle}]
558 \end{verbatim}
559 To set this for one-time use, you can write:
560 \begin{verbatim}
561 {\addfontfeature{CharacterVariant={1:0},Numbers={OldStyle}}1}
562 \end{verbatim}
563 to make $1$ render as {\addfontfeature{CharacterVariant={1:0},Numbers={OldStyle}}\oldstylenums{1}}. (According to its documentation, the first index $1$ in \verb|{1:0}| refers to the {\tt CharacterVariant} index, and the second index, $0$, refers to the first choice specified among the variant forms.)
564 %1{\addfontfeature{CharacterVariant={1:0},Numbers={OldStyle}}1}
565 %{\addfontfeature{CharacterVariant={1:1},Numbers={OldStyle}}1}
566
567 If you choose to load {\tt XCharter-*.otf} using {\tt XCharter.sty} or {\tt newtx}, you may make use of the options {\tt osf}, {\tt osfI} or the macros \verb|\useosf|, \verb|\useosfI| to the same effect.
568
569 \end{document}