Debian Codegraph @

texmf-dist/doc/fonts/lxfonts/LXfonts-demo.tex

raw
1 % !TEX TS-program = LuaLaTeX
2 %Slidefont-demo.tex
3 \documentclass[usepdftitle=false]{beamer}\errorcontextlines=9
4 \usetheme{AnnArbor}
5 \usefonttheme{professionalfonts}
6 \useoutertheme[right]{sidebar}
7 \setbeamercolor{alerted text}{fg=red!90!black}
8 \beamertemplatetransparentcovereddynamic
9 \usepackage{mflogo}
10 \usepackage[TS1,LGR,T1]{fontenc}
11 \usepackage{amsmath, array, booktabs}
12 \usepackage{lxfonts}
13
14 \usepackage{tikz}
15 \usetikzlibrary{angles}
16
17
18 \usepackage[italian,greek.ancient,english]{babel}
19 \usepackage{amssymb}
20
21 \newfont{\cit}{cmssqi8 scaled 1250}
22 \newfont{\lit}{lcmssi8 scaled 1250}
23 \newfont{\cir}{cmssq8 scaled 1250}
24 \newfont{\lir}{lcmss8 scaled 1250}
25 \DeclareFixedFont{\cmsyx}{OMS}{cmsy}{m}{n}{12.5}
26 \DeclareFixedFont{\cmssx}{OT1}{cmss}{m}{n}{12.5}
27 \makeatletter
28 \input{t1llcmtt.fd} % loads T1/llcmtt
29 \input{omxllcmex.fd} % loads OMX/llcmex
30 \makeatother
31 \DeclareFontShape{T1}{llcmtt}{m}{n}{<-> [1.25]ecltt8}{}
32 \DeclareFontShape{T1}{llcmtt}{m}{it}{<-> [1.25]ecit0800}{}
33 \DeclareFontShape{OMX}{llcmex}{m}{n}{<-> lcmex8}{}
34 \DeclareEncodingSubset{TS1}{llcmss}{0}
35
36 %=================================================
37
38 \newcommand\SliTeX{Sli\kern-.05em\TeX}
39 \newcommand\AMS{\ensuremath{\mathcal{A\!_{\textstyle M}\mkern-2mu S}}}
40 \DeclareMathOperator{\diff}{\mathrm{d}\!}
41 \newcommand*\cs[1]{\texttt{\char92#1}}
42 \newcommand\pack[1]{\textsl{#1}}
43
44 \def\TRON{\tracingcommands=2\tracingmacros=2\relax}
45 \def\TROF{\tracingcommands=0\tracingmacros=0\relax}
46
47
48 \title{Revived slide fonts for \LaTeX}
49 \subtitle{Demo\qquad Version 2.1}
50 \author{Claudio Beccari}
51 \date{2025-02-03}
52
53 \begin{document}
54 %\expandafter\show\csname mv@normal \endcsname
55
56
57 \begin{frame}
58 \titlepage
59 \end{frame}
60
61 %\begin{frame}\frametitle{Table of contents}
62 %\tableofcontents
63 %\end{frame}
64
65 \section{Introduction}
66
67 \begin{frame}\frametitle{The original \LaTeX\ slides}
68 When \LaTeX\ was created, Leslie Lamport made an accompanying program named \SliTeX. At that time PCs had very little memory and format files could not handle more than one language at a time.
69
70 \medskip
71
72 {\centering\alert{It was A.D.\ 1984!}\par}
73
74 \medskip
75
76 \SliTeX\ was used for creating that time's presentations. Its main value, besides creating presentations to be printed on transparencies (beamers did not exist at that time\dots), was to use fonts whose legibility was excellent.
77 \end{frame}
78
79 \begin{frame}\frametitle{The old slides font}
80 The old slides fonts derived from the ones D.E.\ Knuth designed for his witty citations at the end of each \TeX\-book chapter, for example:
81 \begin{quote}\raggedleft{\cit
82 If you can't solve a problem,\\
83 you can always look up the answer.\\
84 But please, Try first to solve it by yourself;\\
85 then you'll learn more and you'll learn faster.\par}
86 \makebox[\linewidth][r]{\cir --- DONALD E.\ KNUTH. {\cit The \TeX\-book} (1983)}
87 \end{quote}
88 \end{frame}
89
90 \begin{frame}\frametitle{The old slides font}
91 You may notice that the upper case `i' and the lower case `l' are undistinguishable, and, even worse, they get confused with the math symbol $|$.
92
93 \medskip
94
95 Lamport himself made from the knuthian one a variant with a serifed capital `i':
96 \begin{quote}\raggedleft{\lit
97 If you can't solve a problem,\\
98 you can always look up the answer.\\
99 But please, Try first to solve it by yourself;\\
100 then you'll learn more and you'll learn faster.\par}
101 \makebox[\linewidth][r]{\lir --- DONALD E.\ KNUTH. {\lit The \TeX\-book} (1983)}
102 \end{quote}
103 \end{frame}
104
105 \begin{frame}\frametitle{The new slides font}
106 In order to use this slides font also in mathematics I realized this new font (used throughout this presentation) so that Knuth's citation becomes:
107 \begin{quote}\raggedleft\small\linespread{1.2}{\itshape
108 If you can't solve a problem,\\
109 you can always look up the answer.\\
110 But please, Try first to solve it by yourself;\\
111 then you'll learn more and you'll learn faster.\par}
112 \makebox[\linewidth][r]{\upshape --- DONALD E.\ KNUTH. {\itshape The \TeX\-book} (1983)}
113 \end{quote}
114 \end{frame}
115
116 \begin{frame}\frametitle{Comparison between the sanserif fonts}
117 If you compare at the same font size this new font with the ordinary sanserif font of the CM/EC collections (the fonts that are used by default, for example, by \textsl{beamer}) you notice a remarkable difference in legibility and this explains the initial choice made by Lamport.
118 \begin{center}
119 \def\S{\rule{0pt}{2.2ex}}\def\D{\rule[-1ex]{0pt}{0pt}}
120 \begin{tabular*}{\linewidth}{r@{\extracolsep{\fill}}l}\hline
121 \footnotesize\texttt{\itshape OT1/cmss}\S & \cmssx abcdefghijklmnopqrstuvwxyz\\
122 \footnotesize\texttt{\itshape OT1/llcmss}\D& abcdefghijklmnopqrstuvwxyz\\\hline
123 \end{tabular*}
124 \end{center}
125 \end{frame}
126
127 \begin{frame}\frametitle{The old slides font and mathematics}
128 Math with \SliTeX\ used to be typeset with the ordinary math fonts used with \LaTeX; the only exception was that the `operators' font was substituted with the upright slides font.
129
130 The result was poor; not only everybody could notice the difference between the stroke weight of the CM math fonts compared to the slides font, but the various signs obtained by composition of different glyphs, such as, for example, \(\textfont2\cmsyx \Longrightarrow\) instead of \(\Longrightarrow\), were composed with an `equals' sign taken from the slides fonts, and an arrow tip taken from the CM math symbols fonts.
131 \end{frame}
132
133
134 \section{The new slides fonts}
135
136 \begin{frame}\frametitle{The new slides fonts and mathematics}\small
137 Therefore, in order to use the new slides font in mathematics it was necessary to restyle the three math fonts, specifically:
138 \begin{itemize}
139 \item the `letters' font that contains the math italics alphabet, the upper and lower case slanted Greek alphabet, and many other symbols;
140 \item the `symbols' font that included also the upper case calligraphic alphabet;
141 \item the `delimiters' font that contains the extensible glyphs for the large delimiters and operators.
142 \end{itemize}
143
144 To this end the three above mentioned fonts have been rebuilt with the stylistic parameters of the new fonts, both in medium and bold face weights.
145 \end{frame}
146
147 \begin{frame}\frametitle{First math example}
148 The second degree real coefficient equation
149 \begin{equation}
150 ax^2 + bx + c = 0
151 \end{equation}
152 has solutions
153 \begin{equation}
154 x_{1,2} = \frac{-b \pm\sqrt{b^2-4ac}}{2a}
155 \end{equation}
156 \end{frame}
157
158
159 \begin{frame}\frametitle{First math example}
160 \noindent with
161 \begin{equation}
162 \begin{cases}
163 x_{1,2} \in \mathbb{R} &\text{if } b^2-4ac>0\\
164 x_1=x_2 \in \mathbb{R} &\text{if } b^2-4ac=0\\
165 x_{1,2} \in \mathbb{C} &\text{if } b^2-4ac<0
166 \end{cases}
167 \end{equation}
168 \end{frame}
169
170 \begin{frame}\frametitle{Comments to the first example}
171 The example displays the usual algebraic structures with exponents, subscripts, fractions and square roots.
172
173 It displays also an extensible operator and \alert{black board bold} characters, that belong to the further symbol collection of the \texttt{amssymb} package, that were also restyled with the stylistic parameters of the lxfonts.
174
175 \end{frame}
176
177 \begin{frame}\frametitle{The \AMS\ fonts}
178 With the same stylistic parameters the \AMS\ fonts of the \texttt{msam} and \texttt{msbm} collections were rebuilt, so that all packages of the \textsl{amsmath} bundle can be used in a way that all symbols and commands share the same stylistic features.
179
180 You can type for example:
181 \TRON\begin{equation}
182 \nexists F(\boldsymbol{P}) : F(\boldsymbol{P}) \eqsim \iiint_V f(\boldsymbol{P}) \diff x \diff y \diff z
183 \end{equation}\TROF
184 ~
185 \TRON\begin{equation}
186 \begin{pmatrix}
187 a_{1,1} & a_{1,2} & a_{1,3}\\
188 a_{2,1} & a_{2,2} & a_{2,3}\\
189 a_{3,1} & a_{3,2} & a_{3,3}
190 \end{pmatrix}
191 \begin{pmatrix}
192 x_1 \\ x_2 \\ x_3
193 \end{pmatrix}
194 \lessapprox
195 \begin{pmatrix}
196 y_1 \\ y_2 \\ y_3
197 \end{pmatrix}
198 \end{equation}
199 \end{frame}
200
201 \begin{frame}{The \LaTeX\ symbols}
202 The following symbols are the \LaTeX\ special symbols, provided by the \pack{latexsym} package \alert{and} by the \pack{amsfonts} one; by delaying the call to the LXfonts macros to the \cs{AtEndPreamble} hook, it is possible to check which packages have already been loaded, and in case the \pack{latexsym} package is not reloaded.
203 \begin{center}
204 \begin{tabular}{l>$c<$l>$c<$}\toprule
205 \cs{Join} & \Join & \cs{leadsto} & \leadsto \\
206 \cs{sqsupset} & \sqsupset & \cs{sqsubset} & \sqsubset \\
207 \cs{rhd} & \rhd & \cs{lhd} & \lhd \\
208 \cs{unrhd} & \unrhd & \cs{unlhd} & \unlhd \\
209 \cs{Diamond} & \Diamond & \cs{mho} & \mho \\
210 \cs{Box} & \Box & & \\
211 \bottomrule
212 \end{tabular}
213 \end{center}
214 \end{frame}
215
216 \begin{frame}\frametitle{Second math example}
217 The residue theorem states that if $f(z) : z,\,f\in \mathbb{C}$ is analytic in domanin $\mathbb{D}$ except in a finite number of singular points, then
218 \begin{equation}
219 \circlearrowleft\mkern-21.5mu\int_\gamma f(z)\diff z = 2\pi \mathrm{j}\sum_{k=1}^{N_{\mathrm{sing}}} R_k
220 \end{equation}
221 holds true; $\gamma\in\mathbb{D}$ is a simply connected closed line and $N_{\mathrm{sing}}$ is the number of singularities contained within $\gamma$.
222 \end{frame}
223
224 \begin{frame}\frametitle{The Text Companion font}
225 Of course the restyling has been done also on the TS encoded Text Companion font, the one you call for when you input the package:
226 \begin{flushleft}\ttfamily
227 \cs{usepackage}\{textcomp\}
228 \end{flushleft}
229
230 Here is a small sample:
231 \begin{center}\begin{tabular}{*7c}
232 \pounds& \textmu& \textohm& \textyen& \textdollar& \texteuro& \textcelsius\\
233 \textlbrackdbl&\textborn&\textdivorced&\textmarried&\textleaf&\textmusicalnote&\textrbrackdbl\\
234 \textperthousand&\textcentoldstyle&\textwon&\textnaira&\textguarani&\textpilcrow&\textpertenthousand
235 \end{tabular}
236 \end{center}
237 \end{frame}
238
239 \begin{frame}\frametitle{Typewriter fonts for presentations}
240 Since presentations (like this one) may involve computer programming or computer science topics, the lxfonts style file contains also the typewriter type fonts taken from the CM/EC fonts but magnified a little bit so as to have the same x-height as the other text fonts. With these fonts you can type programming code such as:
241 \begin{flushleft}\ttfamily
242 \cs{documentclass}\{beamer\}\\
243 ...\\
244 \cs{usepackage}[T1]\{fontenc\}\\
245 \cs{usefontthem}[\{professionalfonts\}\\
246 ...\\
247 \cs{usepackage}\{lxfonts\}\\
248 \cs{begin}\{document\}
249 \end{flushleft}
250 \end{frame}
251
252
253
254 \begin{frame}\frametitle{How to use the lxfonts}
255 As it was shown in the previous slide the new fonts may be used by simply calling the \texttt{lxfonts} package.
256
257 \alert{Just one warning}: call the \texttt{lxfonts} package after you have loaded all the other font related packages; \texttt{lxfonts} will take care of invoking the correct font description files with the proper encodings; according to the packages loaded, it provides to some definitions that are necessary for mutual compatibility.
258
259 \alert{A \textsl{beamer} warning}: If you are using \textsl{beamer} and math italics does not come out correctly, specify:
260 \begin{flushleft}\ttfamily
261 \cs{usefonttheme}\{professionalfonts\}
262 \end{flushleft}
263 \end{frame}
264
265 \begin{frame}{Integration with the Greek script}
266 If it is needed to mix Latin and Greek script sentences in a presentation, it is good to remember that the Greek CB fonts include also a font for slides that closely matches the Latin one. In order to mix Latin and Greek script the necessary LGR Greek font description files are already available with the LX fonts bundle, therefore the Greek script is readily accessible, and the \pack{babel} language switching commands are fully available also when using the LX fonts.
267 \end{frame}
268
269 \begin{frame}{Integration with the Greek script}
270 If it is needed to mix Latin and Greek script sentences in a presentation, it is good to remember that the Greek CB fonts include also a font for slides that closely matches the Latin one. In order to mix Latin and Greek script the necessary LGR Greek font description files are already available with the LX fonts bundle, therefore the Greek script is readily accessible, and the \pack{babel} language switching commands are fully available also when using the LX fonts.
271 \end{frame}
272
273
274 \begin{frame}{Integration with the Greek script}
275 Here is a short sentence that uses the Greek CB fonts for slides; the text is in fully accented polytonic Greek.
276
277 \begin{quote}
278 \begin{otherlanguage}{greek}\fontencoding{LGR}\selectfont
279 To'utou q'arin >ap'elip'on se >en Kr'hth|, <'ina t`a le'iponta
280 >epidiort'wsh| ka`i katast'hsh|s kat`a p'olin presbit'erous, <ws
281 >eg'w soi dietax'amen, e>'i t'is >estin >an'egklhtos, mi~as
282 gunaik`os >an'hr, t'ekna >'eqwn pist'a, m`h >en kathgor'ia|
283 >aswt'ias >`h >anup'otakta.\end{otherlanguage}\end{quote}
284 \end{frame}
285
286
287
288 \iffalse
289 \begin{frame}{{Il piano cartesiano}}
290 \begin{columns}
291 \begin{column}{.5\textwidth}
292 \begin{tikzpicture}[scale=3]
293 % draw the coordinates
294 \draw[->] (0,0) -- (1.5,0) node[right] {\(x\)} coordinate(x axis);
295 \draw[->] (0,0) -- (0,1.5) node[right] {\(y\)} coordinate(y axis);
296
297 \coordinate (O) at (0,0);
298 \coordinate (u) at (1,1);
299 \coordinate (v) at (1,.5);
300
301 \draw (O) node[below] {\(O\)};
302 \pic [draw=blue!50!black, fill=blue!20, angle radius=9mm, angle eccentricity=1.5, pic text={$\theta$}] {angle = v--O--u};
303 \draw[-latex] (O) -- (v) node[anchor=west] {\((v_1,v_2)\)} node[midway, below] {\(\mathbf{v}\)};
304 \draw[-latex] (O) -- (u) node[anchor=west] {\((u_1,u_2)\)} node[midway, above] {\(\mathbf{u}\)};
305
306 \end{tikzpicture}
307 \end{column}
308 \begin{column}{.5\textwidth}
309 \begin{itemize}
310 \item {\(\theta\) รจ l'angolo tra i due vettori.}
311 \item {\(\mathbf{u}\text{ e } \mathbf{v} \) sono vettori.}
312 \end{itemize}
313 \end{column}
314 \end{columns}
315 \end{frame}
316 \fi
317
318 \begin{frame}\frametitle{Type\,1 lxfonts}
319 The package contains all the type\,1 versions of the new fonts; they are are already included into a complete and upgraded \TeX\ system installation.
320
321 Thus particular demo file without any modification is ready to be typeset with \alert{pdfLaTeX} as well as with \alert{LuaLaTeX}.
322
323 For other documents the above might not be true; read the LXfonts documentations for other documents that require different settings.
324 \end{frame}
325
326
327
328
329
330
331 \section{Conclusion}
332
333 \begin{frame}\frametitle{Experiment!}
334 It's evident that a new collection of fonts requires extensive experimentation, so as to spot all the glitches they and the associated files contain.
335
336 \medskip
337
338 The actual distribution may be defined as an $\alpha$-version, but the sooner feedback arrives, the sooner the fonts bundle is corrected and becomes stable.
339
340 \medskip
341
342 Therefore\dots
343 \end{frame}
344
345 \begin{frame}\frametitle{The end}
346 \begin{center}
347 \fontsize{37}{35}\selectfont Happy TeXing\\ \makebox[\linewidth]{with the \alert{lxfonts}!}
348
349 \end{center}
350 \end{frame}
351
352
353 \end{document}