Debian Codegraph @

texmf-dist/source/latex/typog/typog.dtx

raw
1 % \iffalse
2 %
3 % Copyright (C) 2024, 2025 by Ch. L. Spiel
4 %
5 % This work may be distributed and/or modified under the conditions
6 % of the LaTeX Project Public License, either version 1.3c of this
7 % license or (at your option) any later version. The latest version
8 % of this license is in
9 % https://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions of LaTeX
11 % version 2003/12/01 or later.
12 %
13 % \fi
14 %
15 % \iffalse
16 %<*driver>
17 \documentclass{ltxdoc}
18
19 \tracingonline=0
20
21 \EnableCrossrefs
22 \CodelineIndex
23 \RecordChanges
24
25
26 \PassOptionsToClass{a4paper}{article}
27 \PassOptionsToPackage{hyperfootnotes=false}{hyperref}
28 \PassOptionsToPackage{dvipsnames}{xcolor}
29
30 \usepackage{amsmath}
31 \usepackage{amssymb}
32 \usepackage{array}
33 \usepackage{booktabs}
34 \usepackage{caption}
35 \usepackage{dtk-logos}
36 \usepackage{enumitem}
37 \usepackage{etoolbox}%--\tracingpatches
38 \usepackage{fancyhdr}
39 \usepackage[LGR,T1]{fontenc}
40 \usepackage{hypdoc}
41 \usepackage{hyphenat}
42 \usepackage[shrink=10, stretch=10, verbose=true]{microtype}
43 \usepackage{multirow}
44 \usepackage{needspace}
45 \usepackage[section]{placeins}
46 \usepackage{ragged2e}
47 \usepackage{setspace}
48 \usepackage{sidecap}
49 \usepackage{tabularx}
50 \usepackage[most]{tcolorbox}
51 \usepackage[nobottomtitles*]{titlesec}\renewcommand*{\bottomtitlespace}{.2\textheight}
52 \usepackage[debug, raise*=.05em,
53 uppercaselabelitemadjustments={.25pt, 1pt, -.875pt, .25pt},
54 lowercaselabelitemadjustments={-.75pt, 0pt, -2pt, -.75pt}]{typog}
55 \usepackage{xcolor}
56
57
58 \usepackage[default, lining, proportional, regular, semibold]{sourceserifpro}
59 \usepackage[lining, proportional, regular, semibold]{sourcesanspro}
60 \usepackage[lining, regular]{sourcecodepro}
61 \usepackage[scaled=1.08, uprightscript, xcharter]{newtxmath}
62 \setbaselineskip{12.5pt}
63
64
65 \makeatletter
66 \def\@get@fontclan#1-#2\@nil{#1}
67 \newcommand*{\fontclan}{\expandafter\@get@fontclan\f@family\@nil}
68 \makeatother
69
70 \DeclareRobustCommand{\proportionalliningfigures}{\fontfamily{\fontclan-LF}\selectfont}
71 \DeclareRobustCommand{\proportionaloldstylefigures}{\fontfamily{\fontclan-OsF}\selectfont}
72 \DeclareRobustCommand{\tabularliningfigures}{\fontfamily{\fontclan-TLF}\selectfont}
73 \DeclareRobustCommand{\tabularoldstylefigures}{\fontfamily{\fontclan-TOsF}\selectfont}
74
75 \DeclareRobustCommand{\textdenominator}[1]{{\fontfamily{\fontclan-Dnom}\selectfont #1}}
76 \DeclareRobustCommand{\textinferior}[1]{{\fontfamily{\fontclan-Inf}\selectfont #1}}
77 \DeclareRobustCommand{\textnumerator}[1]{{\fontfamily{\fontclan-Numr}\selectfont #1}}
78 \DeclareRobustCommand{\textsuperior}[1]{{\fontfamily{\fontclan-Sup}\selectfont #1}}
79
80 \newcommand*{\nativetextfraction}[2]
81 {\mbox{\textnumerator{#1}\textfractionsolidus\textdenominator{#2}}}
82
83 \makeatletter
84 \renewcommand*{\@makefnmark}{\hbox{\sf\textsuperior{\@thefnmark}}}
85 \newenvironment*{tabfigures}
86 {\edef\rmdefault{\fontclan-T\sourceserifpro@figurestyle}\rm\ignorespaces}
87 {\ignorespacesafterend}
88 \makeatother
89
90 \DeclareRobustCommand{\elseries}{\fontseries{el}\selectfont}
91 \DeclareTextFontCommand{\textel}{\elseries}
92 \DeclareRobustCommand{\lseries}{\fontseries{l}\selectfont}
93 \DeclareTextFontCommand{\textl}{\lseries}
94 %%--\DeclareRobustCommand{\mdseries}{\fontseries{m}\selectfont}
95 %%--\DeclareTextFontCommand{\textmd}{\mdseries}
96 \DeclareRobustCommand{\sbseries}{\fontseries{sb}\selectfont}
97 \DeclareTextFontCommand{\textsb}{\sbseries}
98 \DeclareRobustCommand{\bseries}{\fontseries{b}\selectfont}
99 \DeclareTextFontCommand{\textb}{\bseries}
100 \DeclareRobustCommand{\ebseries}{\fontseries{eb}\selectfont}
101 \DeclareTextFontCommand{\texteb}{\ebseries}
102 \DeclareRobustCommand{\ubseries}{\fontseries{k}\selectfont}
103 \DeclareTextFontCommand{\textub}{\ubseries}
104
105
106 \usepackage{cleveref}
107
108
109 \expandafter\GetFileInfo\expandafter{\jobname.sty}
110 \def\aspdfdate#1/#2/#3\relax{D:#1#2#3}
111 \edef\pdffiledate{\expandafter\aspdfdate\filedate\relax}
112
113 \hypersetup{
114 citecolor = blue,
115 colorlinks = true,
116 linkcolor = blue,
117 linktocpage = true,
118 pdfauthor={Dr. Christoph L. Spiel},
119 pdfcreationdate={\pdffiledate},
120 pdfkeywords={LaTeX, typography, ligature, italic-correction, paragraph justification, baselineskip, sloppy, ragged},
121 pdflang=en-US,
122 pdfsubject={Typographic fine-tuning for LaTeX},
123 pdftitle={Package typog \fileversion},
124 raiselinks = false,
125 urlcolor = [rgb]{0, 0, .5}% = navy
126 }
127
128 \newlength{\sectiontocindent}
129 \newlength{\sectionnumberwidth}
130 \newlength{\subsectiontocindent}
131 \newlength{\subsectionnumberwidth}
132 \newlength{\subsubsectiontocindent}
133 \newlength{\subsubsectionnumberwidth}
134
135 \setlength{\sectiontocindent}{0pt}
136 \setlength{\sectionnumberwidth}{40pt}
137 \setlength{\subsectiontocindent}{40pt}
138 \setlength{\subsectionnumberwidth}{25pt}
139 \setlength{\subsubsectiontocindent}{65pt}
140 \setlength{\subsubsectionnumberwidth}{30pt}
141
142 \makeatletter
143 \renewcommand*{\l@section}[2]
144 {\ifnum \c@tocdepth >\z@
145 \addpenalty\@secpenalty
146 \addvspace{1.0em \@plus\p@}%
147 \setlength{\@tempdima}{\sectionnumberwidth}%
148 \begingroup
149 \def\numberline##1{\hb@xt@\@tempdima{%
150 \tt\lseries
151 \fontsize{44}{0}\selectfont
152 \microtypecontext{kerning=drop-left-sidebearing}%
153 \iffalse\raisebox{-30pt}[0pt][0pt]{\rule{0.1pt}{40pt}}\fi
154 \textcolor{customred3}{##1}%
155 \hfil}}%
156 \parindent \z@
157 \rightskip \@pnumwidth
158 \parfillskip -\@pnumwidth
159 \leavevmode
160 \advance\leftskip\@tempdima
161 \hskip -\leftskip
162 \bfseries
163 \iffalse
164 \nobreak\hfil
165 \nobreak\hb@xt@\@pnumwidth{\hss #2\kern-\p@\kern\p@}%
166 \else
167 {\sffamily\large #1}\quad
168 {#2}\hfil\hbox{}
169 \fi
170 \par
171 \endgroup
172 \fi}
173
174 \renewcommand*{\@dottedtocline}[5]
175 {\ifnum #1>\c@tocdepth
176 \else
177 \vskip \z@ \@plus.2\p@
178 \begingroup
179 \leftskip #2\relax
180 \rightskip \@tocrmarg
181 \parfillskip -\rightskip
182 \parindent #2\relax\@afterindenttrue
183 \interlinepenalty\@M
184 \leavevmode
185 \@tempdima #3\relax
186 \advance\leftskip \@tempdima
187 \null\nobreak
188 \hskip -\leftskip
189 {#4}\nobreak
190 \iffalse
191 \leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
192 \nobreak\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5\kern-\p@\kern\p@}%
193 \else
194 \hbox{\quad\normalfont\bfseries #5}\nobreak\hfill\hbox{}%
195 \fi
196 \par
197 \endgroup
198 \fi}
199
200 \renewcommand*{\l@subsection}{\@dottedtocline{2}{\subsectiontocindent}{\subsectionnumberwidth}}
201 \renewcommand*{\l@subsubsection}{\@dottedtocline{3}{\subsubsectiontocindent}{\subsubsectionnumberwidth}}
202 \newrobustcmd*{\tocsquashedsubsections}
203 {\def\l@subsection{\@dottedtocline{2}{0pt}{\subsectionnumberwidth}}%
204 \def\l@subsubsection{\@dottedtocline{3}{0pt}{\subsubsectionnumberwidth}}}
205 \makeatother
206
207
208 \Crefname{figure}{Figure}{Figures}
209 \crefname{figure}{Fig.}{Figs.}
210
211 \Crefname{page}{Page}{Pages}
212 \crefname{page}{p.}{p.}
213
214 \Crefname{section}{Section}{Sections}
215 \crefname{section}{Sec.}{Secs.}
216
217 \Crefname{table}{Table}{Tables}
218 \crefname{table}{Tab.}{Tabs.}
219
220
221 \DeclareCaptionJustification{centerlastjustification}{\justify\fussy\lastlinecenteredpar}
222 \DeclareCaptionJustification{smoothraggedjustification}%
223 {\renewcommand*{\smoothraggedrightgenerator}{quintuplet}%
224 \setlength{\smoothraggedrightragwidth}{1em}%
225 \smoothraggedrightpar\relax}
226 \DeclareCaptionJustification{relaxedjustification}{\justify\slightlysloppy}
227
228 \newcommand*{\floatcaptionwidth}{.79\textwidth}
229
230 \captionsetup[figure]{font=small, justification=centerlastjustification,
231 labelfont=sc, width=\floatcaptionwidth}
232 \captionsetup[table]{font=small, justification=centerlastjustification,
233 labelfont=sc, width=\floatcaptionwidth}
234 \captionsetup[SCfigure]{font=small, justification=relaxedjustification,
235 labelfont=sc}
236 \captionsetup[SCtable]{font=small, justification=relaxedjustification,
237 labelfont=sc}
238
239
240 \newsavebox{\listlabelbox}
241
242 \sbox{\listlabelbox}{---}
243 \SetEnumitemKey{noindent}{
244 label={---},
245 labelwidth=\wd\listlabelbox,
246 leftmargin=!
247 }
248
249 \SetEnumitemKey{nestedinspecialsection}{
250 leftmargin=10pt
251 }
252
253 \SetEnumitemKey{notopsep}{
254 after=\vskip.8em plus .2em minus .4em,
255 partopsep=0pt,
256 topsep=0pt
257 }
258
259
260 \newlength{\marginindicatorsep}
261 \setlength{\marginindicatorsep}{10pt}
262
263 \newcommand*{\marginalizesectionnumber}[1]
264 {\makebox[0pt][r]{#1\hspace{\marginindicatorsep}}}
265
266
267 \fancypagestyle{pagenumberonly}{
268 \fancyhf{}
269 \fancyhead[L]{}
270 \fancyhead[R]{\thepage}
271 }
272 \fancypagestyle{fancy}{
273 \fancyhf{}
274 \fancyhead[L]{\rightmark}
275 \fancyhead[R]{\thepage}
276 }
277
278 \newcommand*{\letterspacedsmallcaps}[1]{\textsc{\textls[20]{#1}}}
279 \newcommand*{\resetfancyhead}
280 {\fancyhead[L]{\textsf{\letterspacedsmallcaps{\nouppercase\rightmark}}}}
281
282 \renewcommand*{\headrulewidth}{0pt}
283 \renewcommand*{\sectionmark}[1]
284 {\def\truesectionname{#1}%
285 \markright{\textsf{\marginalizesectionnumber{\thesection}%
286 \letterspacedsmallcaps{#1}}}}
287 \renewcommand*{\subsectionmark}[1]
288 {\markright{\textsf{\marginalizesectionnumber{\thesubsection}%
289 \letterspacedsmallcaps{\truesectionname:\enspace}#1}}}
290
291
292 \titleformat{\section}[hang]
293 {\sffamily\Large\bfseries}{\marginalizesectionnumber{\thesection}}{0pt}{}
294 \titleformat{\subsection}[hang]
295 {\sffamily\large\bfseries}{\marginalizesectionnumber{\thesubsection}}{0pt}{}
296 \titleformat{\subsubsection}[hang]
297 {\sffamily\normalsize\bfseries}{\marginalizesectionnumber{\thesubsubsection}}{0pt}{}
298 \titleformat{\paragraph}[runin]
299 {\sffamily\normalsize\bfseries}{\theparagraph}{1em}{}
300
301
302 \def\footnoterule{\vfill}% push footnotes to the bottom of the page
303
304 \makeatletter
305 \renewcommand*{\@makefntext}[1]
306 {\noindent
307 \llap{\let\@textsuperscript=\relax% use "normal" figures for the footnote numbers
308 \let\textsuperior=\relax
309 \@makefnmark
310 \hspace{\marginindicatorsep}}% separate the footnote number and the body
311 #1}
312 \makeatother
313
314
315 \pretocmd{\DescribeEnv}{\needspace{25pt}}{\relax}{\PrependingFailed}
316 \pretocmd{\DescribeMacro}{\needspace{25pt}}{\relax}{\PrependingFailed}
317
318
319 \setlength{\skip\footins}{25pt}
320 \setlength{\overfullrule}{0pt}
321 \renewcommand*{\sidecaptionsep}{25pt}
322
323
324
325 \renewcommand*{\abstractname}{{\sffamily Abstract}}
326
327 \newrobustcmd*{\acronym}[1]{\mbox{\scshape\MakeLowercase{#1}}}
328
329 \newcommand*{\aliasfor}[2]{$\rightarrow$ #1}
330
331 \newcommand*{\application}[1]{\mbox{\sffamily #1}}
332
333 \renewcommand*{\arraystretch}{1.12}
334
335 \newcommand*{\backwardincompatiblechange}
336 {\textcolor{customred3}{\sffamily\scshape\bfseries [Backward Incompatible Change]}}
337
338 \newcommand*{\bibauthor}[1]{\mbox{\textsc{#1}}}
339 \newcommand*{\bibtitle}[1]{\textit{#1}}
340 \newcommand*{\biburl}[1]{\url{#1}}
341
342 \newcommand*{\bottomstrut}{\rule[-.5em]{0pt}{0pt}}
343
344 \newenvironment*{codeexample*}
345 {\vspace{.5\smallskipamount}
346 \par
347 \ttfamily
348 \begin{tabbing}}
349 {\end{tabbing}
350 \par
351 \vspace{.5\smallskipamount}}
352 \newenvironment*{codeexample}
353 {\vspace{.5\smallskipamount}
354 \par
355 \centering
356 \begin{minipage}{\linewidth}
357 \ttfamily
358 \begin{tabbing}}
359 {\end{tabbing}
360 \end{minipage}
361 \par
362 \vspace{.5\smallskipamount}}
363
364 \makeatletter
365 \newcommand*{\citenum}[1]{\@nameuse{b@#1}}
366 \makeatother
367
368 \renewcommand*{\code}[1]{\texttt{#1}}
369
370 \newcommand*{\codelineindicator}{\mbox{\small$\mathscr{l}$}}
371
372 \newrobustcmd*{\command}[1]{\mbox{\textbf{#1}}}
373
374 \newcommand*{\detoxindex}[1]{\index{\detokenize{#1}}}
375
376 \newcommand*{\doublequotes}[1]{``#1''}
377
378 \newcommand*{\dumpmacro}[1]{\texttt{\detokenize\expandafter{#1}\unskip}}
379
380 \renewcommand*{\eTeX}{\mbox{\textepsilon-\kern-.075em\TeX}}
381
382 \newcommand*{\filesystem}[1]{\mbox{\textit{#1\/}}}
383
384 \newcommand*{\filledrectangle}[2]{\rule{#1}{#2}}
385 \newcommand*{\filledsquare}[1]{\filledrectangle{#1}{#1}}
386
387 \newcommand*{\foreignphrase}[1]{\textsl{#1}}
388
389 \makeatletter
390 \newcommand*{\formatdimen}{\@ifstar{\@typog@rem@pt}{\@typog@strip@pt}}
391 \newcommand*{\@typog@rem@pt}[1]{\dimen0=\dimexpr#1\relax\strip@pt\dimen0\,pt}
392 \newcommand*{\@typog@strip@pt}[1]{\expandafter\strip@pt#1\relax\,pt}
393 \makeatother
394
395 \newcommand*{\formatskip}[3]{#1\genfrac{}{}{0pt}{}{{+}#2}{{-}#3}}
396
397 \makeatletter
398 \renewcommand*{\fps@figure}{htbp}
399 \renewcommand*{\fps@table}{htbp}
400 \makeatother
401
402 \apptocmd{\GlossaryParms}
403 {\RaggedRight\normalsize}
404 {\relax}
405 {\AppendingFailed}
406
407 \let\oldhdclindex=\hdclindex
408 \renewcommand*{\hdclindex}[2]
409 {\ifstrequal{#2}{code}
410 {\oldhdclindex{#1}{codeidx}}
411 {\oldhdclindex{#1}{#2}}}
412
413 \let\oldhdpindex=\hdpindex
414 \renewcommand*{\hdpindex}[2]{\textbf{\oldhdpindex{#1}{#2}}}
415
416 \newcommand*{\hollowrectangle}[2]
417 {\setlength{\fboxrule}{.5pt}%
418 \setlength{\fboxsep}{0pt}%
419 \framebox{\rule{#1}{0pt}\rule{0pt}{#2}}}
420 \newcommand*{\hollowsquare}[1]{\hollowrectangle{#1}{#1}}
421
422 \NewMarkClass{IndexGroup}
423 \newcommand*{\indexgroup}[1]{\InsertMark{IndexGroup}{#1}#1}
424
425 \apptocmd{\IndexParms}
426 {\RaggedRight\small}
427 {\relax}
428 {\AppendingFailed}
429
430 \makeatletter
431 \IndexPrologue{\section*{Index}%
432 \markboth{\sf\letterspacedsmallcaps{Index}}{\sf\letterspacedsmallcaps{Index}}%
433 \begin{whittyquote}
434 Es ist schon alles gesagt, \\
435 nur noch nicht von allen. \\
436 \capitalemdash*~\propername{Karl Valentin}
437 \end{whittyquote}
438 Numbers written in italic style refer to definitions;
439 numbers in regular style refer to pages where an entry is used.
440 \ifx\special@index\HD@codeline@wrindex
441 References to code lines are prefixed with~\singlequotes{\codelineindicator}.
442 Again, italic style refers to definitions and regular style to lines where the code is used.
443 \fi}
444
445 \newcommand*{\linenumberdecoration}
446 {\ifx\special@index\HD@codeline@wrindex
447 \codelineindicator
448 \fi}
449 \makeatother
450
451 \newcommand*{\indexpackageoption}[1]
452 {\detoxindex{package option>#1=\code{#1}|userman}%
453 \detoxindex{#1=\code{#1}~(option)|userman}%
454 \ignorespaces}
455
456 \newcommand*{\indexpackageoptiondefinition}[1]
457 {\detoxindex{package option>#1=\code{#1}|usermandef}%
458 \detoxindex{#1=\code{#1}~(option)|usermandef}%
459 \ignorespaces}
460
461 \newcommand*{\leftmarker}{\rule{.2em}{.1pt}\rule{.1pt}{.667em}}
462 \newcommand*{\rightmarker}{\rule{.1pt}{.667em}\rule{.2em}{.1pt}}
463 \newcommand*{\indicatewidth}[1]{\mbox{\leftmarker #1\rightmarker}}
464
465 \newcommand*{\logmacro}[1]
466 {\ifdef{#1}
467 {\message{^^JDump of macro \string#1 follows.^^J}
468 \message{\detokenize\expandafter{#1}}
469 \message{^^JEnd macro dump.^^J}}
470 {\message{^^JMacro \string#1 is not defined.^^J}}}
471
472 \newcommand*{\marginnoteformat}
473 {\resetbaselineskip
474 \sffamily
475 \footnotesize
476 \nofontexpansion
477 \slightlysloppy[1]
478 \loosespacing[1]
479 \setlength{\smoothraggedrightragwidth}{1em}%
480 \def\smoothraggedrightgenerator{quintuplet}%
481 \smoothraggedrightpar}
482 \newcommand*{\marginnote}[1]{\marginpar{\marginnoteformat #1}}
483 \addtolength{\marginparpush}{3pt}
484 \addtolength{\marginparsep}{25pt}
485 \addtolength{\marginparwidth}{-25pt}
486 \newcommand*{\shiftedmarginnote}[1]
487 {\marginpar{\moveleft \leftmargin
488 \hbox{\parbox{\dimexpr\marginparwidth - \marginparsep}
489 {\marginnoteformat #1}}}}
490
491 \newenvironment*{widebody}
492 {\begin{list}{}{\leftmargin=-\marginparwidth
493 \listparindent=\parindent
494 \parsep=\parskip
495 \rightmargin=0pt
496 \topsep=0pt}
497 \item\relax}
498 {\end{list}}
499
500 \newcommand*{\microtyperequiredmarker}
501 {\mbox{\normalfont\packagename{microtype}~required}}
502
503 \newlength{\emreference}
504 \AtBeginDocument{\setlength{\emreference}{\fontdimen6\font}}
505 \newrobustcmd*{\milliem}[1]
506 {\ifdim #1=0pt
507 0\,pt%
508 \else
509 \nativetextfraction{\the\numexpr\dimexpr (#1) * 1000 / \emreference}{1000}\:em%
510 \fi}
511
512 \newrobustcmd*{\milliemglue}[1]
513 {\nativetextfraction{\the\numexpr\dimexpr (#1) * 1000 / \emreference}{1000}\:em%
514 \ifdim\gluestretch #1>0pt
515 \space plus~\relax
516 \nativetextfraction{\the\numexpr\gluestretch\glueexpr (#1) * 1000 / \emreference}{1000}\:em%
517 \fi
518 \ifdim\glueshrink #1>0pt
519 \space minus~\relax
520 \nativetextfraction{\the\numexpr\glueshrink\glueexpr (#1) * 1000 / \emreference}{1000}\:em%
521 \fi}
522
523 \let\originalmulticols=\multicols
524 \let\endoriginalmulticols=\endmulticols
525 \RenewDocumentEnvironment{multicols}{m o o}
526 {\ifnum #1=1
527 \IfNoValueTF{#2}{\relax}{#2}%
528 \else
529 \IfNoValueTF{#2}
530 {\originalmulticols{#1}}
531 {\originalmulticols{#1}[#2]}%
532 \fi}
533 {\ifnum #1=1
534 \relax
535 \else
536 \endoriginalmulticols
537 \fi}
538
539 \newcommand*{\needtocspace}[1][3]
540 {\addtocontents{toc}{\protect\needspace{#1\baselineskip}}}
541
542 \let\newpagetofixtoc=\newpage
543
544 \newcommand*{\packagename}[1]{\mbox{\textsf{#1}}}
545 \newcommand*{\programname}[1]{\mbox{\textbf{#1}}}
546 \newcommand*{\propername}[1]{\mbox{\textsc{#1}}}
547
548 \newcommand*{\quarterspace}{\hspace{.25em}}
549
550 \NewDocumentCommand{\sample}{s m}
551 {\setbox0=\hbox{#2}% H: 6.19849pt, /: 7.49817
552 \mbox{\raisebox{\dimexpr -.15em - \dp0}{\tiny$\llcorner$}%
553 \kern-.15em\copy0\kern-.15em
554 \raisebox{\ifdim\ht0>.7em
555 \ifx#1\BooleanTrue
556 .4em
557 \else
558 \dimexpr\ht0 - .1em
559 \fi
560 \else
561 .4em
562 \fi}
563 {\tiny$\urcorner$}}}
564
565 \newcommand*{\samplestar}{\sample{\raisebox{-.25em}[0pt][0pt]{*}}}
566
567 \newcommand*{\sectionfinish}[1][0]
568 {\ifnum#1=0%
569 \relax
570 \else
571 \vfill
572 \begingroup
573 \centering
574 \textcolor{\markercolor}
575 {\ifcase#1% 0
576 \relax
577 \or % 1
578 \filledsquare{5pt}\enspace\filledsquare{5pt}%
579 \or % 2
580 \filledsquare{4pt}\enspace\filledsquare{4pt}\enspace\filledsquare{4pt}%
581 \or % 3
582 $\bullet\enspace\bullet\enspace\bullet$%
583 \or % 4
584 \large
585 \textasteriskcentered\enspace\textasteriskcentered\enspace\textasteriskcentered
586 \fi}%
587 \par
588 \endgroup
589 \vfill
590 \fi}
591
592 \newcommand*{\sinceversion}[1]{% modeled after \NewIn of "doc.dtx"
593 \leavevmode
594 \marginpar{\RaggedLeft\textcolor{\markercolor}{\sf\scshape\proportionaloldstylefigures #1}}%
595 \ignorespaces
596 }
597
598 \newcommand*{\singlequotes}[1]{\mbox{`#1'}}
599
600 \newcommand*{\specialsectionheading}[1]{\textcolor{\markercolor}{\textit{\textbf{#1}}}}
601 \definecolor{customred1}{rgb}{.890, .282, .282}%-- https://paletton.com/
602 \definecolor{customred2}{rgb}{.831, .110, .110}
603 \definecolor{customred3}{rgb}{.686, .043, .043}
604 \definecolor{customred4}{rgb}{.569, .000, .000}
605 \definecolor{customred5}{rgb}{.420, .000, .000}
606 \newcommand*{\markercolor}{customred4}
607 \newcommand*{\specialsectionmarker}{\color{\markercolor}\filledsquare{5pt}}
608 \newcommand*{\specialsectionbegin}
609 {\llap{\raisebox{1pt}{\specialsectionmarker}%
610 \hspace{\marginindicatorsep}}}
611 \newcommand*{\specialsectionend}
612 {\ifmmode
613 \specialsectionmarker
614 \else
615 \leavevmode
616 \unskip
617 \penalty9999\mbox{}\nobreak
618 \hfill
619 \quad
620 \mbox{\specialsectionmarker}%
621 \fi}
622 \newtoggle{printspecialsectionmarker}
623 \NewDocumentEnvironment{specialsection}{m m}
624 {\Needspace{4\baselineskip}%
625 \toggletrue{printspecialsectionmarker}%
626 \begin{list}
627 {\specialsectionheading{#1\ifblank{#2}{}{\textup{\space---\space#2}}}}
628 {\itemindent=0pt
629 \labelwidth=10pt
630 \leftmargin=15pt
631 \listparindent=15pt
632 \parsep=0pt
633 \topsep=\medskipamount}
634 \newcommand*{\specialsectionendhere}
635 {\specialsectionend
636 \global\togglefalse{printspecialsectionmarker}}
637 \phantomsection
638 \item
639 \nointerlineskip
640 \leavevmode\par
641 \noindent}
642 {\iftoggle{printspecialsectionmarker}{\specialsectionend}{\relax}%
643 \end{list}}
644
645 \newenvironment*{caution}[1][]{\begin{specialsection}{Caution}{#1}}{\end{specialsection}}
646 \newenvironment*{example}[1][]{\begin{specialsection}{Example}{#1}}{\end{specialsection}}
647 \newenvironment*{futuredirection}[1][]
648 {\begin{specialsection}{Anticipated Changes \textit{\&} Possible Extensions}{#1}\small}
649 {\end{specialsection}}
650 \newenvironment*{important}[1][]{\begin{specialsection}{Important}{#1}}{\end{specialsection}}
651 \newenvironment*{note}[1][]{\begin{specialsection}{Note}{#1}}{\end{specialsection}}
652 \newenvironment*{notes}[1][]{\begin{specialsection}{Notes}{#1}}{\end{specialsection}}
653 \newenvironment*{tip}[1][]{\begin{specialsection}{Tip}{#1}}{\end{specialsection}}
654 \newenvironment*{tips}[1][]{\begin{specialsection}{Tips}{#1}}{\end{specialsection}}
655 \newenvironment*{usecase}[1][]{\begin{specialsection}{Use Case}{#1}\small}{\end{specialsection}}
656 \newenvironment*{usecases}[1][]{\begin{specialsection}{Use Cases}{#1}\small}{\end{specialsection}}
657
658 \newcommand*{\specialcodesectionheading}[1]{\textcolor{\markercolor}{\textbf{\textit{#1}}}}
659 \newenvironment*{specialcodesection}[1]
660 {\Needspace{4\baselineskip}%
661 \begin{tcolorbox}[blanker,
662 borderline west={3pt}{0pt}{\markercolor},
663 breakable,
664 left=15pt]
665 \sf\typogsetupsf
666 \begin{list}
667 {\specialcodesectionheading{#1}}
668 {\itemindent=0pt
669 \labelwidth=20pt
670 \leftmargin=25pt
671 \listparindent=15pt
672 \parsep=0pt
673 \topsep=\medskipamount}
674 \item
675 \nointerlineskip
676 \leavevmode\par
677 \slightlysloppy[2]
678 \noindent}
679 {\end{list}
680 \end{tcolorbox}}
681 \newenvironment*{anticipatedchange}
682 {\begin{specialcodesection}{Anticipated Change}}
683 {\end{specialcodesection}}
684 \newenvironment*{implementationnote}
685 {\begin{specialcodesection}{Implementation Note}}
686 {\end{specialcodesection}}
687 \newenvironment*{knownbug}
688 {\begin{specialcodesection}{Known Bug}}
689 {\end{specialcodesection}}
690
691 \newenvironment*{suspendshortverb}
692 {\DeleteShortVerb{\|}}
693 {\MakeShortVerb{\|}}
694
695 \definecolor{cold-silver}{cmyk}{.08, 0, 0, .18}
696 \newenvironment*{synopsis}
697 {\begin{tcolorbox}[boxrule=.25pt, colback=cold-silver]%
698 \phantomsection}
699 {\end{tcolorbox}}
700
701 \newenvironment*{tablenotes}
702 {\medskip
703 \centering
704 \small
705 \begin{minipage}{\floatcaptionwidth}}
706 {\end{minipage}}
707 \newcommand*{\tablenotemark}[1]{\smash{\textsuperscript{#1}}}
708 \newcommand*{\tablenotesymbol}[1]{% Bringhurst's "traditional order" (p69) from 1 to 6
709 \ifcase#1\relax
710 #1% 0
711 \or \textasteriskcentered% 1
712 \or \textdagger% 2
713 \or \textdaggerdbl% 3
714 \or \textsection% 4
715 \or \textbardbl% 5
716 \or \textsection% 6
717 \or \textasteriskcentered\textasteriskcentered%7
718 \or \textdagger\textdagger%8
719 \or \textdaggerdbl\textdaggerdbl%9
720 \else
721 #1
722 \fi
723 }
724
725 \newcommand*{\termparbox}[1]{\parbox[t]{\linewidth}{#1\bottomstrut}}
726
727 \renewcommand*{\textepsilon}
728 {{\fontencoding{LGR}%
729 \fontfamily{artemisia}% use true Greek font that pairs well with Source Serif
730 \fontsize{1.083\fontdimen6\font}{1.2\fontdimen6\font}% scale up to match Source Serif
731 \selectfont\char101}}
732
733 \newcommand*{\thousandsseparator}{\mbox{,}}
734
735 \ExplSyntaxOn
736 \newcommand*{\titlecase}[1]{\text_titlecase:n {#1}}
737 \ExplSyntaxOff
738
739 \newcommand*{\toccontinuesonnextpage}
740 {\addtocontents{toc}{\par
741 \bigskip
742 \hfill\textit{Table of Contents continued on next page.}\par
743 \protect\clearpage}}
744
745 \newcommand*{\topstrut}{\rule{0pt}{1.3em}}
746
747 \newlength{\ttellipsisgap}
748 \setlength{\ttellipsisgap}{0.4em}
749 \newcommand*{\ttdots}
750 {\setbox0=\hbox{.}%
751 \wd0=0pt%
752 \copy0\kern\ttellipsisgap
753 \copy0\kern\ttellipsisgap
754 \box0\kern\ttellipsisgap}
755
756 \newcommand*{\typogsetuprm}
757 {\typogsetup{raise*=.025em,
758 raisecapitalguillemets=.05em,
759 raiseguillemets=.03333em,
760 raisefiguredash=.05em}}
761 \newcommand*{\typogsetupsf}
762 {\typogsetup{raise*=.06667em,
763 raiseguillemets=.05em}}
764
765 \newcommand*{\unmarkedfntext}[1]
766 {{\def\thefootnote{}\footnote{#1}%
767 \addtocounter{footnote}{-1}}}
768
769 \newcommand*{\userman}[1]{\textbf{\hyperpage{#1}}}%-- https://github.com/ho-tex/hypdoc/issues/11
770 \newcommand*{\usermandef}[1]{\textbf{\itshape\hyperpage{#1}}}
771
772 \newcommand*{\visualpar}{~\textcolor{\markercolor}{\P}\linebreak[1]\enspace}
773
774 \newenvironment*{whittyquote}
775 {\begin{flushright}
776 \sf\typogsetupsf}
777 {\end{flushright}}
778
779 \newenvironment*{widecodeexample}
780 {\begin{widebody}
781 \flushright
782 \begin{minipage}{\textwidth}
783 \ttfamily
784 \begin{tabbing}}
785 {\end{tabbing}
786 \end{minipage}
787 \end{widebody}}
788
789 \NewDocElement[macrolike = true,
790 idxtype = dim.,
791 idxgroup = dimensions,
792 printtype = \textit{dimen}]
793 {LaTeXDimen}{ldimen}
794 \pretocmd{\DescribeLaTeXDimen}{\needspace{25pt}}{\relax}{\PrependingFailed}
795
796 \NewDocElement[macrolike = false,
797 idxtype = enumitem-key,
798 idxgroup = enumitem-keys,
799 printtype = \textit{enumitem key}]
800 {EnumItemKey}{enumitemkey}
801 \pretocmd{\DescribeEnumItemKey}{\needspace{25pt}}{\relax}{\PrependingFailed}
802
803 \NewDocElement[macrolike = true,
804 idxtype = skip,
805 idxgroup = dimensions,
806 printtype = \textit{skip}]
807 {LaTeXSkip}{lskip}
808 \pretocmd{\DescribeLaTeXSkip}{\needspace{25pt}}{\relax}{\PrependingFailed}
809
810 \NewDocElement[macrolike = true,
811 idxtype = counter,
812 idxgroup = \protect\TeX{} counters,
813 printtype = \textit{counter}]
814 {TeXCounter}{tcounter}
815 \pretocmd{\DescribeTeXCounter}{\needspace{25pt}}{\relax}{\PrependingFailed}
816
817
818 \NewMarkClass{QuickReference}
819 \newdimen\qrcolumnwidth
820 \newcommand*{\qrcolumns}{2}
821 \newcommand*{\qrlistparam}{\itemindent=-\leftmargin
822 \itemsep=5pt plus 2pt minus 1pt}
823 \newcommand*{\qrtightspacing}{1}
824 \SetTracking[context = quickreference]{encoding = *, family = {rm*, sf*}}{0}
825
826 \newenvironment*{quickreference}
827 {\NewDocumentCommand{\heading}{s m}
828 {\IfBooleanF{##1}
829 {\pagebreak[3]%
830 \medskip
831 \needspace{2\baselineskip}}%
832 {\sffamily\bfseries\large ##2}}
833 \newcommand*{\sigbrk}
834 {\discretionary{\hbox{\raise .025em \hbox{$\triangleright$}}}
835 {\hbox{\raise .025em \hbox{$\triangleleft$}}}
836 {}}
837 \newcommand*{\horizontalcolumnseparator}
838 {\rule{\dimexpr \qrcolumnwidth * (\qrcolumns - 1) + \columnsep * (\qrcolumns - 2)}{.5pt}}%
839 \newcommand*{\suspendseparator}
840 {\noindent\horizontalcolumnseparator\rule{.5pt}{7pt}}
841 \newcommand*{\resumeseparator}
842 {\hfill\rule[-6.5pt]{.5pt}{7pt}\horizontalcolumnseparator}
843 \setlength{\columnsep}{25pt}%
844 \setbaselineskippercentage{120}%
845 \NewDocumentEnvironment{qritem}{m m O{}}
846 {\item
847 \vtietop[2]
848 \hyperref[##1]{\textnormal{##2}}##3\relax
849 \edef\qrpageref{\pageref{##1}}%
850 \InsertMark{QuickReference}{##2}%
851 \leavevmode
852 \linebreak
853 \ignorespaces}
854 {\leavevmode
855 \unskip
856 \penalty9999\hbox{}\nobreak
857 \hfill\quad
858 \mbox{\footnotesize\textbf{\qrpageref}}}%
859 \newcommand*{\suspendmulticols}
860 {\end{list}%
861 \end{tightspacing}%
862 \end{microtypecontext}%
863 \end{multicols}%
864 \suspendseparator
865 \begin{microtypecontext}{tracking=quickreference}%
866 \begin{tightspacing}[\qrtightspacing]%
867 \begin{list}{}{\qrlistparam}}%
868 \newcommand*{\resumemulticols}
869 {\end{list}%
870 \end{tightspacing}%
871 \end{microtypecontext}%
872 \resumeseparator
873 \begin{multicols}{\qrcolumns}
874 \raggedcolumns
875 \RaggedRight
876 \begin{microtypecontext}{tracking=quickreference}%
877 \begin{tightspacing}[\qrtightspacing]%
878 \begin{list}{}{\qrlistparam}}%
879 \begin{multicols}{\qrcolumns}
880 \global\qrcolumnwidth=\columnwidth
881 \raggedcolumns
882 \RaggedRight
883 \begin{microtypecontext}{tracking=quickreference}%
884 \begin{tightspacing}[\qrtightspacing]%
885 \begin{list}{}{\qrlistparam}}
886 {\end{list}%
887 \end{tightspacing}%
888 \end{microtypecontext}%
889 \end{multicols}}
890
891 \makeatletter
892 \newcommand*{\ps@fancyqr}
893 {\def\@oddhead{\begingroup
894 \sf
895 \kern-\marginparwidth
896 {\letterspacedsmallcaps{Quick Reference}}\hfill
897 \textnormal{\FirstMark{QuickReference}}\enspace\capitalemdash*\enspace
898 \textnormal{\LastMark{QuickReference}}%
899 \endgroup
900 \hfill
901 \thepage}
902 \let\@evenhead=\@oddhead}
903 \makeatother
904
905 \newenvironment{mybibliography}
906 {\begin{RaggedRight}%
907 \def\MakeUppercase##1{\sf\letterspacedsmallcaps{##1}}%
908 \begin{thebibliography}{88}}
909 {\end{thebibliography}%
910 \end{RaggedRight}}
911
912
913 \iffalse
914 %% Linearize document and make it more palpable for pdftotext(1).
915 \OnlyDescription
916
917 \let\oldcode=\code
918 \renewcommand*{\code}[1]{\mbox{\oldcode{#1}}}
919 \let\oldcs=\cs
920 \renewcommand*{\cs}[1]{\mbox{\oldcs{#1}}}
921 \renewcommand*{\footnote}[2][]{\space({#2})\space}
922 \renewcommand*{\footnotetext}[2][]{\space({#2})\space}
923 \let\fuzzy=\sloppy
924 \renewcommand*{\LaTeXe}{LaTeX~2~epsilon}
925 \renewcommand*{\LaTeXIII}{LaTeX~3}
926 \renewcommand*{\LaTeX}{LaTeX}
927 \renewcommand*{\LuaLaTeX}{LUA~LaTeX}
928 \renewcommand*{\LuaTeX}{LUA~TeX}
929 \renewcommand*{\MP}{Meta~Post}
930 \renewcommand*{\marginpar}[1]{\space({#1})\space}
931 \renewcommand*{\moveleft}[2]{#2}
932 \let\oldpagestyle=\pagestyle
933 \renewcommand*{\pagestyle}[1]{\oldpagestyle{plain}}
934 \renewcommand*{\pdfLaTeX}{PDF~LaTeX}
935 \renewcommand*{\pdfTeX}{PDF~TeX}
936 \renewcommand*{\sample}[1]{\mbox{`#1'}}
937 \let\scshape=\relax
938 \let\sf=\relax
939 \let\sffamily=\relax
940 \renewcommand*{\slightlysloppy}[1][]{}
941 \renewenvironment{slightlysloppypar}{}{}
942 \renewenvironment{smoothraggedrightpar}[1][]{}{}
943 \renewenvironment{smoothraggedright}[1][]{}{}
944 \renewcommand*{\marginnote}[1]{#1}
945 \renewcommand*{\shiftedmarginnote}[1]{#1}
946 \renewcommand*{\TeX}{TeX}
947 \renewcommand*{\textsc}[1]{#1}
948
949 \RenewDocumentEnvironment{multicols}{m o o}{}{}
950
951 \lefthyphenmin=62
952 \righthyphenmin=62
953
954 \overfullrule=0pt
955
956 \AtBeginDocument{\sloppy}
957 \fi
958
959
960 \hyphenation{% https://hyphenateit.com/en-us
961 Double-guillemet-left
962 Double-guillemet-right
963 Double-quotes
964 Single-guillemet-left
965 Single-guillemet-right
966 Single-quotes
967 adj-demerits
968 allow-break
969 babel-hyphenation
970 base-line-skip
971 break-penalty
972 breakable-display
973 capital-hyphen
974 capital-inverted-exclamation-mark
975 capital-inverted-question-mark
976 capital-times
977 cite-dash
978 club-penalties
979 cref-range-conjunction
980 display-break
981 display-widow-penalties
982 double-guillemet-right
983 double-hyphen-demerits
984 double-quotes
985 ex-hyphen-penalty
986 figure-dash
987 guille-met
988 guille-mets
989 inter-display-line-penalty
990 inter-text
991 kerned-hyphen
992 last-line-centered
993 last-line-centered-par
994 last-line-fit
995 last-line-fit-par
996 last-line-ragged-left
997 last-line-ragged-left-par
998 left-spaced-endash
999 loose-ness
1000 loose-spacing
1001 lower-case-adjust-label-items
1002 lower-case-label-item-adjustments
1003 make-at-letter
1004 make-at-other
1005 mar-gin-al
1006 math-italic-correction
1007 micro-type
1008 narrow-space
1009 narrow-space-scale
1010 narrow-space-strength
1011 number-dash
1012 par-box
1013 par-indent
1014 parfillskip
1015 pdf-string-def-Disable-Commands
1016 post-display-penalty
1017 pre-display-penalty
1018 raise-capital-guillemets
1019 raise-capital-hyphen
1020 raise-capital-times
1021 raise-inverted-marks
1022 raise-number-dash
1023 right-spaced-endash
1024 Set-Extra-Kerning
1025 set-baseline-skip
1026 set-baseline-skip-percentage
1027 set-font-expand
1028 set-font-shrink
1029 set-font-stretch
1030 set-leading
1031 set-leading-percentage
1032 short-inter-text
1033 shrink-limits
1034 single-guillemet-left
1035 single-guillemet-right
1036 single-quotes
1037 slash-kern
1038 slightly-sloppy
1039 slightly-sloppy-par
1040 sloppy-par
1041 smooth-ragged-right-fuzz-factor
1042 smooth-ragged-right-generator
1043 smooth-ragged-right-left-skip
1044 smooth-ragged-right-par
1045 smooth-ragged-right-par-indent
1046 smooth-ragged-right-rag-width
1047 smooth-ragged-right-shape-quintuplet
1048 smooth-ragged-right-shape-septuplet
1049 smooth-ragged-right-shape-triplet
1050 space-skip
1051 spaced-capital-emdash
1052 spaced-capital-endash
1053 spaced-dash
1054 spaced-emdash
1055 spaced-endash
1056 stretch-limits
1057 text-exclam-down
1058 text-italic-correction
1059 text-question-down
1060 tight-spacing
1061 tracing-boxes
1062 tracing-para-graphs
1063 tracking-tt-spacing
1064 typog-get
1065 typog-setup
1066 upper-case-adjust-label-items
1067 upper-case-label-item-adjustments
1068 vtie-bot
1069 vtie-bot-disp
1070 vtie-bot-disp-par
1071 vtie-bot-disp-top-par
1072 vtie-bot-par
1073 vtie-top
1074 vtie-top-par
1075 wide-space
1076 wide-space-scale
1077 wide-space-strength
1078 widow-penalties
1079 }
1080
1081
1082 \begin{document}
1083 \typogsetuprm
1084 \uppercaseadjustlabelitems{*}
1085 \DocInput{typog.dtx}
1086 \end{document}
1087 %</driver>
1088 %<*index-style>
1089 actual '='
1090 delim_0 "\\nobreak\\enspace"
1091 delim_1 "\\nobreak\\enspace"
1092 delim_2 "\\nobreak\\enspace"
1093 delim_r "\\nohyperpage{\\figuredash*}"
1094 heading_prefix "\\pagebreak[3]\\smallskip\n\n{\\sffamily\\bfseries\\large\\indexgroup "
1095 heading_suffix "}\\nopagebreak\n"
1096 headings_flag 1
1097 level '>'
1098 line_max 65536
1099 quote '!'
1100 %</index-style>
1101 %<*changes-style>
1102 actual '='
1103 delim_0 "\\nobreak\\enspace"
1104 delim_1 "\\nobreak\\enspace"
1105 delim_2 "\\nobreak\\enspace"
1106 heading_prefix "\\pagebreak[3]\\smallskip\n\n{\\sffamily\\bfseries\\large "
1107 heading_suffix "}\\nopagebreak\n"
1108 headings_flag 0
1109 item_x1 "\\efill\n\\subitem "
1110 item_x2 "\\ "
1111 keyword "\\glossaryentry"
1112 level '>'
1113 line_max 65536
1114 postamble "\n\\end{theglossary}\n"
1115 preamble "\\begin{theglossary}\n \\makeatletter\\scan@allowedfalse"
1116 quote '!'
1117 %</changes-style>
1118 % \fi
1119 %
1120 %
1121 % \DoNotIndex{\,}
1122 % \DoNotIndex{\\}
1123 % \DoNotIndex{\addtocounter,\addtolength,\advance,\aftergroup,\allowdisplaybreaks,\arabic,\arraystretch}
1124 % \DoNotIndex{\AfterEndPreamble,\AfterPreamble,\AtBeginDocument,\autotransfer}
1125 % \DoNotIndex{\baselineskip,\begin,\begingroup,\booltrue,\box}
1126 % \DoNotIndex{\c,\char,\clist,\clubpenalties,\clubpenalty,\count,\cs,\csname}
1127 % \DoNotIndex{\DeclareRobustCommand,\def,\define@choicekey,\define@key,\detokenize}
1128 % \DoNotIndex{\dim,\dimen,\dimexpr,\discretionary,\displaywidowpenalties,\displaywidowpenalty,\dp}
1129 % \DoNotIndex{\edef,\else,\emergencystretch,\empty,\end,\endcsname,\endgroup}
1130 % \DoNotIndex{\endlastlineflushrightpar}
1131 % \DoNotIndex{\endlastlineraggedleftpar}
1132 % \DoNotIndex{\endnofontexpand,\endnofontexpansion}
1133 % \DoNotIndex{\endsmoothraggedrightshapequintuplet}
1134 % \DoNotIndex{\endsmoothraggedrightshapeseptuplet}
1135 % \DoNotIndex{\endsmoothraggedrightshapetriplet}
1136 % \DoNotIndex{\endtypoginspect}
1137 % \DoNotIndex{\exhyphenpenalty,\expandafter,\ExplSyntaxOff,\ExplSyntaxOn}
1138 % \DoNotIndex{\fi,\finalhyphendemerits,\font,\fontdimen,\forcsvlist,\fp,\fpeval,\fussy,\futurelet}
1139 % \DoNotIndex{\gdef,\global,\glueexpr,\@gobble}
1140 % \DoNotIndex{\guillemotleft,\guillemotright,\guilsinglleft,\guilsinglright}
1141 % \DoNotIndex{\hbadness,\hbox,\hfuzz,\hskip,\hspace,\ht}
1142 % \DoNotIndex{\ignorespaces,\ignorespacesafterend}
1143 % \DoNotIndex{\if,\ifblank,\ifbool,\IfBooleanT,\IfBooleanTF,\ifcase,\ifdefined,\ifdim,\iffalse,\ifmmode}
1144 % \DoNotIndex{\ifMT@expansion,\@ifnextchar,\IfNoValueF,\IfNoValueTF,\ifnum,\ifodd,\ifstrequal}
1145 % \DoNotIndex{\iftypog@microtype@loadedfalse}
1146 % \DoNotIndex{\iftypog@microtype@preloadedfalse}
1147 % \DoNotIndex{\ifvmode,\ifx,\ignorespaces,\inputlineno,\int,\interlinepenalty,\itemize}
1148 % \DoNotIndex{\jobname}
1149 % \DoNotIndex{\kern}
1150 % \DoNotIndex{\l,\labelitemi,\labelitemii,\labelitemiii,\labelitemiv}
1151 % \DoNotIndex{\lastlinefit,\lastlineflushrightpar,\lastlineraggedleftpar,\lastskip}
1152 % \DoNotIndex{\lefthyphenmin,\leftmargin,\leftskip,\let,\letcs}
1153 % \DoNotIndex{\linepenalty,\linewidth,\@listdepth,\loop,\looseness,\lsstyle}
1154 % \DoNotIndex{\@M,\m@th,\mathbin,\mathord,\maxdimen,\mbox,\message,\microtypecontext,\microtypesetup}
1155 % \DoNotIndex{\@minus,\mkern,\m@ne,\mspace,\MT@letterspace@,\MT@MT,\muexpr}
1156 % \DoNotIndex{\@ne,\NeedsTeXFormat,\newbool,\NewDocumentCommand,\NewDocumentEnvironment}
1157 % \DoNotIndex{\newcommand,\newenvironment}
1158 % \DoNotIndex{\newcounter,\newdimen,\newif,\newlength,\newline,\newmuskip}
1159 % \DoNotIndex{\nobreak,\nofontexpand,\nofontexpansion,\nr,\numexpr}
1160 % \DoNotIndex{\or,\optarg}
1161 % \DoNotIndex{\p@,\PackageError,\PackageWarning,\PackageWarningNoLine}
1162 % \DoNotIndex{\par,\parfillskip,\parindent,\parshape,\patchcmd,\pdf@strcmp}
1163 % \DoNotIndex{\pdfstringdefDisableCommands}
1164 % \DoNotIndex{\penalty,\@plus,\PopPostHook,\postdisplaypenalty,\predisplaypenalty,\prg}
1165 % \DoNotIndex{\pretolerance,\protected,\ProvidesPackage,\PushPostHook}
1166 % \DoNotIndex{\raisebox,\refstepcounter,\relax,\RenewExpandableDocumentCommand,\repeat,\RequirePackage}
1167 % \DoNotIndex{\righthyphenmin,\rightskip,\rlap,\romannumeral,\rule}
1168 % \DoNotIndex{\seq,\setbox,\setcounter,\SetEnumitemKey,\SetExpansion,\setkeys,\setlength,\setstretch}
1169 % \DoNotIndex{\showboxbreadth,\showboxdepth,\skip,\sloppy}
1170 % \DoNotIndex{\smoothraggedrightpar}
1171 % \DoNotIndex{\smoothraggedrightshapequintuplet}
1172 % \DoNotIndex{\smoothraggedrightshapeseptuplet}
1173 % \DoNotIndex{\smoothraggedrightshapetriplet}
1174 % \DoNotIndex{\space,\spaceskip,\stepcounter,\str,\@strength,\string}
1175 % \DoNotIndex{\textemdash,\textendash,\textexclamdown,\textquestiondown}
1176 % \DoNotIndex{\textsf,\textsl,\texttimes,\textwidth,\the,\times,\tl}
1177 % \DoNotIndex{\token,\tolerance,\tracingnone,\tracingpages,\tracingparagraphs}
1178 % \DoNotIndex{\typeout,\typog,\typogadjuststairsfor,\typoginspect,\typoglogo}
1179 % \DoNotIndex{\unhbox,\unless,\unskip}
1180 % \DoNotIndex{\val,\value,\vbadness,\vfuzz}
1181 % \DoNotIndex{\wd,\widowpenalties,\widowpenalty}
1182 % \DoNotIndex{\z@,\z@skip}
1183 %
1184 %
1185 % \changes{v0.1}{2024-3-7}{Initial version.}
1186 %
1187 %
1188 % \pagenumbering{roman}
1189 %
1190 % \title{\vspace{-30pt}%
1191 % {\sffamily\elseries\fontsize{84}{0}\selectfont
1192 % \textls[-30]{\typoglogo}} \\[30pt]
1193 % \large A \LaTeX{} Package for Micro-Typographic Enhancements}
1194 % \author{Ch.~L.~Spiel\footnote{\quarterspace\texttt{[email protected]}}}
1195 % \date{\fileversion\qquad \filedate}
1196 % \maketitle
1197 % \thispagestyle{empty}
1198 %
1199 % \begin{abstract}
1200 % \begin{lastlinecenteredpar}
1201 % \hyphenpenalty=5000\noindent
1202 % The \packagename{typog} package provides macros and environments to improve
1203 % micro-typographic quality. It enables fine-tuning of hyphenation, spacing, font
1204 % adjustments, and alignment. Features include control over \TeX's paragraph
1205 % justification, customizable spacing, font characteristic adjustments, and specialized
1206 % environments for precise paragraph layout and alignment.
1207 % \end{lastlinecenteredpar}
1208 % \end{abstract}
1209 %
1210 %
1211 % \iffalse
1212 %<*title>
1213 prologues := 3;
1214 truecorners := 1;
1215 linecap := butt;
1216
1217 string roman_font;
1218 roman_font := "pplr8r"; % URW Palladio L - Roman
1219
1220 string italic_font;
1221 italic_font := "pplri8r"; % URW Palladio L - Italic
1222
1223 picture dash_dotted;
1224 dash_dotted := dashpattern(on 3 off 3 on 0 off 3);
1225
1226 u := 280;
1227
1228 font_scale := 20;
1229
1230 pair loc[];
1231 loc[1] := .2[origin, (u, 0)];
1232 loc[2] := .5[origin, (u, 0)];
1233 loc[3] := .8[origin, (u, 0)];
1234
1235 pair slant_vector;
1236 slant_vector := (63, 150);
1237
1238 pair raise_vector[];
1239 raise_vector[0] := (0, 44);
1240 raise_vector[1] := (0, 61);
1241 raise_vector[2] := (0, 54);
1242 raise_vector[3] := (0, 71);
1243
1244
1245 picture letter_V;
1246 letter_V := thelabel.top("V" infont roman_font scaled font_scale, loc[1]);
1247
1248 picture normal_hyphen;
1249 normal_hyphen := thelabel.top("-" infont roman_font scaled font_scale, loc[2] + raise_vector[0]);
1250
1251 picture raised_hyphen;
1252 raised_hyphen := thelabel.top("-" infont roman_font scaled font_scale, loc[2] + raise_vector[1]);
1253
1254 picture letter_A;
1255 letter_A := thelabel.top("A" infont roman_font scaled font_scale, loc[3]);
1256
1257
1258 beginfig(1);
1259 draw letter_V;
1260 draw normal_hyphen withcolor .9 white;
1261 draw raised_hyphen;
1262 draw letter_A;
1263
1264 pickup pencircle scaled .4pt;
1265 draw (loc[1] -- loc[1] + slant_vector) shifted (7, 0) dashed evenly;
1266 draw (loc[1] -- loc[1] + slant_vector) shifted (27, 0) dashed evenly;
1267 draw (loc[1] -- loc[1] + slant_vector) shifted (80, 0) dashed evenly;
1268 draw (loc[3] -- loc[3] + slant_vector) shifted (-68, 0) dashed evenly;
1269
1270 draw .35[origin, (u, 0)] + raise_vector[2] -- .8[origin, (u, 0)] + raise_vector[2]
1271 dashed dash_dotted withcolor .6white;
1272 draw .35[origin, (u, 0)] + raise_vector[3] -- .8[origin, (u, 0)] + raise_vector[3]
1273 dashed dash_dotted;
1274 endfig;
1275 end
1276 %</title>
1277 % \fi
1278 %
1279 % \vfill
1280 %
1281 % \begin{center}
1282 % \includegraphics{title-1.eps}
1283 % \end{center}
1284 %
1285 % \vfill
1286 %
1287 % \begin{lastlinecenteredpar}
1288 % \footnotesize
1289 % \noindent
1290 % This package is copyright \textcopyright~2024, 2025 Ch.~L.~Spiel. It may be distributed
1291 % and\kernedslash*or modified under the conditions of the
1292 % \href{https://www.latex-project.org/lppl.txt}{\LaTeX{} Project Public License}
1293 % \acronym{(LPPL)}, either version~1.3c of this license or\leftspacedendash at your
1294 % option\rightspacedendash any later version. This work has the \acronym{LPPL} maintenance
1295 % status \doublequotes{author-maintained}.
1296 % \end{lastlinecenteredpar}
1297 %
1298 %
1299 % \clearpage
1300 % \pagestyle{pagenumberonly}
1301 %
1302 % \unmarkedfntext{The font sample on the title page was generated with the help of \MP{} using
1303 % \doublequotes{\acronym{URW}~Palladio}.%
1304 % \detoxindex{font>typeface>URW Palladio=\acronym{URW} Palladio|userman}}
1305 %
1306 % \begin{nofontexpansion}
1307 % \begin{nocharprotrusion}
1308 % \tableofcontents
1309 % \end{nocharprotrusion}
1310 % \end{nofontexpansion}
1311 %
1312 % \addtocontents{toc}{%
1313 % \protect\begin{whittyquote}
1314 % Hoffentlich wird es nicht so schlimm, wie es schon ist! \\
1315 % \capitalemdash*~\propername{Karl Valentin}
1316 % \protect\end{whittyquote}\par}
1317 %
1318 % \vspace{\fill}
1319 %
1320 % \begin{nofontexpansion}
1321 % \begin{nocharprotrusion}
1322 % \listoftables
1323 % \end{nocharprotrusion}
1324 % \end{nofontexpansion}
1325 %
1326 % \vspace{\fill}
1327 %
1328 %
1329 % \clearpage
1330 % \pagestyle{fancy}
1331 % \phantomsection
1332 % \addcontentsline{toc}{section}{\protect\numberline{}Quick Reference}
1333 % \addtocontents{toc}{\medskip}
1334 % \section*{Quick Reference}
1335 % \markboth{\sf\letterspacedsmallcaps{Quick Reference}}{\sf\letterspacedsmallcaps{Quick Reference}}
1336 % \index{quick reference|(userman}
1337 %
1338 % This is an alphabetically sorted list of all user macros and environments defined by
1339 % package~\packagename{typog} along with the page numbers of their descriptions.
1340 % \marginnote{In the multi-column parts of the Quick Reference, we reduce the line spacing from
1341 % 125\% to 120\% with
1342 % \hyperref[syn:setbaselineskippercentage]{\cs{set\-base\-line\-skip\-per\-cent\-age}}, and the
1343 % inter-word spacing by 1.25\% with \hyperref[syn:tightspacing]{\code{tightspacing}}. List
1344 % \cs{item}s get tied with \hyperref[syn:vtietop]{\cs{vtietop}}.}\relax
1345 % A list of all \hyperref[sec:package-options]{package options} can be found on
1346 % pages~\pageref{sec:package-options} to~\pageref{secend:package-options}. The
1347 % \hyperref[sec:index]{Index} on pages~\pageref{sec:index} to~\pageref{secend:index} may
1348 % provide some more detailed insights.
1349 %
1350 % If a line break occurs between the macro and its arguments or between any of the arguments,
1351 % we indicate the break with a triangle at the end of the initial line and at the beginning of
1352 % the following line.
1353 %
1354 % \bigskip
1355 %
1356 % \begin{widebody}
1357 % \begin{quickreference}
1358 % \item\relax
1359 % \hspace{\leftmargin}\heading*{A}
1360 % \qritem{syn:Adjustedlabelitem}{\cs{Adjustedlabelitemi}}
1361 % Typeset an uppercase-adjusted \cs{label\-itemi}.
1362 % \endqritem
1363 %
1364 % \qritem{syn:adjustedlabelitem}{\cs{adjustedlabelitemi}}
1365 % Typeset a lowercase-adjusted \cs{label\-itemi}.
1366 % \endqritem
1367 %
1368 % \qritem{syn:Adjustedlabelitem}{\cs{Adjustedlabelitemii}}
1369 % Typeset an uppercase-adjusted \cs{label\-itemii}.
1370 % \endqritem
1371 %
1372 % \qritem{syn:adjustedlabelitem}{\cs{adjustedlabelitemii}}
1373 % Typeset a lowercase-adjusted \cs{label\-itemii}.
1374 % \endqritem
1375 %
1376 % \qritem{syn:Adjustedlabelitem}{\cs{Adjustedlabelitemiii}}
1377 % Typeset an uppercase-adjusted \cs{label\-itemiii}.
1378 % \endqritem
1379 %
1380 % \qritem{syn:adjustedlabelitem}{\cs{adjustedlabelitemiii}}
1381 % Typeset a lowercase-adjusted \cs{label\-itemiii}.
1382 % \endqritem
1383 %
1384 % \qritem{syn:Adjustedlabelitem}{\cs{Adjustedlabelitemiv}}
1385 % Typeset an uppercase-adjusted \cs{label\-itemiv}.
1386 % \endqritem
1387 %
1388 % \qritem{syn:adjustedlabelitem}{\cs{adjustedlabelitemiv}}
1389 % Typeset a height-adjusted \cs{label\-itemiv}.
1390 % \endqritem
1391 %
1392 % \qritem{syn:allowhyphenation}{\cs{allow\-hyphenation}}
1393 % (Re-)enable automatic hyphenation.
1394 % \endqritem
1395 %
1396 % \heading{B}
1397 % \qritem{syn:breakabledisplay}{\code{breakable\-display}}[\sigbrk\oarg{level}]
1398 % Adjust the penalty associated with \cs{allowdisplaybreaks}.
1399 % \endqritem
1400 %
1401 % \qritem{syn:breakpoint}{\cs{breakpoint*}}
1402 % Insert an empty discretionary.
1403 % \endqritem
1404 %
1405 % \qritem{syn:breakpoint}{\cs{breakpoint}}
1406 % Insert an empty discretionary and re-enable automatic hyphenation.
1407 % \endqritem
1408 %
1409 % \heading{C}
1410 % \qritem{syn:capitaldash}{\cs{capitaldash*}}
1411 % Alias for \cs{capitalendash*}.
1412 % \endqritem
1413 %
1414 % \qritem{syn:capitaldash}{\cs{capitaldash}}
1415 % Alias for \cs{capitalendash}.
1416 % \endqritem
1417 %
1418 % \qritem{syn:capitalemdash}{\cs{capitalemdash*}}
1419 % Typeset a vertically adjusted \cs{textemdash}.
1420 % \endqritem
1421 %
1422 % \qritem{syn:capitalemdash}{\cs{capitalemdash}}
1423 % Typeset a vertically adjusted \cs{textemdash} that is breakable.
1424 % \endqritem
1425 %
1426 % \qritem{syn:capitalendash}{\cs{capitalendash*}}
1427 % Typeset a vertically adjusted \cs{textendash}.
1428 % \endqritem
1429 %
1430 % \qritem{syn:capitalendash}{\cs{capitalendash}}
1431 % Typeset a vertically adjusted \cs{textendash} that is breakable.
1432 % \endqritem
1433 %
1434 % \qritem{syn:capitalhyphen}{\cs{capitalhyphen*}}
1435 % Typeset a vertically adjusted hyphen character.
1436 % \endqritem
1437 %
1438 % \qritem{syn:capitalhyphen}{\cs{capitalhyphen}}
1439 % Typeset a vertically adjusted hyphen character that is breakable.
1440 % \endqritem
1441 %
1442 % \qritem{syn:capitalinvertedexclamationmark}{\cs{capital\-inverted\-exclamation\-mark}}
1443 % [\sigbrk\marg{number}]
1444 % Typeset an inverted (\singlequotes{upside-down}) exclamation mark that is level with
1445 % the baseline.
1446 % \endqritem
1447 %
1448 % \qritem{syn:capitalinvertedquestionmark}{\cs{capital\-inverted\-question\-mark}}
1449 % [\sigbrk\marg{number}]
1450 % Typeset an inverted (\singlequotes{upside-down}) question mark that is level with the
1451 % baseline.
1452 % \endqritem
1453 %
1454 % \qritem{syn:capitaltimes}{\cs{capitaltimes}}
1455 % Typeset a vertically adjusted \cs{texttimes}.
1456 % \endqritem
1457 %
1458 % \qritem{syn:covernextindentpar}{\code{cover\-next\-indent\-par}}[\sigbrk\oarg{dim}]
1459 % Extend the last line of a paragraph.
1460 % \endqritem
1461 %
1462 % \heading{D}
1463 % \qritem{syn:Doubleguillemetleft}{\cs{Double\-guillemet\-left}}
1464 % Typeset left double guillemets vertically adjusted for uppercase.
1465 % \endqritem
1466 %
1467 % \qritem{syn:Doubleguillemetright}{\cs{Double\-guillemet\-right}}
1468 % Typeset right double guillemets vertically adjusted for uppercase.
1469 % \endqritem
1470 %
1471 % \qritem{syn:doubleguillemetleft}{\cs{double\-guillemet\-left}}
1472 % Typeset left double guillemets vertically adjusted for lowercase.
1473 % \endqritem
1474 %
1475 % \qritem{syn:doubleguillemetright}{\cs{double\-guillemet\-right}}
1476 % Typeset right double guillemets vertically adjusted for lowercase.
1477 % \endqritem
1478 %
1479 % \heading{F}
1480 % \qritem{syn:figuredash}{\cs{figuredash*}}
1481 % Typeset a \cs{textendash} vertically adjusted for figures (numerals).
1482 % \endqritem
1483 %
1484 % \qritem{syn:figuredash}{\cs{figuredash}}
1485 % Typeset a breakable \cs{textendash} vertically adjusted for figures (numerals).
1486 % \endqritem
1487 %
1488 % \qritem{syn:fontsizeinfo}{\cs{fontsize\-info}}[\sigbrk\marg{csname}]
1489 % Store the current em-heigh and \cs{baselineskip} in a pair of macros.
1490 % \endqritem
1491 %
1492 % \heading{H}
1493 % \qritem{syn:hyphenmin}{\code{hyphenmin}}[\sigbrk\oarg{left-min}\sigbrk\marg{right-min}]
1494 % Set the values of \cs{lefthyphenmin} and \cs{righthyphenmin}.
1495 % \endqritem
1496 %
1497 % \heading{I}
1498 % \qritem{syn:itcorr}{\cs{itcorr*}}[\sigbrk\marg{strength}]
1499 % Apply italic correction in the form of a \cs{kern} scaled by
1500 % \code{textitaliccorrection}.
1501 % \endqritem
1502 %
1503 % \qritem{syn:itcorr}{\cs{itcorr}}[\sigbrk\marg{strength}]
1504 % Apply italic correction in the form of a \cs{kern} scaled by
1505 % \cs{fontdim1} or \code{textitaliccorrection}.
1506 % \endqritem
1507 %
1508 % \heading{K}
1509 % \qritem{syn:kernedhyphen}{\cs{kernedhyphen*}}
1510 % [\sigbrk\oarg{raise}\sigbrk\marg{left-kern}\sigbrk\marg{right-kern}]
1511 % Typeset an unbreakable hyphen and apply kerning to its left and right.
1512 % \endqritem
1513 %
1514 % \qritem{syn:kernedhyphen}{\cs{kernedhyphen}}
1515 % [\sigbrk\oarg{raise}\sigbrk\marg{left-kern}\sigbrk\marg{right-kern}]
1516 % Typeset a breakable hyphen and apply kerning to its left and right.
1517 % \endqritem
1518 %
1519 % \qritem{syn:kernedslash}{\cs{kernedslash*}}
1520 % Typeset an unbreakable forward slash and apply kerning to both its left and right
1521 % sides.
1522 % \endqritem
1523 %
1524 % \qritem{syn:kernedslash}{\cs{kernedslash}}
1525 % Typeset a breakable forward slash and apply kerning to both its left and right sides.
1526 % \endqritem
1527 %
1528 % \heading{L}
1529 % \qritem{syn:lastlinecenteredpar}{\code{last\-line\-centered\-par}}
1530 % Center the last lines of a paragraph.
1531 % \endqritem
1532 %
1533 % \qritem{syn:lastlinefitpar}{\code{last\-line\-fit\-par}}
1534 % Match the spacing of last line and next-to-last line.
1535 % \endqritem
1536 %
1537 % \qritem{syn:lastlineflushrightpar}{\code{last\-line\-flush\-right\-par}}
1538 % Alias for \code{lastlineraggedleftpar}.
1539 % \endqritem
1540 %
1541 % \qritem{syn:lastlineraggedleftpar}{\code{last\-line\-ragged\-left\-par}}
1542 % Align the last line of paragraph flush right.
1543 % \endqritem
1544 %
1545 % \qritem{syn:leftkernedhyphen}{\cs{left\-kerned\-hyphen*}}
1546 % [\sigbrk\oarg{raise}\sigbrk\marg{left-kern}]
1547 % Typeset a hyphen and apply kerning to its left-hand side.
1548 % \endqritem
1549 %
1550 % \qritem{syn:leftkernedhyphen}{\cs{left\-kerned\-hyphen}}
1551 % [\sigbrk\oarg{raise}\sigbrk\marg{left-kern}]
1552 % Typeset a hyphen, apply kerning to its left-hand side, and insert a breakpoint after
1553 % it.
1554 % \endqritem
1555 %
1556 % \qritem{syn:spacedendash}{\cs{left\-spaced\-dash*}}[\sigbrk\oarg{raise}]
1557 % Alias for \cs{left\-spaced\-endash*}.
1558 %
1559 % \qritem{syn:spacedemdash}{\cs{left\-spaced\-dash}}[\sigbrk\oarg{raise}]
1560 % Alias for \cs{left\-spaced\-emdash}.
1561 %
1562 % \qritem{syn:spacedemdash}{\cs{left\-spaced\-emdash*}}[\sigbrk\oarg{raise}]
1563 % Typeset an em-dash with some space around it. Prohibit line breaks before and after
1564 % it.
1565 %
1566 % \qritem{syn:spacedemdash}{\cs{left\-spaced\-emdash}}[\sigbrk\oarg{raise}]
1567 % Typeset an em-dash with some space around it. Allow line breaks at its left-hand side.
1568 %
1569 % \qritem{syn:spacedendash}{\cs{left\-spaced\-endash*}}[\sigbrk\oarg{raise}]
1570 % Typeset an en-dash with some space around it. Prohibit line breaks before and after
1571 % it.
1572 %
1573 % \qritem{syn:spacedendash}{\cs{left\-spaced\-endash}}[\sigbrk\oarg{raise}]
1574 % Typeset an en-dash with some space around it. Allow line breaks at its left-hand side.
1575 %
1576 % \qritem{syn:loosespacing}{\code{loose\-spacing}}[\sigbrk\oarg{level}]
1577 % Increase the width of the space character.
1578 % \endqritem
1579 %
1580 % \qritem{syn:lowercaseadjustlabelitems}{\cs{lowercase\-adjust\-label\-items}}
1581 % [\sigbrk\marg{levels}]
1582 % Activate the lowercase height-adjustment values inside \code{itemize}~environments.
1583 % \endqritem
1584 %
1585 % \heading{N}
1586 % \qritem{syn:narrowspace}{\cs{narrowspace*}}
1587 % Typeset a narrow space whose width depends on \cs{fontdimen7}.
1588 % \endqritem
1589 %
1590 % \qritem{syn:narrowspace}{\cs{narrowspace}}
1591 % Typeset a narrow space whose width depends on \cs{fontdimen7} or \cs{fontdimen2}.
1592 % \endqritem
1593 %
1594 % \qritem{syn:noadjustlabelitems}{\cs{no\-adjust\-label\-items}}
1595 % [\sigbrk\marg{levels}]
1596 % Deactivate height-adjustment of label items.
1597 % \endqritem
1598 %
1599 % \qritem{syn:nocharprotrusion}{\code{nocharprotrusion}}
1600 % Deactivate character protrusion.
1601 % \endqritem
1602 %
1603 % \qritem{syn:nofontexpansion}{\code{nofontexpand}}
1604 % Alias for \code{nofontexpansion}.
1605 % \endqritem
1606 %
1607 % \qritem{syn:nofontexpansion}{\code{nofontexpansion}}
1608 % Deactivate font expansion.
1609 % \endqritem
1610 %
1611 % \qritem{syn:nolig}{\cs{nolig*}}[\oarg{kerning}]
1612 % Break a ligature.
1613 % \endqritem
1614 %
1615 % \qritem{syn:nolig}{\cs{nolig}}[\oarg{kerning}]
1616 % Break a ligature and introduce a hyphenation opportunity.
1617 % \endqritem
1618 %
1619 % \heading{O}
1620 % \qritem{syn:openlastlinepar}{\code{openlastlinepar}}[\sigbrk\oarg{dim}]
1621 % Open a paragraph's last line if it is almost full or completely filled.
1622 % \endqritem
1623 %
1624 % \heading{P}
1625 % \qritem{syn:prolongpar}{\code{prolongpar}}
1626 % Increase the \cs{looseness} of a paragraph.
1627 % \endqritem
1628 %
1629 % \heading{R}
1630 % \qritem{syn:resetbaselineskip}{\cs{reset\-baseline\-skip}}
1631 % Reset \cs{baselineskip} to its original value.
1632 % \endqritem
1633 %
1634 % \qritem{syn:rightkernedhyphen}{\cs{right\-kerned\-hyphen*}}
1635 % [\sigbrk\oarg{raise}\sigbrk\marg{right-kern}]
1636 % Typeset a hyphen and apply kerning to its right-hand side.
1637 % \endqritem
1638 %
1639 % \qritem{syn:rightkernedhyphen}{\cs{right\-kerned\-hyphen}}
1640 % [\sigbrk\oarg{raise}\sigbrk\marg{right-kern}]
1641 % Typeset a hyphen, apply kerning to its right-hand side, and insert a breakpoint after
1642 % it.
1643 % \endqritem
1644 %
1645 % \qritem{syn:spacedendash}{\cs{right\-spaced\-dash*}}[\sigbrk\oarg{raise}]
1646 % Alias for \cs{right\-spaced\-endash*}.
1647 %
1648 % \qritem{syn:spacedendash}{\cs{right\-spaced\-dash}}[\sigbrk\oarg{raise}]
1649 % Alias for \cs{right\-spaced\-endash}.
1650 %
1651 % \qritem{syn:spacedemdash}{\cs{right\-spaced\-emdash*}}[\sigbrk\oarg{raise}]
1652 % Typeset an em-dash with some space around it. Prohibit line breaks before and after
1653 % it.
1654 %
1655 % \qritem{syn:spacedemdash}{\cs{right\-spaced\-emdash}}[\sigbrk\oarg{raise}]
1656 % Typeset an em-dash with some space around it. Allow line breaks at its right-hand
1657 % side.
1658 %
1659 % \qritem{syn:spacedendash}{\cs{right\-spaced\-endash*}}[\sigbrk\oarg{raise}]
1660 % Typeset an en-dash with some space around it. Prohibit line breaks before and after
1661 % it.
1662 %
1663 % \qritem{syn:spacedendash}{\cs{right\-spaced\-endash}}[\sigbrk\oarg{raise}]
1664 % Typeset an en-dash with some space around it. Allow line breaks at its right-hand
1665 % side.
1666 %
1667 % \heading{S}
1668 % \qritem{syn:setbaselineskippercentage}{\cs{set\-baseline\-skip\-percentage}}
1669 % [\sigbrk\marg{percentage}]
1670 % Set \cs{baselineskip} as a percentage relative to the point size of the font.
1671 % \endqritem
1672 %
1673 % \qritem{syn:setbaselineskip}{\cs{set\-baseline\-skip}}[\sigbrk\marg{baselineskip}]
1674 % Set \cs{baselineskip} using an absolute length.
1675 % \endqritem
1676 %
1677 % \qritem{syn:setfontexpand}{\code{setfontexpand}}[\sigbrk\oarg{level}]
1678 % Simultaneously set font stretch and shrink limits.
1679 % \endqritem
1680 %
1681 % \qritem{syn:setfontshrink}{\code{setfontshrink}}[\sigbrk\oarg{level}]
1682 % Set font shrink limits.
1683 % \endqritem
1684 %
1685 % \qritem{syn:setfontstretch}{\code{setfontstretch}}[\sigbrk\oarg{level}]
1686 % Set font stretch limits.
1687 % \endqritem
1688 %
1689 % \qritem{syn:setfonttracking}{\code{setfonttracking}}[\sigbrk\marg{delta}]
1690 % Override the default tracking for all fonts.
1691 % \endqritem
1692 %
1693 % \qritem{syn:setleadingpercentage}{\cs{set\-leading\-percentage}}
1694 % [\sigbrk\marg{percentage}]
1695 % Set \cs{baselineskip} as a percentage using the leading.
1696 % \endqritem
1697 %
1698 % \qritem{syn:setleading}{\cs{setleading}}[\sigbrk\marg{leading}]
1699 % Set \cs{baselineskip} using the leading.
1700 % \endqritem
1701 %
1702 % \qritem{syn:shortenpar}{\code{shortenpar}}
1703 % Decrease the \cs{looseness} of a paragraph.
1704 % \endqritem
1705 %
1706 % \qritem{syn:Singleguillemetleft}{\cs{Single\-guillemet\-left}}
1707 % Typeset left single guillemets vertically adjusted for uppercase.
1708 % \endqritem
1709 %
1710 % \qritem{syn:Singleguillemetright}{\cs{Single\-guillemet\-right}}
1711 % Typeset right single guillemets vertically adjusted for uppercase.
1712 % \endqritem
1713 %
1714 % \qritem{syn:singleguillemetleft}{\cs{single\-guillemet\-left}}
1715 % Typeset left single guillemets vertically adjusted for lowercase.
1716 % \endqritem
1717 %
1718 % \qritem{syn:singleguillemetright}{\cs{single\-guillemet\-right}}
1719 % Typeset right single guillemets vertically adjusted for lowercase.
1720 % \endqritem
1721 %
1722 % \qritem{syn:slightlysloppypar}{\code{slightly\-sloppy\-par}}[\sigbrk\oarg{sloppiness}]
1723 % Format a paragraph with given sloppiness.
1724 % \endqritem
1725 %
1726 % \qritem{syn:slightlysloppy}{\cs{slightlysloppy}}[\sigbrk\oarg{sloppiness}]
1727 % Format using the given sloppiness.
1728 % \endqritem
1729 %
1730 % \qritem{syn:smoothraggedright}{\code{smoothraggedright}}[{[\meta{option}\dots]}]
1731 % Format with one of the three smooth-ragged-right generators.
1732 % \endqritem
1733 %
1734 % \qritem{syn:smoothraggedrightfuzzfactor}{\cs{smooth\-ragged\-right\-fuzz\-factor}}[\marg{factor}]
1735 % Relative amount of glue in smooth-ragged-right typeset lines.
1736 % \endqritem
1737 %
1738 % \qritem{syn:smoothraggedrightgenerator}{\cs{smooth\-ragged\-right\-generator}}[\marg{generator}]
1739 % Name of the basis environment (\singlequotes{generator}) used in the environments
1740 % \code{smooth\-ragged\-right} and \code{smooth\-ragged\-right\-par}.
1741 % \endqritem
1742 %
1743 % \qritem{syn:smoothraggedrightleftskip}{\cs{smooth\-ragged\-right\-left\-skip}}
1744 % Value for \code{leftskip} that \code{smooth\-ragged\-right} and
1745 % \code{smooth\-ragged\-right\-par} pass to the smooth-ragged-right generator.
1746 % \endqritem
1747 %
1748 % \qritem{syn:smoothraggedrightpar}{\code{smoothraggedrightpar}}[{[\meta{option}\dots]}]
1749 % Format a paragraph using one of the three smooth-ragged-right generators.
1750 % \endqritem
1751 %
1752 % \qritem{syn:smoothraggedrightparindent}{\cs{smooth\-ragged\-right\-par\-indent}}
1753 % Value for \code{parindent} that \code{smooth\-ragged\-right} and
1754 % \code{smooth\-ragged\-right\-par} pass to the smooth-ragged-right generator.
1755 % \endqritem
1756 %
1757 % \qritem{syn:smoothraggedrightragwidth}{\cs{smooth\-ragged\-right\-rag\-width}}
1758 % Value for the width of the smooth-ragged-right margin in environments
1759 % \code{smooth\-ragged\-right} and \code{smooth\-ragged\-right\-par}.
1760 % \endqritem
1761 %
1762 %
1763 % \suspendmulticols
1764 %
1765 %
1766 % \qritem{syn:smoothraggedrightshapequintuplet}{\code{smoothraggedrightshapequintuplet}}
1767 % [{[\meta{option}\dots]}\marg{width1}\dots\marg{width5}]
1768 % Prescribe five line lengths for formatting paragraphs.
1769 % \endqritem
1770 %
1771 % \qritem{syn:smoothraggedrightshapeseptuplet}{\code{smoothraggedrightshapeseptuplet}}
1772 % [{[\meta{option}\dots]}\marg{width1}\dots\marg{width7}]
1773 % Prescribe seven line lengths for formatting paragraphs.
1774 % \endqritem
1775 %
1776 % \qritem{syn:smoothraggedrightshapetriplet}{\code{smoothraggedrightshapetriplet}}
1777 % [{[\meta{option}\dots]}\marg{width1}\marg{width2}\marg{width3}]
1778 % Prescribe three line lengths for formatting paragraphs.
1779 % \endqritem
1780 %
1781 %
1782 % \resumemulticols
1783 %
1784 %
1785 % \qritem{syn:spacedcapitalemdash}{\cs{spacedcapitalemdash*}}
1786 % Typeset a height-adjusted em-dash with some space around it. Prohibit line breaks
1787 % before and after the dash.
1788 % \endqritem
1789 %
1790 % \qritem{syn:spacedcapitalemdash}{\cs{spacedcapitalemdash}}
1791 % Typeset a height-adjusted em-dash with some space around it.
1792 % \endqritem
1793 %
1794 % \qritem{syn:spacedcapitalendash}{\cs{spacedcapitalendash*}}
1795 % Typeset a height-adjusted en-dash with some space around it. Prohibit line breaks
1796 % before and after the dash.
1797 % \endqritem
1798 %
1799 % \qritem{syn:spacedcapitalendash}{\cs{spacedcapitalendash}}
1800 % Typeset a height-adjusted em-dash with some space around it.
1801 % \endqritem
1802 %
1803 % \qritem{syn:spacedendash}{\cs{spaceddash*}}[\oarg{raise}]
1804 % Alias for \cs{rightspacedendash*}.
1805 % \endqritem
1806 %
1807 % \qritem{syn:spacedendash}{\cs{spaceddash}}[\oarg{raise}]
1808 % Alias for \cs{rightspacedendash}.
1809 % \endqritem
1810 %
1811 % \qritem{syn:spacedemdash}{\cs{spacedemdash*}}[\oarg{raise}]
1812 % Alias for \cs{rightspacedemdash*}.
1813 % \endqritem
1814 %
1815 % \qritem{syn:spacedemdash}{\cs{spacedemdash}}[\oarg{raise}]
1816 % Alias for \cs{rightspacedemdash}.
1817 % \endqritem
1818 %
1819 % \qritem{syn:spacedendash}{\cs{spacedendash*}}[\oarg{raise}]
1820 % Alias for \cs{rightspacedendash*}.
1821 % \endqritem
1822 %
1823 % \qritem{syn:spacedendash}{\cs{spacedendash}}[\oarg{raise}]
1824 % Alias for \cs{rightspacedendash}.
1825 % \endqritem
1826 %
1827 % \qritem{syn:splicevtietop}{\cs{splicevtietop}}[\sigbrk\marg{lines}]
1828 % Inside of a \code{list}-like environment, fuse the first lines.
1829 % \endqritem
1830 %
1831 % \heading{T}
1832 % \qritem{syn:tightspacing}{\code{tightspacing}}[\sigbrk\oarg{level}]
1833 % Decrease the width of the space character.
1834 % \endqritem
1835 %
1836 % \qritem{syn:typogadjuststairs}{\cs{typog\-adjust\-stairs}}
1837 % [\sigbrk\oarg{factor}\sigbrk\marg{step}\sigbrk\marg{count}\sigbrk\marg{sample}]
1838 % Generate \singlequotes{stairs} of vertically shifted label items.
1839 % \endqritem
1840 %
1841 % \qritem{syn:typogfontsize}{\cs{typogfontsize}}
1842 % The default font's quad size.
1843 % \endqritem
1844 %
1845 % \qritem{syn:typoggetnth}{\cs{typoggetnth}}
1846 % [\sigbrk\marg{dest}\sigbrk\marg{key}\sigbrk\marg{index}]
1847 % Retrieve single item of a \packagename{typog} compound configuration value.
1848 % \endqritem
1849 %
1850 % \qritem{syn:typogget}{\cs{typogget}}[\sigbrk\marg{key}]
1851 % Retrieve a \packagename{typog} configuration value.
1852 % \endqritem
1853 %
1854 % \qritem{syn:typoginspectpar}{\code{typoginspectpar}}[\sigbrk\oarg{option}\sigbrk\marg{id}]
1855 % Turn on tracing of paragraphs and pages for a paragraph.
1856 % \endqritem
1857 %
1858 % \qritem{syn:typoginspect}{\code{typoginspect}}[\sigbrk\oarg{option}\sigbrk\marg{id}]
1859 % Turn on tracing of paragraphs and pages.
1860 % \endqritem
1861 %
1862 % \qritem{syn:typoglowercaseadjustcheck}{\cs{typog\-lowercase\-adjust\-check}}
1863 % [\sigbrk\oarg{factor}\sigbrk\marg{sample}]
1864 % Typeset all four label items adjusted for lowercase with an indicator line.
1865 % \endqritem
1866 %
1867 % \qritem{syn:typogsetup}{\code{typogsetup}}[\sigbrk\marg{keys}]
1868 % Configure package \packagename{typog}.
1869 % \endqritem
1870 %
1871 % \qritem{syn:typoguppercaseadjustcheck}{\cs{typog\-uppercase\-adjust\-check}}
1872 % [\sigbrk\oarg{factor}\sigbrk\marg{sample}]
1873 % Typeset all four label items adjusted for uppercase with an indicator line.
1874 % \endqritem
1875 %
1876 % \heading{U}
1877 % \qritem{syn:uppercaseadjustlabelitems}{\cs{uppercase\-adjust\-label\-items}}
1878 % [\sigbrk\marg{levels}]
1879 % Activate the uppercase height-adjustment values inside \code{itemize}~environments.
1880 % \endqritem
1881 %
1882 % \heading{V}
1883 % \qritem{syn:vtiebotdisptoppar}{\code{vtie\-bot\-disp\-top\-par}}
1884 % [\sigbrk\oarg{num-before-lines}\sigbrk\oarg{num-after-lines}]
1885 % Fuse a display with its preceding and following lines.
1886 % \endqritem
1887 %
1888 % \qritem{syn:vtiebotdisp}{\code{vtiebotdisp}}[\sigbrk\oarg{num-lines}]
1889 % Fuse a display with its preceding lines.
1890 % \endqritem
1891 %
1892 % \qritem{syn:vtiebotpar}{\code{vtiebotpar}}[\sigbrk\oarg{num-lines}]
1893 % Fuse the final lines of a paragraph.
1894 % \endqritem
1895 %
1896 % \qritem{syn:vtiebot}{\cs{vtiebot}}[\sigbrk\oarg{num-lines}]
1897 % Fuse final lines.
1898 % \endqritem
1899 %
1900 % \qritem{syn:vtietoppar}{\code{vtietoppar}}[\sigbrk\oarg{num-lines}]
1901 % Fuse the first lines of a paragraph.
1902 % \endqritem
1903 %
1904 % \qritem{syn:vtietop}{\code{vtietop}}[\sigbrk\oarg{num-lines}]
1905 % Fuse first lines.
1906 % \endqritem
1907 %
1908 % \qritem{syn:vtietop}{\cs{vtietop}}[\sigbrk\oarg{num-lines}]
1909 % Fuse first lines.
1910 % \endqritem
1911 %
1912 % \heading{W}
1913 % \qritem{syn:widespace}{\cs{widespace*}}
1914 % Typeset a wide space whose width depends on \cs{fontdimen7}.
1915 % \endqritem
1916 %
1917 % \qritem{syn:widespace}{\cs{widespace}}
1918 % Typeset a wide space whose width depends on \cs{fontdimen7} or \cs{fontdimen2}.
1919 % \endqritem
1920 % \end{quickreference}
1921 % \sectionfinish
1922 % \end{widebody}
1923 % \index{quick reference|)userman}
1924 %
1925 %
1926 % \clearpage
1927 % \pagestyle{fancy}
1928 % \pagenumbering{arabic}
1929 % \section{Introduction}\label{sec:introduction}
1930 %
1931 % \begin{whittyquote}
1932 % \doublequotes{Good typography} is the minimum acceptable solution; \\
1933 % \doublequotes{fine typography} is what we aspire to. \\
1934 % \capitalemdash*~\propername{Ilene Strizver}
1935 % \end{whittyquote}
1936 %
1937 % \noindent
1938 % \LaTeX{} is the beginning of good typesetting\spacedemdash not the end. This package
1939 % provides some tools for even better looking documents. When applied correctly, its effects
1940 % appear subtle and inconspicuous. However, it's a long ball game.
1941 %
1942 %
1943 % \subsection{Overview}\label{sec:overview}
1944 %
1945 % The primary focus of \packagename{typog} are micro-typographic improvements, where it tries
1946 % to hit it out of the ballpark in terms of typographic polish.
1947 %
1948 % \Cref{sec:setup} presents how to reconfigure package~\packagename{typog} after it has been
1949 % loaded and how to access its configuration values for introspection or inclusion in the
1950 % user's own code. \Cref{sec:information} addresses the need for more information in the
1951 % typesetting process whether during the draft phase or in the final printed
1952 % manuscript.\marginnote{Throughout the whole document we indicate actual uses of the package's
1953 % macros and environments in the margin. All these notes are examples themselves, as they are
1954 % typeset using \hyperref[syn:slightlysloppy]{\code{slightlysloppy}},
1955 % \hyperref[syn:loosespacing]{\code{loosespacing}}, and
1956 % \hyperref[syn:smoothraggedrightpar]{\code{smoothraggedrightpar}}.\visualpar The title page
1957 % has already demonstrated the effect of
1958 % \hyperref[syn:lastlinecenteredpar]{\code{lastlinecenteredpar}} in justified paragraphs for
1959 % the abstract and the copyright notice.} \Cref{sec:latex-hyphenation} expands the hyphenation
1960 % facilities of \LaTeX. \Cref{sec:break-ligatures,sec:manual-italic-correction} treat the
1961 % breaking of ligatures and the manual application of italic correction\spacedemdash in a
1962 % generalized way. \Cref{sec:extra-kerning} introduces macros to kern or space some
1963 % punctuation signs. \Cref{sec:raise-characters} deals with vertically positioning glyphs in a
1964 % more visually pleasing manner. \Cref{sec:adjust-label-items} also deals with vertical
1965 % alignment and explains how to height-adjust the labels in |itemize|~lists to perfection,
1966 % whether the items are followed by uppercase or by lowercase letters.
1967 % \Cref{sec:align-last-line,sec:fill-last-line} discuss much-needed macros for better control
1968 % of the last line of a paragraph. \Cref{sec:spacing-control} covers the manipulation of
1969 % paragraph spacing. \Cref{sec:microtype-frontend} details the \packagename{microtype}
1970 % front end: font tracking~(\ref{sec:tracking-control}), font
1971 % expansion~(\ref{sec:font-expansion-control}), and character
1972 % protrusion~(\ref{sec:protrusion}). In \cref{sec:sloppy-paragraphs}, we address some
1973 % shortcomings of spacing control with a replacement for the macro~\cs{sloppy} and the related
1974 % environment~\code{sloppypar}. \Cref{sec:vtie-paragraph} presents several specialized
1975 % functions to avoid club or widow lines in a paragraph. As a simple extension of displayed
1976 % mathematical equations, we define a breakable variant in \cref{sec:breakable-display}.
1977 % \Cref{sec:setspace-frontend} introduces the \packagename{setspace} front end. In the last
1978 % part, \cref{sec:smooth-ragged}, we introduce a novel way of generating ragged paragraphs,
1979 % which is still experimental.
1980 %
1981 %
1982 % \subsection{Prerequisites}\label{sec:packageprerequisites}
1983 %
1984 % Package \packagename{typog} requires \eTeX; it relies on the \LaTeXIII{}~interface. Parts of
1985 % it are based on packages \packagename{microtype}~\cite{package:microtype} and
1986 % \packagename{setspace}~\cite{package:setspace}. However, if the functionality is not used,
1987 % \packagename{typog} can be used without \packagename{microtype}. The same holds true for the
1988 % \packagename{setspace} front end.
1989 %
1990 % The package was tested with
1991 % \programname{pdfTeX}~3.141592653\capitalhyphen*2.6\capitalhyphen*1.40.24 from the TeX~Live
1992 % distribution of~2022, as shipped by
1993 % \href{https://packages.debian.org/search?keywords=texlive}{Debian}.
1994 %
1995 %
1996 % \sectionfinish
1997 % \clearpage
1998 % \section{Package Options}\label{sec:package-options}
1999 % \index{package option|(usermandef}
2000 %
2001 % The \packagename{typog} package is loaded as usual via \cs{usepackage}. It can be configured
2002 % during loading with package \meta{OPTIONs} or later on with
2003 % \hyperref[syn:typogsetup]{\code{typogsetup}}, as described in \cref{sec:setup}. Since
2004 % \packagename{typog} provides front ends to packages~\packagename{microtype} and
2005 % \packagename{setspace}, we mention them in the synopsis; they are \emph{not} automatically
2006 % loaded by \packagename{typog}.
2007 %
2008 % \begin{synopsis}
2009 % \begin{tabbing}
2010 % |\usepackage[|\,\ttdots|]{microtype}|
2011 % \=\texttt{\%\space}\textit{Only required for macros and} \\
2012 % \>\texttt{\%\space}\textit{environments in \cref{sec:microtype-frontend}.} \\
2013 % \\[-.5em]
2014 % |\usepackage[|\,\ttdots|]{setspace}|
2015 % \=\texttt{\%\space}\textit{Only required for macros in \cref{sec:setspace-frontend}.} \\
2016 % \\[-.5em]
2017 % |\usepackage[|\meta{OPTION}\ttdots|]{typog}|
2018 % \end{tabbing}
2019 % \end{synopsis}
2020 %
2021 % The package \meta{OPTIONs} also serve as configuration \meta{key}s unless noted otherwise.
2022 % This means, they can be set with \hyperref[syn:typogsetup]{\code{typogsetup}} and their
2023 % values can be retrieved with \hyperref[syn:typogget]{\cs{typogget}}. Options that rely on
2024 % package~\packagename{microtype} are indicated with \doublequotes{\microtyperequiredmarker}.
2025 %
2026 % \begin{typogsetup}{}
2027 % \begin{description}
2028 % [before={\let\oldmakelabel=\makelabel
2029 % \renewcommand{\makelabel}[1]
2030 % {\oldmakelabel{\termparbox{##1}}\phantomsection}},
2031 % font=\normalfont,
2032 % style=nextline,
2033 % vtietop]
2034 % \item[|breakpenalty=|\meta{penalty}]\label{item:breakpenalty}
2035 % \indexpackageoptiondefinition{breakpenalty}
2036 % \shiftedmarginnote{This subsection is typeset with all \packagename{typog}~parameters
2037 % reset to their defaults by wrapping it in a
2038 % \hyperref[syn:typogsetup]{\code{typogsetup}}~environment with an empty argument.}
2039 % Penalty for a line break at various points. Default value:
2040 % \the\typogget{breakpenalty}, initialized by the current \cs{exhyphenpenalty}:
2041 % \the\exhyphenpenalty.
2042 %
2043 % \item[|debug|, |nodebug|]\label{item:debug}
2044 % \indexpackageoptiondefinition{debug}
2045 % \indexpackageoptiondefinition{nodebug}
2046 % Write some package-specific debug information to the \filesystem{log}~file. Opposite:
2047 % |nodebug|. The default is not to record debug information.
2048 %
2049 % These two options cannot be used with \hyperref[syn:typogsetup]{\code{typogsetup}} or
2050 % \hyperref[syn:typogget]{\cs{typogget}}.
2051 %
2052 % \item[|emdashspace|=\meta{glue}]\label{item:emdashspace}
2053 % \indexpackageoptiondefinition{emdashspace}
2054 % \sinceversion{Since v0.5}
2055 % Set the horizontal skip that is inserted before and after the em-dash in
2056 % macros~\hyperref[syn:spacedemdash]{\cs{spacedemdash}} and
2057 % \hyperref[syn:spacedcapitalemdash]{\cs{spacedcapitalemdash}} to \meta{glue}. Default
2058 % value: \milliemglue{\typogget{emdashspace}}.
2059 %
2060 % \item[|endashspace|=\meta{glue}]\label{item:endashspace}
2061 % \indexpackageoptiondefinition{endashspace}
2062 % \sinceversion{Since v0.5}
2063 % Set the horizontal skip that is inserted before and after the en-dash in
2064 % macros~\hyperref[syn:spacedendash]{\cs{spacedendash}} and
2065 % \hyperref[syn:spacedcapitalendash]{\cs{spacedcapitalendash}} to \meta{glue}. Default
2066 % value: \milliemglue{\typogget{endashspace}}.
2067 %
2068 % \item[|ligaturekern=|\meta{dim}]\label{item:ligaturekern}
2069 % \indexpackageoptiondefinition{ligaturekern}
2070 % Set \meta{dim} of the kern that is inserted to split a ligature in
2071 % macro~\hyperref[syn:nolig]{\cs{nolig}}. See \cref{sec:break-ligatures}. Default
2072 % value: \milliem{\typogget{ligaturekern}}.
2073 %
2074 % \item[|lowercaselabelitemadjustments=\{|\meta{dim-1}, \dots, \meta{dim-4}|\}|]%
2075 % \label{item:lowercaselabelitemadjustments}
2076 % \indexpackageoptiondefinition{lowercase\-labelitem\-adjustments}
2077 % \sinceversion{Since v0.4}
2078 % Vertical shifts \meta{dim-N} to apply to \cs{labelitem}\meta{N}, where \meta{N}= 1, 2, 3,
2079 % or~4 is the nesting level of the |itemize|~list. Empty list elements are ignored. The
2080 % special value~\samplestar{} instructs \packagename{typog} to preserve \meta{dim-N} at
2081 % that position. The adjustments apply to the lowercase setting
2082 % (\hyperref[syn:lowercaseadjustlabelitems]{\code{\string\lowercaseadjustlabelitems}}).
2083 % See \cref{sec:adjust-label-items} (in particular subsection~\singlequotes{Setup} and
2084 % \cref{tab:labelitemadjustvalues} on \cpageref{tab:labelitemadjustvalues}) and also
2085 % configuration option
2086 % \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaseadjustlabelitem}}.
2087 %
2088 % All four lengths default to \formatdimen*{0pt}.
2089 %
2090 % \begin{important}
2091 % \slightlysloppy
2092 % \noindent
2093 % Configuring \code{lowercaselabelitemadjustments} (or
2094 % \code{uppercaselabelitemadjustments}) does \emph{not} activate the correction
2095 % mechanism. Use one of the macros \code{\string\lowercaseadjustlabelitems} or
2096 % \code{\string\uppercaseadjustlabelitems} for that purpose.
2097 % \end{important}
2098 %
2099 % \item[|lowerslash=|\meta{dim}]\label{item:lowerslash}
2100 % \indexpackageoptiondefinition{lowerslash}
2101 % \sinceversion{Since v0.5}
2102 % Lower the slash typeset by \hyperref[syn:kernedslash]{\cs{kernedslash}}. Positive
2103 % lengths~\meta{dim} \emph{lower} the glyph, negative ones raise it. This is the opposite
2104 % \singlequotes{direction} of \cs{raisebox}. See \cref{sec:slash-with-kern}. Default
2105 % value: \milliem{\typogget{lowerslash}}.
2106 %
2107 % \item[|mathitaliccorrection=|\meta{dim}]\label{item:mathitaliccorrection}
2108 % \indexpackageoptiondefinition{mathitaliccorrection}
2109 % \sinceversion{Renamed in v0.5}
2110 % Italic correction in math mode. See \cref{sec:manual-italic-correction} and also the
2111 % complementary configuration
2112 % option~\hyperref[item:textitaliccorrection]{|textitaliccorrection|}. Default
2113 % value: \the\typogget{mathitaliccorrection}.\!\footnote{Note that 1\,mu is
2114 % \nativetextfraction{1}{18}\,em of the mathematical font's~em.}
2115 %
2116 % \item[|raise*=|\meta{dim}]\label{item:raise}
2117 % \indexpackageoptiondefinition{raise*}
2118 % Set the length by which selected characters (dash, hyphen, times, and number dash) are
2119 % raised. Default value: \formatdimen*{0pt}.\shiftedmarginnote{We access all the (default)
2120 % configuration values with \hyperref[syn:typogget]{\cs{typogget}}.}
2121 %
2122 % Only the raise amounts for guillemets and inverted marks are unaffected by this option.
2123 %
2124 % This option neither can be used with \hyperref[syn:typogsetup]{\code{typogsetup}} nor
2125 % with \hyperref[syn:typogget]{\cs{typogget}}; however, the specific options influenced by
2126 % it can.
2127 %
2128 % \item[|raisecapitaldash=|\meta{dim}]\label{item:raisecapitaldash}
2129 % \indexpackageoptiondefinition{raisecapitaldash}
2130 % Set the length that the \cs{textendash} is raised in
2131 % \hyperref[syn:capitaldash]{\cs{capitaldash}}. See \cref{sec:capital-dash}. Default
2132 % value: \milliem{\the\typogget{raisecapitaldash}}.
2133 %
2134 % \item[|raisecapitalguillemets=|\meta{dim}]\label{item:raisecapitalguillemets}
2135 % \indexpackageoptiondefinition{raisecapitalguillemets}
2136 % Set the length that single and double guillemets are raised in the uppercase versions of
2137 % the guillemet macros. See \cref{sec:guillemets}. Default
2138 % value: \milliem{\the\typogget{raisecapitalguillemets}}.
2139 %
2140 % \item[|raisecapitalhyphen=|\meta{dim}]\label{item:raisecapitalhyphen}
2141 % \indexpackageoptiondefinition{raisecapitalhyphen}
2142 % Set the length that the hyphen character~\sample{-} is raised in
2143 % \hyperref[syn:capitalhyphen]{\cs{capitalhyphen}}. See \cref{sec:capital-hyphen}.
2144 % Default value: \milliem{\the\typogget{raisecapitalhyphen}}.
2145 %
2146 % \item[|raisecapitaltimes=|\meta{dim}]\label{item:raisecapitaltimes}
2147 % \indexpackageoptiondefinition{raisecapitaltimes}
2148 % Set the length that the multiplication symbol~\sample{\texttimes} is raised in
2149 % \hyperref[syn:capitaltimes]{\cs{capitaltimes}}. See \cref{sec:mult-sign}. Default
2150 % value: \milliem{\the\typogget{raisecapitaltimes}}.
2151 %
2152 % \item[|raisefiguredash=|\meta{dim}]\label{item:raisefiguredash}
2153 % \indexpackageoptiondefinition{raisefiguredash}
2154 % Set the length that the \cs{textendash} is raised in
2155 % \hyperref[syn:figuredash]{\cs{figuredash}}. See \cref{sec:number-dash}. Default
2156 % value: \milliem{\the\typogget{raisefiguredash}}.
2157 %
2158 % \item[|raiseguillemets=|\meta{dim}]\label{item:raiseguillemets}
2159 % \indexpackageoptiondefinition{raiseguillemets}
2160 % Set the length that single and double guillemets are raised in the lowercase versions of
2161 % the guillemet macros. See \cref{sec:guillemets}. Default
2162 % value: \milliem{\the\typogget{raiseguillemets}}.
2163 %
2164 % \item[|raiseinvertedmarks=\{|\meta{dim-1}, \meta{dim-2}, \meta{dim-3}|\}|]\label{item:raiseinvertedmarks}
2165 % \indexpackageoptiondefinition{raiseinvertedmarks}
2166 % \sinceversion{Since v0.5}
2167 % Set the lengths by which the macros
2168 % \hyperref[syn:capitalinvertedexclamationmark]{\cs{capitalinvertedexclamationmark}} and
2169 % \hyperref[syn:capitalinvertedquestionmark]{\cs{capitalinvertedquestionmark}} raise their
2170 % associated inverted exclamation marks and inverted question marks. Each dimension
2171 % corresponds to the optional indices of the macros. See \cref{sec:inverted-marks}.
2172 %
2173 % A \meta{dim-N} of \formatdimen*{0pt} means to \doublequotes{auto level} the mark; if a
2174 % \mbox{(quasi-)}\breakpoint zero manual correction is desired, use, for example, 1\,sp.
2175 % Empty list elements are ignored. The special value~\samplestar{} instructs
2176 % \packagename{typog} to preserve \meta{dim-N} at that position. Default values:
2177 % \typoggetnth{\dimen0}{raiseinvertedmarks}{1}\milliem{\the\dimen0},
2178 % \typoggetnth{\dimen0}{raiseinvertedmarks}{2}\milliem{\the\dimen0},
2179 % \typoggetnth{\dimen0}{raiseinvertedmarks}{3}\milliem{\the\dimen0}.
2180 %
2181 % \item[|shrinklimits=\{|\meta{limit-1}, \meta{limit-2}, \meta{limit-3}|\}|\quad\microtyperequiredmarker\label{item:shrinklimits} \\
2182 % |stretchlimits=\{|\meta{limit-1}, \meta{limit-2}, \meta{limit-3}|\}|\quad\microtyperequiredmarker]\label{item:stretchlimits}
2183 % \indexpackageoptiondefinition{shrinklimits}
2184 % \indexpackageoptiondefinition{stretchlimits}
2185 % Set the three limits, given in \nativetextfraction{1}{1000}\,em, of shrinkability and
2186 % stretchability for the levels. They are used in
2187 % \hyperref[syn:setfontshrink]{\code{setfontshrink}} (|shrinklimits| only),
2188 % \hyperref[syn:setfontstretch]{\code{setfontstretch}} (|stretchlimits| only), and
2189 % \hyperref[syn:setfontexpand]{\code{setfontexpand}} (both sets). See
2190 % \cref{sec:font-expansion-control}.
2191 %
2192 % New \meta{limit-\#} values replace old ones. If one or more limits of the triple should
2193 % remain unchanged pass a \samplestar{} instead of a number.
2194 %
2195 % \makeatletter
2196 % Defaults for |shrinklimits| are \mbox{\typog@default@shrink@i, \typog@default@shrink@ii,
2197 % \typog@default@shrink@iii} and those for |stretchlimits| are
2198 % \mbox{\typog@default@stretch@i, \typog@default@stretch@ii, \typog@default@stretch@iii}.
2199 % \makeatother
2200 %
2201 % Both options can be used when loading the package and in the document preamble, but
2202 % \emph{not} in the document body.
2203 %
2204 % \item[|slashkern=|\meta{dim}]\label{item:slashkern}
2205 % \indexpackageoptiondefinition{slashkern}
2206 % Set the size of the kerns before and after \hyperref[syn:kernedslash]{\cs{kernedslash}}.
2207 % See \cref{sec:slash-with-kern}. Default value: \milliem{\typogget{slashkern}}.
2208 %
2209 % \item[|textitaliccorrection=|\meta{dim}]\label{item:textitaliccorrection}
2210 % \indexpackageoptiondefinition{textitaliccorrection}
2211 % \sinceversion{Renamed in v0.5}
2212 % Italic correction fallback value; used if \cs{fontdimen1} is zero. See
2213 % \cref{sec:manual-italic-correction} on manual italic correction and also the
2214 % complementary configuration
2215 % option~\hyperref[item:mathitaliccorrection]{|mathitaliccorrection|}. Default value:
2216 % \milliem{\typogget{textitaliccorrection}}.
2217 %
2218 % \item[|trackingttspacing=|\code{\{\meta{outer-spacing}\}}\quad\microtyperequiredmarker]\label{item:trackingttspacing}
2219 % \indexpackageoptiondefinition{trackingttspacing}
2220 % Set the outer spacing of all typewriter fonts when used in the
2221 % \code{settracking}~environment as described in \cref{sec:tracking-control}.
2222 %
2223 % The argument \meta{outer-spacing} gets passed to \packagename{microtype}'s
2224 % \cs{SetTracking} option~\code{outer spacing}~\cite[Sec.~5.3]{package:microtype}. If the
2225 % argument contains commas, enclose the whole argument in curly braces. Default argument
2226 % value: \mbox{\typogget{trackingttspacing}}.
2227 %
2228 % The option can be used when loading the package and in the document preamble, but
2229 % \emph{not} in the document body.
2230 %
2231 % By default, this option is unset.
2232 %
2233 % \item[|uppercaselabelitemadjustments=\{|\meta{dim-1}, \dots, \meta{dim-4}|\}|]%
2234 % \label{item:uppercaselabelitemadjustments}
2235 % \indexpackageoptiondefinition{uppercase\-labelitem\-adjustments}
2236 % \sinceversion{Since v0.4}
2237 % Vertical shifts \meta{dim-N} to apply to \cs{labelitem}\meta{N}, where \meta{N}=1, 2, 3,
2238 % or~4 is the nesting level of the |itemize|~list. Empty list elements are ignored. The
2239 % special value~\samplestar{} instructs \packagename{typog} to preserve \meta{dim-N} at
2240 % that position. The adjustments apply to the uppercase setting
2241 % (\hyperref[syn:uppercaseadjustlabelitems]{\code{\string\uppercaseadjustlabelitems}}).
2242 % See \cref{sec:adjust-label-items} (in particular subsection~\singlequotes{Setup} and
2243 % \cref{tab:labelitemadjustvalues} on \cpageref{tab:labelitemadjustvalues}) and also
2244 % configuration option
2245 % \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaseadjustlabelitem}}.
2246 %
2247 % All four lengths default to \formatdimen*{0pt}.
2248 %
2249 % \begin{important}
2250 % \slightlysloppy
2251 % \noindent
2252 % Configuring \code{uppercaselabelitemadjustments} (or
2253 % \code{lowercaselabelitemadjustments}) does \emph{not} activate the correction
2254 % mechanism. Use one of the macros
2255 % \hyperref[syn:uppercaseadjustlabelitems]{\cs{uppercaseadjustlabelitems}} or
2256 % \hyperref[syn:lowercaseadjustlabelitems]{\cs{lowercaseadjustlabelitems}} for that
2257 % purpose.\label{secend:package-options}
2258 % \end{important}
2259 % \end{description}
2260 % \end{typogsetup}
2261 % \index{package option|)usermandef}
2262 %
2263 %
2264 % \sectionfinish
2265 % \clearpage
2266 % \section{Macros and Environments}\label{sec:macros-and-envs}
2267 %
2268 % \begin{whittyquote}
2269 % Easy things should be easy, and \\
2270 % hard things should be possible. \\
2271 % \capitalemdash*~\propername{Larry Wall}
2272 % \end{whittyquote}
2273 %
2274 % \noindent
2275 % This is the \doublequotes{User Manual}~section of the documentation, where we describe all
2276 % user-relevant macros and environments that are defined in package~\packagename{typog}.
2277 %
2278 % We follow the naming convention that every environment whose name ends with
2279 % \mbox{\code{\ttdots}\:\code{par}} issues a \cs{par} at its end. Environments with different
2280 % name suffixes never close with~\cs{par}.
2281 %
2282 %
2283 % \subsection{Setup and Reconfiguration}\label{sec:setup}
2284 %
2285 % \DescribeEnv{typogsetup}
2286 % Configure\index{configuration|userman}\index{setup|userman} the package with the given
2287 % \meta{keys}. An empty argument of \code{typogsetup} resets all \meta{keys} to their default
2288 % values.
2289 %
2290 % \begin{synopsis}\label{syn:typogsetup}
2291 % \cs{begin}|{typogsetup}|\marg{keys}
2292 % \ttdots{}
2293 % \cs{end}|{typogsetup}|
2294 % \end{synopsis}
2295 %
2296 % The package can be (re-)configured\index{reconfigure|userman} at any point with
2297 % \cs{typogsetup}\marg{keys}, or\leftspacedendash for localized changes\rightspacedendash as
2298 %
2299 % \begin{codeexample}
2300 % 12\=\kill
2301 % \cs{begin}|{typogsetup}|\marg{keys} \\
2302 % \> \ttdots \\
2303 % \cs{end}|{typogsetup}|
2304 % \end{codeexample}
2305 %
2306 % \noindent
2307 % where \meta{keys} have the same format as the package options described in
2308 % \cref{sec:package-options}.
2309 %
2310 % \begin{tip}
2311 % Use \code{\string\PassOptionsToPackage\{\meta{keys}\}\{typog\}} to pass \meta{keys} to
2312 % \packagename{typog} before loading it and \code{\string\typogsetup\{\meta{keys}\}} after
2313 % \code{\string\usepackage\{typog\}}.
2314 % \end{tip}
2315 %
2316 % \begin{usecases}
2317 % \cs{typogsetup} can substitute configuring the package at load time or serve as an
2318 % addition.\visualpar Using the |typogsetup|~environment allows to fine-tune the parameters
2319 % for a specific use, e.\,g., display-sized text.\visualpar It even is conceivable that a
2320 % well-established \packagename{typog}-configuration could be attached to font-changing
2321 % macros like \cs{rm}, \cs{sf}, or~\cs{tt}.
2322 % \end{usecases}
2323 %
2324 %
2325 % \noindent
2326 % \DescribeMacro{\typogget}
2327 % Sometimes the user needs to access configuration values of package~\packagename{typog}. This
2328 % can be done in a safe way without resorting to code that is bracketed by \cs{makeatletter}
2329 % and \cs{makeatother} using of the following macro.
2330 %
2331 % \begin{synopsis}\label{syn:typogget}
2332 % \cs{typogget}\marg{key}
2333 % \end{synopsis}
2334 %
2335 % Retrieve the configuration value that is associated with~\meta{key}. For a list of available
2336 % \meta{key}s see~\cref{sec:package-options}.
2337 %
2338 % \begin{usecase}
2339 % Raise glyphs by the same amount as configured with \packagename{typog}.
2340 %
2341 % \begin{codeexample}
2342 % 12\=\kill
2343 % \cs{newcommand*}\{\cs{seesubst}\} \\
2344 % \> \{\cs{raisebox}\= \{\cs{typogget}\{raisecapitalguillemets\}\}\% \\
2345 % \> \> \{\cs{rightarrowhead}\}\} \\
2346 % \cs{renewcommand*}\{\cs{labelitemi}\} \\
2347 % \> \{\cs{raisebox}\= \{\cs{typogget}\{raisecapitaldash\}\}\{\cs{cdot}\}\}
2348 % \end{codeexample}
2349 %
2350 % The latter only is useful inside of an \code{itemize}~environment of course. Compare with
2351 % the solution in \cref{sec:adjust-label-items} offered by \packagename{typog} since v0.4.
2352 % \end{usecase}
2353 %
2354 % \DescribeMacro{\typoggetnth}
2355 % \sinceversion{Since v0.4}
2356 % If a configuration item is associated with a list of values as
2357 % \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}},
2358 % \hyperref[item:shrinklimits]{\code{shrinklimits}},
2359 % \hyperref[item:stretchlimits]{\code{stretchlimits}},
2360 % \hyperref[item:trackingttspacing]{\code{trackingttspacing}}, and
2361 % \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}} are, it
2362 % may be convenient to fetch a particular list element of it.
2363 %
2364 % \begin{synopsis}\label{syn:typoggetnth}
2365 % \cs{typoggetnth}\marg{csname}\marg{key}\marg{index} \\
2366 % \cs{typoggetnth}\marg{dimen-register}\marg{key}\marg{index}
2367 % \end{synopsis}
2368 %
2369 % Retrieve the configuration value\spacedemdash which is a comma-separated list\spacedemdash
2370 % that is associated with~\meta{key} and store the item having position~\meta{index} in
2371 % \meta{dimen-register} or the parameter-less, global macro~\meta{csname}. The destination
2372 % \meta{dimen-register} may be predefined like, e.\,g., \cs{dimen0} or user-defined.
2373 % Dimensions can also be stored in a macro by using the \meta{csname}~form of \cs{typoggetnth}
2374 % but not vice versa.
2375 %
2376 % Index into the list either from left to right with positive indices starting at~\(1\) up to
2377 % the length of the list, or from right to left with negative indices starting at~\(-1\) down
2378 % to the negative length.
2379 %
2380 % \begin{important}
2381 % Macro~\cs{typoggetnth} \emph{only} works with \meta{key}s that are associated with a list
2382 % of values.
2383 % \end{important}
2384 %
2385 %
2386 % \subsection{Information}\label{sec:information}
2387 % \index{information|userman}
2388 %
2389 % \begin{whittyquote}
2390 % Never forget: The visual output counts; \\
2391 % it must always be checked, [\dots\itcorr{-4}]. \\
2392 % \marginnote{The em-dash at then end of the quote is height-adjusted with
2393 % \hyperref[syn:capitalemdash]{\cs{capitalemdash*}}.}%
2394 % \capitalemdash*~\propername{Udo Wermuth}~\cite{wermuth:2017a}
2395 % \end{whittyquote}
2396 %
2397 % \noindent
2398 % We define some functions for inspecting the typesetting process.
2399 %
2400 %
2401 % \subsubsection{Font Information}\label{sec:font-information}
2402 % \index{font>information|userman}
2403 %
2404 % \DescribeMacro{\fontsizeinfo}
2405 % Capture the font~size\footnote{We use \cs{fontdimen6}, the em-height as the font
2406 % size.}\index{font>size|userman} and line~spacing\footnote{The line~spacing simply is
2407 % \cs{baselineskip}.}\index{line spacing|userman} at the point where \cs{fontsizeinfo} \emph{is
2408 % called} in macro~\meta{csname}. Both dimensions are measured in points~(pt) and the results
2409 % are rounded to tenths.
2410 %
2411 % \begin{synopsis}\label{syn:fontsizeinfo}
2412 % \cs{fontsizeinfo}\marg{csname}
2413 % \end{synopsis}
2414 %
2415 % The call to \cs{fontsizeinfo} defines a pair of macros to access the stored values. The
2416 % unstarred version~\cs{csname} expands to the lengths including their units (i.\,e.,~pt), the
2417 % starred version~\cs{csname*} omits the units. The separating slash is
2418 % \hyperref[syn:kernedslash]{\cs{kernedslash}}, which is introduced in
2419 % \cref{sec:slash-with-kern}.
2420 %
2421 % \begin{note}
2422 % The \cs{baselineskip} can contain a rubber (stretch/shrink) component; however,
2423 % \cs{fontsizeinfo} will not display these parts.
2424 % \end{note}
2425 %
2426 % \begin{usecases}
2427 % Colophon.\visualpar Font test pages.
2428 % \end{usecases}
2429 %
2430 %
2431 % \subsubsection{Paragraph- and Page-Breaking Trace}\label{sec:paragraph-and-pagebraking-trace}
2432 %
2433 % \DescribeEnv{typoginspect}
2434 % \DescribeEnv{typoginspectpar}
2435 % The environments |typoginspect| and |typoginspectpar| turn on the tracing of paragraphs and
2436 % pages; optionally they display the parbox' contents. These environments help users identify
2437 % typographic issues quantitatively without getting distracted by unrelated information in the
2438 % trace or the \filesystem{log}-file.
2439 %
2440 % \begin{synopsis}
2441 % \label{syn:typoginspect}
2442 % \label{syn:typoginspectpar}
2443 % \cs{begin}|{typoginspect}|\oarg{option}\marg{id}
2444 % \ttdots{}
2445 % \cs{end}|{typoginspect}| \\[\smallskipamount]
2446 % \cs{begin}|{typoginspectpar}|\oarg{option}\marg{id} \\
2447 % \hspace*{1em}\ttdots \\
2448 % \cs{end}|{typoginspectpar}|
2449 % \end{synopsis}
2450 %
2451 % The \meta{id} is an arbitrary string that identifies the results in the
2452 % \filesystem{log}~file. If the mandatory argument is empty, \packagename{typog} constructs a
2453 % unique value.
2454 %
2455 %
2456 % \paragraph{Option}
2457 %
2458 % \begin{description}[style=nextline]
2459 % \item[|tracingboxes|{[}=\meta{size}{]}]
2460 % Specify the maximum box breadth and box depth reported in the log. If \meta{size} is
2461 % omitted the maximum values are assumed; this is similar to the \cs{tracingboxes}
2462 % macro~\cite[p.~312]{abrahams:2020}.
2463 % \end{description}
2464 %
2465 % \begin{caution}
2466 % The end-of-trace marker sometimes gets placed too early and the trace seems truncated.
2467 % \LaTeX{} reliably logs the requested trace information, but the write operations for trace
2468 % data and \cs{immediate}\cs{write} which is used to print the end-tag are not synchronized.
2469 % The workaround in such a situation is to enclose more text in the
2470 % \code{typoginspect}~environment (respecting the nesting of other environments of course).
2471 % \end{caution}
2472 %
2473 %
2474 % \paragraph{\LaTeX{} \filesystem{log}-file and trace.}
2475 % The trace data in the \filesystem{log}-file is bracketed by \acronym{XML}-tags.
2476 %
2477 % \begin{widecodeexample}
2478 % <typog-inspect\textvisiblespace
2479 % id="\meta{id}"\textvisiblespace
2480 % job="\meta{jobname}"\textvisiblespace
2481 % line="\meta{line-number}"\textvisiblespace
2482 % page="\meta{page-number}"> \\
2483 % ~~\ttdots \\
2484 % </typog-inspect>
2485 % \end{widecodeexample}
2486 %
2487 % \noindent
2488 % where the \meta{id} is the user-supplied, unique\footnote{It has turned out advantageous to
2489 % use unique \meta{id}s. However, \meta{id}s are \emph{not required} to be distinct.}
2490 % identifier of the group, \meta{jobname} is the value of \cs{jobname}, \meta{line-number}
2491 % records the \cs{inputlineno} of the \cs{begin}~of the group, and \meta{page-number} gets
2492 % replaced with the current value of the page counter.
2493 %
2494 % \begin{itemize}[noindent]
2495 % \item Any text tool can be used to extract the tags. \propername{Emacs} users will find the
2496 % function~\mbox{\code{(\href{https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html}{occur}
2497 % \meta{regexp})}} to be useful.\shiftedmarginnote{This \code{itemize} list demonstrates
2498 % vertically adjusted label items (\cref{sec:adjust-label-items}).}
2499 %
2500 % \item As long as the tags are not nested \programname{sed} or \programname{perl}
2501 % extract the information gathered by~|typoginspect|, for example:
2502 %
2503 % \begin{codeexample}
2504 % sed \= -ne '/<typog-inspect\textvisiblespace id="\ttdots"/,\textbackslash\#</typog-inspect>\#p' \\
2505 % \> < jobname.log
2506 % \end{codeexample}
2507 %
2508 % or
2509 %
2510 % \begin{codeexample}
2511 % perl \= -ne '\= \$a=0 if /<\textbackslash/typog-inspect>/; \textbackslash \\
2512 % \>\> print \$\_ if \$a; \textbackslash \\
2513 % \>\> \$a=1 if /<typog-inspect\textvisiblespace id="\ttdots"/' \textbackslash \\
2514 % \> < jobname.log
2515 % \end{codeexample}
2516 %
2517 % \item The companion program~\programname{typog-grep} is tailored to extract the information
2518 % marked up by |typoginspect| and~|typoginspectpar|, even if the environments are nested.
2519 %
2520 % The complete manual page of \programname{typog-grep} is reproduced in
2521 % \Cref{app:typog-grep}.
2522 % \end{itemize}
2523 %
2524 % \begin{tips}
2525 % \begin{itemize}[nestedinspecialsection, notopsep]
2526 % \item It may be necessary to run whatever \LaTeX~engine with a larger log-file line length,
2527 % to prevent wrapped lines. With short lines the wannabe \acronym{XML} opening tags can
2528 % get wrapped and thus become unrecognizable to dumb postprocessors. To avoid wrapped
2529 % lines, prepend
2530 %
2531 % \begin{codeexample}
2532 % /usr/bin/env max\_print\_line=2147483647
2533 % \end{codeexample}
2534 %
2535 % to the command-line. The value~\(2147483647 = 2^{31} - 1\) effectively disables all line
2536 % wrapping by \LaTeX.
2537 %
2538 % As both \command{pdflatex} and \command{lualatex} support changing their configuration on
2539 % a by-call basis with option~\code{-cnf-line=\meta{STRING}} an alternative to the above
2540 % example is to add
2541 %
2542 % \begin{codeexample}
2543 % -cnf-line=max\_print\_line=2147483647
2544 % \end{codeexample}
2545 %
2546 % to the command-line.
2547 %
2548 % \item If more trace information is needed just add \cs{tracing\ttdots} calls right after
2549 % \code{\string\begin\{typoginspect\}}
2550 % or~\code{\string\begin\{typoginspectpar\}}.
2551 %
2552 % \item As the overhead of \cs{typoginspect} is relatively low, hairy parts of a document can
2553 % permanently be furnished with them, for example, the Index.
2554 %
2555 % \item Any labeled part can treat their ids to \meta{id}. Think of \cs{caption}s or any
2556 % theorem-like environment and their associated, unique \cs{label}s.\specialsectionendhere
2557 % \end{itemize}
2558 % \end{tips}
2559 %
2560 %
2561 % \phantomsection
2562 % \paragraph{Investigating the badness of a paragraph.}\label{sec:investigating-paragraph-badness}
2563 % \index{paragraph>badness|userman}
2564 %
2565 % It is generally unnecessary to determine the \emph{exact} classification of a paragraph's
2566 % badness~\cite[p.~97n]{knuth:1986}, though the curious user can switch on logging of
2567 % \TeX's~line-break information with
2568 % \cs{tracingparagraphs}|=1|\footnote{Reference~\citenum{wermuth:2016} provides an
2569 % exceptionally detailed discussion of the output of \cs{tracingparagraphs}.} or simply use
2570 % the \hyperref[syn:typoginspect]{typoginspect}~environment and check the suffixes
2571 %
2572 % \begingroup
2573 % \centering
2574 % |@@|\meta{breakpoint-number} |line| \meta{line-number}|.|\meta{suffix}
2575 % \par
2576 % \endgroup
2577 %
2578 % \noindent
2579 % of each line in the paragraph, where for \meta{suffix} the following mapping
2580 % holds~\cite[p.~99]{knuth:1986}:
2581 % \begin{equation*}
2582 % 0 \mapsto \text{very loose},\quad
2583 % 1 \mapsto \text{loose},\quad
2584 % 2 \mapsto \text{decent, and}\quad
2585 % 3 \mapsto \text{tight}.
2586 % \end{equation*}
2587 %
2588 % \begin{example}
2589 % \let\oldsample=\sample
2590 % \renewcommand*{\sample}[1]{\oldsample{\texttt{#1}}}
2591 % \par\medskip
2592 % \noindent
2593 % |@@17: line 15.1- t=142289 s=93.58414 a=2.86073 -> @@16|
2594 %
2595 % \begin{enumerate}[noitemsep]
2596 % \item The feasible breakpoint~\sample{@@} number~17 in the paragraph leads to
2597 % \item \sample{line}~15, which is the loose~\sample{.1} last~\sample{-} line of the
2598 % paragraph.
2599 % \item Up to this breakpoint the paragraph has picked up total demerits~\sample{t}
2600 % of~142289.
2601 % \item\index{lastlinefit=\verb!*+\lastlinefit+|userman}
2602 % The following two values only show up if\/ \(\cs{lastlinefit} \not= 0\):
2603 % \begin{enumerate}[beginpenalty=10000, nosep]
2604 % \item The shortfall~\sample{s} and
2605 % \item glue~\sample{a} or~\sample{g}.\!\footnote{The author is unaware of any descriptions
2606 % of \sample{s}, \sample{a}, or~\sample{g} and the interested reader is referred to the
2607 % source code, e.\,g., \filesystem{pdftex.web}; search for \code{print("\textvisiblespace
2608 % s=")}. In the weaved documentation the first relevant section is~\S1851.}
2609 % \end{enumerate}
2610 % \item The best\footnote{\singlequotes{Best} means the minimum-demerits path in the graph of
2611 % the feasible breakpoints, which has been constructed for the paragraph.} way to get
2612 % here, i.\,e., |@@17| is via~\sample{->} breakpoint~\sample{@@}~16.\specialsectionendhere
2613 % \end{enumerate}
2614 % \end{example}
2615 %
2616 % \begin{note}
2617 % When package~\packagename{microtype}'s font expansion jumps in the reports on
2618 % \doublequotes{Loose \textbackslash hbox (badness~\dots)} and \doublequotes{Tight
2619 % \textbackslash hbox (badness~\dots)} \shiftedmarginnote{All of our guillemets were raised
2620 % by \milliem{\the\typogget{raiseguillemets}}.} contain the amount of shrinking or expansion
2621 % as parenthesized values (units are thousandths of the current font's~em) like, e.\,g.,
2622 %
2623 % \begin{codeexample}
2624 % \textbackslash T1/erewhon-LF/m/n/9/@/@ (-13) \ttdots
2625 % \end{codeexample}
2626 %
2627 % or
2628 %
2629 % \begin{codeexample}
2630 % \textbackslash T1/erewhon-LF/m/n/9/@/@/10ls (+7) \ttdots
2631 % \end{codeexample}
2632 %
2633 % An \sample{ls} appended to the font name specification indicates that
2634 % \packagename{microtype}'s letter~spacing is active and changed the tracking by that many
2635 % thousands on an em as indicated before~\sample{ls}.
2636 % \end{note}
2637 %
2638 %
2639 % \phantomsection
2640 % \paragraph{Investigating page-breaks.}
2641 % \index{page break|userman}
2642 %
2643 % Use \code{\cs{tracingpages}=1} or the \hyperref[syn:typoginspect]{typoginspect}~environment
2644 % to switch on tracing of \TeX's page-break
2645 % information~\cite[p.~112n]{knuth:1986}.\!\footnote{See also the discussion of the \TeX~output
2646 % routines by \propername{Solomon}~\cite{solomon:1990}.}
2647 %
2648 % The first time vertical material enters a new page, \TeX{} logs
2649 %
2650 % \begingroup\tt
2651 % \centering
2652 % \%\% goal height=\meta{text-height}, max depth=\meta{max-depth} \\
2653 % \par
2654 % \endgroup
2655 %
2656 % \noindent
2657 % where \meta{text-height} is the total height \TeX{} wants to achieve and~\meta{max-depth} is
2658 % the maximum depth of the hbox in the last line of the page is allowed to have without
2659 % considering \meta{text-height} to be exceeded. For example:
2660 %
2661 % \begingroup\tt
2662 % \centering
2663 % \%\% goal height=598.0, max depth=5.0 \\
2664 % \par
2665 % \endgroup
2666 %
2667 % For every vertical breakpoint \TeX{} records
2668 %
2669 % \begingroup\tt
2670 % \centering
2671 % \% t=\meta{total-height} g=\meta{goal-height} b=\meta{badness} p=\meta{penalty} c=\meta{cost}
2672 % \par
2673 % \endgroup
2674 %
2675 % Here, \meta{total-height} and \meta{goal-height} are the current total height of the page and
2676 % the current goal height to achieve with respect to this vertical breakpoint.
2677 %
2678 % The value of \meta{penalty} and \meta{cost} can be infinite, which would be indicated with an
2679 % asterisk~\sample{\texttt{*}} instead of a numerical value. The best vertical breakpoint
2680 % found so far on the current page is indicated by a trailing sharp-sign~\sample{\texttt{\#}}.
2681 %
2682 % \begin{example}
2683 % \let\oldsample=\sample
2684 % \renewcommand*{\sample}[1]{\oldsample{\texttt{#1}}}
2685 % \begin{widecodeexample}
2686 % \% t=351.3 plus 11.0 minus 1.0 g=553.9 b=10000 p=-300 c=100000\#
2687 % \end{widecodeexample}
2688 %
2689 % \begin{enumerate}[noitemsep, notopsep]
2690 % \item At this vertical breakpoint the total page height~\sample{t} is 351.3\,pt. We have
2691 % picked up glue with 11\,pt~stretchability and~1\,pt~shrinkability along the way.
2692 %
2693 % \item The current goal height~\sample{g} is 553.9\,pt. If the initial goal height was
2694 % 598\,pt we can deduce that some space for other vertical material was subtracted.
2695 %
2696 % \item The badness~\sample{b} of this vertical break is horrendous which is expected for the
2697 % first lines on a page since breaks so early are rightfully considered infinitely bad.
2698 %
2699 % \item The penalty~\sample{p} at this point actually is a bonus.
2700 %
2701 % \item As the badness is 10000 the cost for a break is calculated
2702 % to~100000.\specialsectionendhere
2703 % \end{enumerate}
2704 % \end{example}
2705 %
2706 %
2707 % \subsection{Hyphenation}\label{sec:latex-hyphenation}
2708 % \index{hyphenation|userman}
2709 %
2710 % \TeX's and thus \LaTeX's hyphenation algorithm is highly sophisticated, yet the document
2711 % author sometimes lacks convenient macros to solve seemingly trivial typographic tasks. For
2712 % example, to hyphenate a compound~word connected by a hyphen.
2713 %
2714 % \DescribeMacro{\allowhyphenation}
2715 % \TeX{} inhibits breaks of the component words by default. The following macro rectifies the
2716 % problem.
2717 %
2718 % \begin{synopsis}\label{syn:allowhyphenation}
2719 % \cs{allowhyphenation}
2720 % \end{synopsis}
2721 %
2722 % Macro~\cs{allowhyphenation}\index{hyphenation>re-enable automatic|userman} re-enables
2723 % automatic hyphenation after \TeX{} has turned it off, e.\,g.~in a hyphenated compound.
2724 %
2725 % The admittedly simple rules for when \TeX{} auto-hyphenates and when it does not give rise to
2726 % so many different, yet interesting cases that we devote \cref{tab:hyphens-and-hyphenations}
2727 % to them.
2728 % \begingroup
2729 % \let\textfrac=\nativetextfraction
2730 % The seemingly special cases shown there are not that uncommon, e.\,g., consider
2731 % \singlequotes{\mbox{spin-\textfrac{1}{2}}} which is coded as |\mbox{spin-\textfrac{1}{2}}|.
2732 % A line break between the text and the fraction would garble the term.
2733 % \endgroup
2734 %
2735 % \begin{usecases}
2736 % \begin{itemize}[notopsep]
2737 % \item All examples from the bottom of \cref{tab:hyphens-and-hyphenations} on
2738 % \cpageref{tab:hyphens-and-hyphenations}.
2739 %
2740 % \item Establish additional hyphenation opportunities if these have been canceled by
2741 % bricolage that is necessary for parenthesized German compounds like, e.\,g.,
2742 % \foreignphrase{\doublequotes{(Linear\mbox{-})\hskip0pt Impulsvektor}},
2743 % \foreignphrase{\doublequotes{(Links\mbox{-})\hskip0ptKonjugation}}, or
2744 % \foreignphrase{\doublequotes{(Unter\mbox{-})\hskip0pt Gruppe}}. All of these can be
2745 % fixed by blunting the hyphen with \code{\cs{mbox}} and inserting a breakpoint with
2746 % \code{\cs{hskip}} (or, as horizontal glue carries a penalty of zero, with
2747 % \hyperref[syn:breakpoint]{\code{\cs{breakpoint}}}, which is associated with
2748 % \code{\cs{breakpenalty}}), like
2749 %
2750 % \begin{codeexample}
2751 % (Linear\cs{mbox\{-\}})\cs{hskip0pt} Impulsvektor
2752 % \end{codeexample}
2753 %
2754 % where \foreignphrase{\doublequotes{Linear}} won't get hyphenated.
2755 % Macro~\code{\cs{allowhyphenation}} rectifies this situation:
2756 %
2757 % \begin{codeexample}
2758 % (Linear\cs{allowhyphenation}\cs{mbox}\{-\})\cs{hskip0pt} Impulsvektor
2759 % \end{codeexample}
2760 %
2761 % Typographically the last code example raises the same concerns as does \code{\cs{hyp}},
2762 % this is, whether the hyphenation opportunities
2763 % (here:\narrowspace\foreignphrase{Li-ne-ar}),\marginnote{A
2764 % \hyperref[syn:narrowspace]{\code{\cs{narrowspace}}} compensates the visual gap between
2765 % the colon and the italic \singlequotes{L}.} if chosen, distract from the constuction of
2766 % the compound that already contains a hyphen.
2767 %
2768 % \item Mend line breaks of index-entries in a narrow index:
2769 %
2770 % \begin{codeexample}
2771 % Halbgruppe, Transformations\cs{allowhyphenation}\cs{mbox}\{-\}\cs{,}-\nolig*-\nolig*-
2772 % \end{codeexample}
2773 %
2774 % The first part, \singlequotes{Transformations} is allowed to be hyphenated, but a break
2775 % after the hyphen is prohibited as it results in a prowling em-dash at the beginning of
2776 % the next line.
2777 %
2778 % \item Re-enable hyphenation when a macro decays into a \cs{hbox}:
2779 %
2780 % \begin{codeexample}
2781 % Einselement\cs{allowhyphenation}\cs{rlap}\{,\}\cs{footnote}\{\ttdots\}
2782 % \end{codeexample}
2783 %
2784 % where \cs{rlap} is equivalent to something like
2785 % \code{\cs{makebox}[0pt]\{\#1\cs{hss}\}}.
2786 %
2787 % \item Use \cs{allowhyphenation} to turn on hyphenation of the first word of a paragraph as,
2788 % e.\,g., in a narrow index or a \cs{marginpar}:
2789 %
2790 % \begin{codeexample}
2791 % \cs{marginpar}\{\cs{allowhyphenation} Kontakttransformationen\}
2792 % \end{codeexample}
2793 %
2794 % A common trick to sweet-talk \TeX{} into hyphenating the first word of a paragraph is to
2795 % put \cs{hskip0pt} in front of it.
2796 %
2797 % \item Enable automatic hyphenation in the rare but weird cases when \TeX{} does not
2798 % hyphenate a word that is hyphenatable despite the result is an overfull
2799 % box.\!\footnote{The author of \packagename{typog} has no idea, why this happens, but he
2800 % has been successful in fixing the problems with code like \code{(\cs{allowhyphenation}
2801 % \mbox{Superpositionsprinzip})} or \code{(\cs{allowhyphenation}
2802 % \mbox{Superauswahlregel})}. Elucidation by a \TeX-savant is highly
2803 % welcome.}\specialsectionendhere
2804 % \end{itemize}
2805 % \end{usecases}
2806 %
2807 % \begin{table}\small
2808 % \centering
2809 % \caption[Hyphens and automatic hyphenation]
2810 % {\TeX{} offers plenty of possibilities to hyphenate a compound.\visualpar We use
2811 % the sample \singlequotes{hyphenated-compound} to show various code examples and
2812 % the results that they produce. The parts are automatically hyphenated like this:
2813 % \singlequotes{hyphenated}~\(\rightarrow\) \singlequotes{hy-phen-ated} and
2814 % \singlequotes{compound}~\(\rightarrow\) \singlequotes{com-pound}.}
2815 % \label{tab:hyphens-and-hyphenations}
2816 %
2817 % \begin{nofontexpansion}
2818 % \newcommand*{\zbox}[1]
2819 % {\hfuzz=\maxdimen
2820 % \overfullrule=0pt
2821 % \raisebox{\normalbaselineskip}{\parbox[t]{0pt}{\hspace{0pt}#1}}}
2822 %
2823 % \sbox{\listlabelbox}{hyphenated-compound}
2824 % \begin{tabularx}{\linewidth}{@{}p{12em}l>{\fussy\RaggedRight}X@{}}
2825 % \toprule
2826 % \LaTeX-Code & \makebox[\wd\listlabelbox][l]{Result} & Note \\
2827 % \midrule
2828 % \code{hyphenated-compound} &
2829 % \zbox{hyphenated-compound} &
2830 % Most frequently used code; the hyphen~\sample{\code{-}} expands to
2831 % \code{\cs{discretionary}\mbox{\{-\}\{\}\{-\}}} rendering the parts unbreakable \\
2832 %
2833 % \code{hyphenated\cs{mbox}\{-\}\%}\newline
2834 % \code{compound} &
2835 % \zbox{hyphenated\mbox{-}compound} &
2836 % Suppress hyphenation with the \cs{mbox} in the compound \\
2837 %
2838 % \code{\cs{mbox}\{hyphenated-\%}\newline
2839 % \code{compound\}} &
2840 % \zbox{\mbox{hyphenated-compound}} &
2841 % Avoid line break and thus hyphenation \\
2842 %
2843 % \midrule
2844 %
2845 % \code{hyphenated\cs{hyp}}\newline
2846 % \code{compound} &
2847 % \zbox{hyphenated\hyp compound} &
2848 % Macro~\cs{hyp} defined in package
2849 % \packagename{hyphenat}~\cite{package:hyphenat} \\
2850 %
2851 % \addlinespace
2852 % \midrule
2853 %
2854 % \code{hyphenated\%}\newline
2855 % \cs{allowhyphenation}\code{-\%}\newline
2856 % \code{compound} &
2857 % \zbox{hyphenated\allowhyphenation-compound} &
2858 % Macro~\cs{allowhyphenation} of package~\packagename{typog}; only unblock
2859 % hyphenation of the first part \\
2860 %
2861 % \code{hyphenated-\%}\newline
2862 % \cs{allowhyphenation}\newline
2863 % \code{compound} &
2864 % \zbox{hyphenated-\allowhyphenation compound} &
2865 % Macro~\cs{allowhyphenation} of package~\packagename{typog}; only unblock
2866 % hyphenation of the second part \\
2867 %
2868 % \code{hyphenated\%}\newline
2869 % \cs{allowhyphenation}\newline
2870 % \cs{mbox}\code{\{-\}\%}\newline
2871 % \code{compound} &
2872 % \zbox{hyphenated\allowhyphenation\mbox{-}compound} &
2873 % Macro~\cs{allowhyphenation} of package~\packagename{typog}; hyphenate first
2874 % part and keep the original hyphen unbreakable \\
2875 %
2876 % \code{hyphenated\%}\newline
2877 % \cs{allowhyphenation}\code{-\%}\newline
2878 % \cs{allowhyphenation}\newline
2879 % \code{compound} &
2880 % \zbox{hyphenated\allowhyphenation-\allowhyphenation compound} &
2881 % Macro~\cs{allowhyphenation} of package~\packagename{typog}; hyphenate both
2882 % parts, similar to \cs{hyp} shown above \\
2883 %
2884 % \addlinespace
2885 % \bottomrule
2886 % \end{tabularx}
2887 % \end{nofontexpansion}
2888 % \end{table}
2889 %
2890 % \noindent
2891 % Whenever using \cs{-}, the short-hand form of \cs{discretionary\{-\}\{\}\{\}}, authors
2892 % writing in a foreign language should reconsider whether it really beats \cs{hyphenation} or
2893 % \cs{babelhyphenation}\footnote{\cs{babelhyphenation} is the multi-lingual extension of \TeX's
2894 % \cs{hyphenation} and it is defined in package~\packagename{babel}~\cite{package:babel}.} in
2895 % the particular situation. However, sometimes \cs{-} actually \emph{is} the way to go.
2896 %
2897 % Let us assume we mark up proper names with
2898 %
2899 % \begin{codeexample}
2900 % \cs{DeclareRobustCommand}*\= \{\cs{propername}\}[1] \\
2901 % \> \{\cs{mbox}\{\cs{textsc}\{\#1\}\}\}
2902 % \end{codeexample}
2903 %
2904 % \noindent
2905 % and we want to have breakable \foreignphrase{\doublequotes{\propername{Abel}sche Gruppe}} or
2906 % \foreignphrase{\doublequotes{\propername{Euklid}ischer Vektorraum}} without dropping the
2907 % markup. To that end we define commands that insert a hyphenation point at the right place:
2908 %
2909 % \begin{codeexample}
2910 % \cs{newcommand*}\= \{\cs{abelsche}\} \\
2911 % \> \{\cs{propername}\{Abel\}\cs{-}sche\} \\
2912 % \cs{newcommand*}\> \{\cs{euklidischer}\} \\
2913 % \> \{\cs{propername}\{Euklid\}i\cs{-}scher\}
2914 % \end{codeexample}
2915 %
2916 % \noindent
2917 % which are impossible to encode with \cs{hyphenation} or~\cs{babelhyphenation} as these expect
2918 % only letters and dashes as their arguments with spaces separating the words.
2919 %
2920 % \index{hyphenation>first word|userman}
2921 % \index{hyphenation>hskip=\cs{hskip}|userman}
2922 % \TeX{} never hyphenates the initial word in a paragraph even with \cs{allowhyphenation}.
2923 % Start the paragraph with \cs{hskip~0pt} to enable hyphenation even for the first word.
2924 %
2925 % \begin{tip}[Typewriter Fonts]
2926 % Sometimes it is desired to get a breakable typewriter font. \LaTeX{} suppresses any
2927 % hyphenation for fonts in \cs{ttfamily} by un-defining their \cs{hyphenchar}s. If these are
2928 % reassigned, the usual line breaking and hyphenation occurs again.
2929 %
2930 % So, a fictitious macro `\cs{code}' to typeset short pieces of code could look like this:
2931 %
2932 % \begin{codeexample}
2933 % \cs{newcommand*}\= \{\cs{code}\}[1] \\
2934 % \> \{\{\= \cs{ttfamily} \\
2935 % \> \> \cs{hyphenchar}\cs{font}=`\cs{-}\cs{relax} \#1\}\}\specialsectionendhere
2936 % \end{codeexample}
2937 % \end{tip}
2938 %
2939 % \DescribeMacro{\breakpoint}
2940 % \DescribeMacro{\breakpoint*}
2941 % The empty discretionary construct~\cite[p.~95]{knuth:1986}, \cs{discretionary\{\}\{\}\{\}},
2942 % is helpful. It deserves its own macro\spacedemdash with a descriptive name.
2943 %
2944 % \begin{synopsis}\label{syn:breakpoint}
2945 % \cs{breakpoint}\qquad \cs{breakpoint*}
2946 % \end{synopsis}
2947 %
2948 % \index{hyphenation>empty discretionary|userman}
2949 % The starred form inserts an empty discretionary, which disables automatic hyphenation. The
2950 % unstarred form inserts an empty discretionary and immediately re-enables automatic
2951 % hyphenation.
2952 %
2953 % The difference between \cs{breakpoint} and the \LaTeX{} macro~\cs{allowbreak} is not only
2954 % that the former has a starred form, but the penalty associated with \cs{breakpoint} is the
2955 % current\footnote{At this point in the document
2956 % \code{\string\exhyphenpenalty=\the\exhyphenpenalty} holds.} \cs{exhyphenpenalty}, whereas
2957 % \cs{allowbreak} statically assigns a zero~penalty.
2958 %
2959 % \begin{usecase}
2960 % Prefixes that end in a hyphen inside of a pair of parenthesis:
2961 %
2962 % \begin{codeexample}
2963 % \cs{mbox}\{(pre-)\}\cs{breakpoint*} \cs{propername}\{Hilbert\} space\specialsectionendhere
2964 % \end{codeexample}
2965 % \end{usecase}
2966 %
2967 % \DescribeEnv{hyphenmin}
2968 % \sinceversion{Since v0.3}
2969 % Set the values of \cs{lefthyphenmin} and \cs{righthyphenmin} confined to an environment.
2970 %
2971 % \begin{synopsis}\label{syn:hyphenmin}
2972 % \cs{begin}|{hyphenmin}|\oarg{left-hyphen-minimum}\marg{hyphen-minimum} \\
2973 % \hspace*{1em}\ttdots \\
2974 % \cs{end}|{hyphenmin}|
2975 % \end{synopsis}
2976 %
2977 % Without optional argument |hyphenmin| sets both \cs{lefthyphenmin} and \cs{righthyphenmin} to
2978 % \meta{hyphen-minimum}. When called with an optional argument it sets \cs{lefthyphenmin} to
2979 % \meta{left-hyphen-minimum} and \cs{righthyphenmin} to \meta{hyphen-minimum}.\!\footnote{The
2980 % current values for \cs{lefthyphenmin} and \cs{righthyphenmin} in this document
2981 % are~\the\lefthyphenmin{} and~\the\righthyphenmin.}
2982 %
2983 % \begin{usecase}
2984 % If the hyphen minimums were \emph{increased} e.\,g.~in the preamble: Reduce the hyphen
2985 % minimum in the index or other multi-column environments with narrow lines to regain
2986 % hyphenation possibilities.\visualpar Use a large \meta{hyphen-minimum} to disable
2987 % hyphenation.\label{secend:latex-hyphenation}
2988 % \end{usecase}
2989 %
2990 %
2991 % \newpagetofixtoc
2992 % \subsection{Disable\kernedslash Break Ligatures}\label{sec:break-ligatures}
2993 % \index{ligature|userman}
2994 %
2995 % \DescribeMacro{\nolig*}
2996 % Break a ligature without introducing a hyphenation opportunity.
2997 %
2998 % \begin{synopsis}\label{syn:nolig-star}
2999 % \cs{nolig*}\oarg{kerning}
3000 % \end{synopsis}
3001 %
3002 % \indexpackageoption{ligaturekern}
3003 % Inserting \cs{nolig*} disables a ligature at the given point by a kern. Set the size of the
3004 % kern\index{kerning>ligature|userman} with \hyperref[item:ligaturekern]{\code{ligaturekern}} or
3005 % override this value with \meta{kerning} as thousandths of the current font's~em.
3006 %
3007 % \begin{usecases}
3008 % \cs{nolig*} can be useful in headings, where additional hyphenation points are
3009 % unwelcome.\visualpar In fonts with an overly rich set of ligatures \cs{nolig*} offers a
3010 % straightforward means to suppress unwanted ligatures at non-hyphenatable
3011 % positions.\visualpar Rectify the appearance of a pseudo ligature, i.\,e., two adjacent
3012 % characters that look like a ligature, but actually are not.
3013 % \end{usecases}
3014 %
3015 % \noindent
3016 % \DescribeMacro{\nolig}
3017 % Break a ligature and introduce a hyphenation opportunity.
3018 %
3019 % \begin{synopsis}\label{syn:nolig}
3020 % \cs{nolig}\oarg{kerning}
3021 % \end{synopsis}
3022 %
3023 % \indexpackageoption{breakpenalty}
3024 % Inserting \cs{nolig} disables a ligature at the given point as \cs{nolig*} does \emph{and}
3025 % introduces a hyphenation opportunity with
3026 % penalty~\hyperref[item:breakpenalty]{|breakpenalty|}.
3027 %
3028 % \begin{important}[\packagename{hyperref} bookmarks]
3029 % If a \cs{nolig}\leftspacedendash whether starred or un-starred\rightspacedendash occurs
3030 % in an argument that is processed with
3031 % package~\packagename{hyperref}\index{hyperref=\packagename{hyperref} (package)|userman}
3032 % for inclusion into the document's
3033 % \acronym{PDF}-bookmarks\index{PDF=\acronym{PDF}|userman}\index{bookmark|userman} an
3034 % additional argument is necessary to parse the macro. This argument either is \cs{relax}
3035 % or~the empty group~\sample*{\{\kern.1em\}}.
3036 %
3037 % \begin{synopsis}
3038 % \begin{tabbing}
3039 % \cs{nolig*}\oarg{kerning}\cs{relax}\qquad\= \cs{nolig}\oarg{kerning}\cs{relax} \\
3040 % \cs{nolig*}\oarg{kerning}\code{\{\}}\> \cs{nolig}\oarg{kerning}\code{\{\}}
3041 % \end{tabbing}
3042 % \end{synopsis}
3043 %
3044 % The prototypical places where this processing-for-\acronym{PDF}-bookmarks happens are the
3045 % sectioning macros, e.\,g., \cs{chapter}, \cs{section}, \cs{subsection},~etc.
3046 %
3047 % \LaTeX{} will trip with \doublequotes{Undefined control sequence} on
3048 % \cs{typog@\-missing@\-argument} if the extra argument is not passed.
3049 %
3050 % Alternatively use \cs{texorpdfstring}~\cite[Sec.~4.1.2, p.~22]{package:hyperref}.
3051 % \end{important}
3052 %
3053 % \begin{usecases}
3054 % \cs{nolig} can be used with just about any ligature that needs to be split into its parts.
3055 % It also has proven beneficial in separating pairs of characters that are kerned too
3056 % tightly, e.\,g., the \singlequotes{ij}, as in \singlequotes{bijection}, which is
3057 % particularly distractive here, for it occurs at the boundary of two syllables.
3058 % \end{usecases}
3059 %
3060 %
3061 % \newpagetofixtoc
3062 % \subsection{Manual Italic Correction}\label{sec:manual-italic-correction}\label{italic correction}
3063 %
3064 % \DescribeMacro{\itcorr}
3065 % \DescribeMacro{\itcorr*}
3066 % The italic correction offered by \TeX{} or \LaTeX{} sometimes needs manual adjustment.
3067 %
3068 % \begin{synopsis}\label{syn:itcorr}
3069 % \cs{itcorr}\marg{strength}\qquad \cs{itcorr*}\marg{strength}
3070 % \end{synopsis}
3071 %
3072 % In text mode, macro~\cs{itcorr} inserts a kern whose width is proportional to \cs{fontdim1},
3073 % which is the font's italic correction.
3074 % \indexpackageoption{textitaliccorrection}
3075 % If \cs{fontdim1} happens to be zero (e.\,g.~for an upright font), \cs{itcorr} uses the value
3076 % set with \hyperref[item:textitaliccorrection]{\code{textitaliccorrection}} instead of
3077 % \cs{fontdim1}. The starred version always uses
3078 % \hyperref[item:textitaliccorrection]{\code{textitaliccorrection}}.
3079 % \indexpackageoption{mathitaliccorrection}
3080 % In math mode macro~\cs{itcorr} uses the value set with
3081 % \hyperref[item:mathitaliccorrection]{\code{mathitaliccorrection}}\footnote{Separate
3082 % adjustments may be desirable if the math font's italic have markedly different slants.} in
3083 % both the starred and the unstarred form.
3084 %
3085 % Typical slant angles of serif italic fonts range from 8\textdegree{} to~18\textdegree{} and
3086 % thus values for |textitaliccorrection| from .14 to~.32. Note: \meta{strength} can be
3087 % negative, and fractional \meta{strength}s are allowed.
3088 %
3089 % \begin{usecases}
3090 % Stronger or weaker correction than |\/|.\visualpar Correct a non-slanted or non-italicized
3091 % font.\visualpar Negative correction at the left-hand side\footnote{Groff has the machinery
3092 % for left-italic-correction. Its font-metrics files support per glyph
3093 % left-italic-correction values and users can access them conveniently via~\sample*{\cs{,}}.}
3094 % of italic, i.\,e., compensate \doublequotes{shift-to-the-right effect} of
3095 % italic.\visualpar Positive correction at the left-hand side of italic, e.\,g., an
3096 % opening parenthesis or square bracket followed by an
3097 % italic~\sample{\itshape\itcorr{8}f\itcorr{7}} (before:~8, after:~7) or
3098 % \sample{\itshape\itcorr{4}y\itcorr{1}} (before:~4, after:~1) reaching far to the left below
3099 % the baseline.
3100 % \end{usecases}
3101 %
3102 %
3103 % \paragraph{The \meta{strength} parameter explained.}
3104 %
3105 % \TeX{} records the slant angle~\(\alpha\) of a font in \cs{fontdim1} as \(\mbox{1\,pt} \times
3106 % \sin\alpha\). Rephrased the formula means: \emph{How much horizontal space is required for a
3107 % letter slanted with ~\(\alpha\) that is 1\,pt high?} Thus, \cs{itcorr}\marg{strength}
3108 % calculates
3109 % \begin{displaymath}
3110 % \meta{strength} \times \mbox{1\,pt} \times \sin\alpha.
3111 % \end{displaymath}
3112 %
3113 % A well-chosen \meta{strength} should be the absolute minimum value which avoids that the
3114 % glyphs typeset in italic collide with other\leftspacedendash usually
3115 % non-italic\rightspacedendash letters or symbols unless this disturbs the consistency of the
3116 % overall tracking.
3117 %
3118 % Correction of the right-hand side and \mbox{\(\alpha > 0\)}: A reasonable first guess of
3119 % \meta{strength} is the highest point where the rightmost part of the letter would touch a
3120 % rule angled at \(\alpha\) with respect to the baseline. The correction of the left-hand side
3121 % and \mbox{\(\alpha > 0\)} considers the lowest \singlequotes{touching} point below the
3122 % baseline on the left-hand side of the letter. Negative values of \(\alpha\) exchange the
3123 % reference points.
3124 %
3125 % \iffalse
3126 %<*slantangle>
3127 prologues := 3;
3128 truecorners := 1;
3129 linecap := butt;
3130
3131 input TEX;
3132 TEXPRE("%&latex" & char(10) & "\documentclass{article}\begin{document}");
3133 TEXPOST("\end{document}");
3134
3135 string roman_font;
3136 roman_font := "pplr8r"; % URW Palladio L - Roman
3137
3138 string italic_font;
3139 italic_font := "pplri8r"; % URW Palladio L - Italic
3140
3141 u := 360;
3142
3143 font_scale := 10;
3144
3145 pair loc[];
3146 loc[1] := .2[origin, (u, 0)];
3147 loc[2] := .5[origin, (u, 0)];
3148 loc[3] := .8[origin, (u, 0)];
3149
3150 picture letter_H;
3151 letter_H := thelabel.top("H" infont italic_font scaled font_scale, loc[1]);
3152
3153 picture letter_L;
3154 letter_L := thelabel.top("L" infont italic_font scaled font_scale, loc[2]);
3155
3156 picture letter_a;
3157 letter_a := thelabel.top("a" infont italic_font scaled font_scale, loc[3]);
3158
3159 path slant_angle;
3160 slant_angle := lrcorner letter_H + (14, 0) -- lrcorner letter_H + (-6, 0) -- urcorner letter_H + (3.5, 0);
3161
3162 pair base_point;
3163 base_point := (xpart point 2 of slant_angle, ypart point 0 of slant_angle) ;
3164
3165 pair angle_label;
3166 angle_label := point 2 of slant_angle + (0, -12);
3167
3168
3169 beginfig(1);
3170 draw letter_H;
3171 draw slant_angle;
3172 draw point 2 of slant_angle -- base_point dashed evenly;
3173 draw point 1 of slant_angle -- base_point withpen pencircle scaled 2pt;
3174
3175 label.rt(TEX("$\alpha$"), angle_label);
3176
3177 draw letter_L;
3178 draw slant_angle shifted (xpart lrcorner letter_L - xpart lrcorner letter_H + 2, 0);
3179
3180 draw letter_a;
3181 draw slant_angle shifted (xpart lrcorner letter_a - xpart lrcorner letter_H - 3, 0);
3182 endfig;
3183 end
3184 %</slantangle>
3185 % \fi
3186 %
3187 % \Cref{fig:slant-angle} shows how \meta{strength} and \(\alpha\) are related. Moreover, it
3188 % demonstrates how intricate italic correction is.
3189 %
3190 % \begin{figure}
3191 % \centering
3192 % \includegraphics{slant-angle-1.mps}
3193 % \caption[Some letters of an italic font.]
3194 % {Some letters of an italic font. We use the capital~\sample{H} to measure the
3195 % angle~\(\alpha\) between the plumb-line (drawn dashed) and a tangent to the
3196 % rightmost parts of the glyph. The length of the plumb-line is proportional to
3197 % \meta{strength} and the short, thick part of the baseline symbolizes the resulting
3198 % italic correction.\visualpar The middle example, the capital~\sample{L}, shares
3199 % \(\alpha\) with \sample{H} but obviously needs a far smaller \meta{strength} or
3200 % even no correction at all.\visualpar The \sample{a} at the right-hand side is an
3201 % example of why \TeX{} allows to assign an italic~correction to each individual
3202 % character of a font. Not only features the lowercase~\sample{a} a
3203 % larger~\(\alpha\)\leftspacedendash despite being a member of the same
3204 % font\rightspacedendash but its serif adds as much to the width as the slanted
3205 % stem.\label{fig:slant-angle}}
3206 % \vspace{-3\baselineskip}
3207 % \llap{\parbox{\marginparwidth}
3208 % {\marginnoteformat
3209 % We center the last lines of each figure and table caption using
3210 % \hyperref[syn:lastlinecenteredpar]{\code{lastlinecenteredpar}}.}
3211 % \hspace*{\marginparsep}}
3212 % \end{figure}
3213 %
3214 %
3215 % \newpagetofixtoc
3216 % \subsection{Apply Extra Kerning or Spacing}\label{sec:extra-kerning}
3217 % \index{kerning>extra|userman}
3218 % \index{extra spacing|userman}
3219 %
3220 % Package \packagename{typog} provides two sets of macros to kern some of the punctuation
3221 % symbols. One is for forward slashes the other, more extensive one, for hyphens and dashes.
3222 %
3223 %
3224 % \subsubsection{Slash}\label{sec:slash-with-kern}
3225 % \index{kerning>forward slash|userman}
3226 %
3227 % \DescribeMacro{\kernedslash}
3228 % \DescribeMacro{\kernedslash*}
3229 % Macro~\cs{kernedslash} expands to a forward slash~(\sample{\itcorr{3}\char`/}) with some
3230 % extra space around it.
3231 %
3232 % \begin{synopsis}\label{syn:kernedslash}
3233 % \cs{kernedslash}\qquad \cs{kernedslash*}
3234 % \end{synopsis}
3235 %
3236 % \indexpackageoption{breakpenalty}
3237 % The starred form is unbreakable, the non-starred version introduces a break point with
3238 % penalty~\hyperref[item:breakpenalty]{|breakpenalty|} after the slash.
3239 % \indexpackageoption{slashkern}
3240 % Configure the kerning around the slash with~\hyperref[item:slashkern]{|slashkern|}.
3241 %
3242 % \sinceversion{Option \code{lowerslash} introduced in v0.5}
3243 % \indexpackageoption{lowerslash}
3244 % The kerned slash can typset lowered (or raised), with the offset from the baseline configured
3245 % using \hyperref[item:lowerslash]{|lowerslash|}.
3246 %
3247 % \begin{tip}
3248 % Define specialized macros for slashes surrounded by lowercase letters or small~caps if they
3249 % are needed often or require a specific value for \code{slashkern}.
3250 %
3251 % \begin{codeexample}
3252 % \cs{newcommand*}\= \{\cs{lowercasekernedslash}\} \\
3253 % \> \{\=\cs{begin}\{typogsetup\}\{\=lowerslash=.1em, \\
3254 % \> \> \>slashkern=.02em\} \\
3255 % \> \> ~~\cs{kernedslash} \\
3256 % \> \> \cs{end}\{typogsetup\}\}
3257 % \end{codeexample}
3258 %
3259 % Generic solutions could build upon \cs{fontdimen5} and \cs{fontdimen6} (see
3260 % \cref{tab:fontdimen} on \cpageref{tab:fontdimen}) or measure the height and depth of the
3261 % slash-glyph (abstracted in \cs{typog@forwardslash}) and compare it to e.\,g.~the height of
3262 % selected lowercase characters.
3263 % \end{tip}
3264 %
3265 % If the word following the slash should not be hyphenated append \cs{nobreak} after
3266 % \cs{kernedslash*}.
3267 %
3268 % \begin{usecases}
3269 % \cs{kernedslash} improves the appearance of pairs of years typeset in lining numerals:
3270 % \meta{year\textsubscript{1}}/\meta{year\textsubscript{2}}.\visualpar The macro has proven
3271 % helpful in many cases where the right hand side of the slash starts with a capital as, for
3272 % example, \meta{city}/\meta{state-code} (\acronym{US}-specific) or
3273 % \meta{anything}/\meta{noun} (any language that capitalizes \meta{noun}).\visualpar Use
3274 % option~\code{lowerslash} to adjust the slash to surrounding lowercase letters.\visualpar
3275 % Correct a too high raising slash of a font
3276 % (e.\,g.~Cochineal\detoxindex{font>typeface>Cochineal|userman}) with
3277 % option~\code{lowerslash}.
3278 % \end{usecases}
3279 %
3280 %
3281 % \subsubsection{Hyphen}\label{sec:hyphen-with-kern}
3282 % \index{kerning>hyphen|userman}
3283 %
3284 % \DescribeMacro{\kernedhyphen}
3285 % \DescribeMacro{\kernedhyphen*}
3286 % Macros \cs{kernedhyphen*} and \cs{kernedhyphen} expand to a hyphen~(\sample{-}) with given
3287 % kerning to its left and to its right.
3288 %
3289 % \begin{synopsis}\label{syn:kernedhyphen}
3290 % \cs{kernedhyphen}\oarg{raise}\marg{left-kerning}\marg{right-kerning} \\
3291 % \cs{kernedhyphen*}\oarg{raise}\marg{left-kerning}\marg{right-kerning}
3292 % \end{synopsis}
3293 %
3294 % Typeset an unbreakable hyphen with \cs{kernedhyphen*} or a breakable hyphen (like \cs{hyp} of
3295 % package \packagename{hyphenat}~\cite{package:hyphenat}) with \cs{kernedhyphen} and apply some
3296 % kerning to left and to the right of it. The values \meta{left-kerning} and
3297 % \meta{right-kerning} are multiplied with one thousandth of the current font's~em to get the
3298 % size of the kern.
3299 %
3300 % The optional argument~\meta{raise}, also given in \nativetextfraction{1}{1000}\,em, allows to
3301 % adjust the height of the hyphen similar to the macros described in
3302 % \cref{sec:raise-characters}.
3303 % \indexpackageoption{raisecapitalhyphen}
3304 % In text mode, the special argument~\sample{|*|} for \meta{raise} applies the current value of
3305 % \hyperref[item:raisecapitalhyphen]{\code{raisecapitalhyphen}}. The default for \meta{raise}
3306 % is zero.
3307 %
3308 % \DescribeMacro{\leftkernedhyphen}
3309 % \DescribeMacro{\leftkernedhyphen*}
3310 % \DescribeMacro{\rightkernedhyphen}
3311 % \DescribeMacro{\rightkernedhyphen*}
3312 % We also define specialized versions for kerning on the left-hand side or the right-hand side
3313 % only. These macros work like their two-argument counterparts and set the opposite kerning to
3314 % zero.
3315 %
3316 % \begin{synopsis}\label{syn:leftkernedhyphen}\label{syn:rightkernedhyphen}
3317 % \cs{leftkernedhyphen}\oarg{raise}\marg{left-kerning} \\
3318 % \cs{leftkernedhyphen*}\oarg{raise}\marg{left-kerning} \\[\smallskipamount]
3319 % \cs{rightkernedhyphen}\oarg{raise}\marg{right-kerning} \\
3320 % \cs{rightkernedhyphen*}\oarg{raise}\marg{right-kerning}
3321 % \end{synopsis}
3322 %
3323 % \begin{usecases}
3324 % Composites in the form \meta{math}-\meta{noun} in languages where nouns are
3325 % capitalized.\visualpar Composites where one or both sides of the hyphen are typeset in
3326 % different fonts, like, \meta{small-caps}-\meta{roman}.
3327 % \end{usecases}
3328 %
3329 %
3330 % \newpagetofixtoc
3331 % \subsubsection{En-Dash and Em-Dash}\label{sec:spaced-dashes}
3332 %
3333 % The macros introduced in this subsection allow for fine-tuning of the whitespace before and
3334 % after en-dashes and em-dashes. Each macro set is designed for a specific use. The spaced
3335 % en-dash macros are intended to be used where an en-dash is surrounded by normal spaces:
3336 %
3337 % \begin{center}
3338 % \meta{WORD}\code{\textvisiblespace}\textendash\code{\textvisiblespace}\meta{WORD}.
3339 % \end{center}
3340 %
3341 % \noindent
3342 % \skip1=\glueexpr\fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font\relax
3343 % Typographic improvement may come from reducing the width of the space around the en-dash with
3344 % relative to the normal space.\!\footnote{The current font's space width is
3345 % \milliemglue{\skip1} compared to \packagename{typog}s
3346 % \hyperref[item:endashspace]{\code{endashspace}} width of
3347 % \milliemglue{\typogget{endashspace}}.} On the other hand, the em-dash macros assume that
3348 % there is no space between the \meta{WORD}s and the em-dash:
3349 %
3350 % \begin{center}
3351 % \meta{WORD}\textemdash\meta{WORD}.
3352 % \end{center}
3353 %
3354 % \noindent
3355 % The spaced em-dash macros add some (hairline) space between the em-dash and the \meta{WORD}s,
3356 % which helps prevent the em-dash from visually colliding with adjacent words.\!\footnote{Some
3357 % fonts offer dashes with no side bearings to facilitate drawing horizontal lines by abutting
3358 % these dashes.}
3359 %
3360 % \paragraph{Line Breaking Around Dashes.}
3361 % Package \packagename{typog} offers spaced en- and em-dashes with breakpoints either on the
3362 % left-hand side or the right-hand side (or none for any of the starred versions) and this is
3363 % reflected in the macro names by \code{left} and \code{right}. All spaced dashes apply equal
3364 % amounts of space on both sides of the dash; \singlequotes{left} and \singlequotes{right}
3365 % refer to the breakpoints.
3366 %
3367 % A single dash is used\leftspacedendash among many other cases\rightspacedendash
3368 % \marginnote{The insertion, \doublequotes{among~\dots}, is separated by spaced en-dashes.} to
3369 % indicate a pause (e.\,g.~announcing an action to be continued), instead of a comma, or even
3370 % instead of a period. The typographic rules favor either no line break at all or a break at
3371 % the right-hand side~\cite[6.82]{chicago-manual-of-style:2017} of the dash, which also is
3372 % \TeX's default.
3373 %
3374 % Dashes are often used for appositions or explanatory phrases, as in the first sentence above.
3375 % In this instance there exist two camps: one emphasizes the insertion and thus couples the
3376 % lead-in and lead-out dashes to it (see \cref{item:emphasize-insertion}
3377 % below)~\cite[p.~173]{forssman-de-jong:2008}. The other avoids a dash at the beginning of a
3378 % line at the cost of severing it from the insertion
3379 % (\cref{item:avoid-dash-at-beginning-of-line}). We demonstrate the alternatives with
3380 % en-dashes.
3381 %
3382 % \begin{enumerate}
3383 % \item\label{item:emphasize-insertion}
3384 % One rule set prefers insertions to be preceded and followed by dashes. The elementary way
3385 % to solve this is to say
3386 %
3387 % \begin{codeexample}
3388 % before\textvisiblespace -\nolig*-\textasciitilde insertion\textasciitilde-\nolig*-\textvisiblespace after
3389 % \end{codeexample}
3390 %
3391 % For this solution \packagename{typog} offers \cs{leftspacedendash} and
3392 % \cs{rightspacedendash}:
3393 %
3394 % \begin{codeexample}
3395 % before\cs{leftspacedendash} \\
3396 % insertion\cs{rightspacedendash} after
3397 % \end{codeexample}
3398 %
3399 % \item\label{item:avoid-dash-at-beginning-of-line}
3400 % Another school insists to avoid dashes at the start of lines. Now the straightforward
3401 % solution looks like this:
3402 %
3403 % \begin{codeexample}
3404 % before\textasciitilde-\nolig*-\textvisiblespace insertion\textasciitilde-\nolig*-\textvisiblespace after
3405 % \end{codeexample}
3406 %
3407 % For this scenario both dashes behave like \cs{rightspacedendash} and the alias
3408 % \cs{spacedendash} comes in handy:
3409 %
3410 % \begin{codeexample}
3411 % before\cs{spacedendash} \\
3412 % insertion\cs{spacedendash} after
3413 % \end{codeexample}
3414 % \end{enumerate}
3415 %
3416 % \index{spaced character>en-dash|userman}
3417 % \DescribeMacro{\leftspacedendash}
3418 % \DescribeMacro{\leftspaceddash}
3419 % \DescribeMacro{\leftspacedendash*}
3420 % \DescribeMacro{\leftspaceddash*}
3421 % \DescribeMacro{\rightspacedendash}
3422 % \DescribeMacro{\rightspaceddash}
3423 % \DescribeMacro{\spacedendash}
3424 % \DescribeMacro{\spaceddash}
3425 % \DescribeMacro{\rightspacedendash*}
3426 % \DescribeMacro{\rightspaceddash*}
3427 % \DescribeMacro{\spacedendash*}
3428 % \DescribeMacro{\spaceddash*}
3429 % \sinceversion{All since v0.5}
3430 % The four macros \cs{leftspacedendash}, \cs{leftspacedendash*}, \cs{right\-spaced\-endash},
3431 % and \cs{rightspacedendash*} all expand to an en-dash~\sample{--} that is surrounded by
3432 % whitespace. They differ in the ways they handle line breaking before or after the en-dash.
3433 %
3434 % \begin{synopsis}\label{syn:spacedendash}
3435 % \begin{tabbing}
3436 % \cs{rightspacedendash*}\oarg{raise}\qquad \= \kill
3437 % \cs{leftspacedendash}\oarg{raise} \> \cs{leftspaceddash} (alias) \\
3438 % \cs{leftspacedendash*}\oarg{raise} \> \cs{leftspaceddash*} (alias) \\[\smallskipamount]
3439 % \cs{rightspacedendash}\oarg{raise} \> \cs{rightspaceddash} (alias) \\
3440 % \> \cs{spacedendash} (alias) \\
3441 % \> \cs{spaceddash} (alias) \\
3442 % \cs{rightspacedendash*}\oarg{raise}
3443 % \> \cs{spacedendash*} (alias) \\
3444 % \> \cs{spaceddash*} (alias)
3445 % \end{tabbing}
3446 % \end{synopsis}
3447 %
3448 % Typeset an unbreakable en-dash with any of the starred variants. The unstarred
3449 % \cs{left\ttdots}\itcorr*{3}-macros have breakpoints at their left-hand sides and the
3450 % \cs{right\ttdots}\itcorr*{3}-macros breakpoints at their right-hand sides.
3451 %
3452 % Configure the size of the space before and after the dash with
3453 % option~\hyperref[item:endashspace]{\code{endashspace}}.
3454 %
3455 % The optional argument~\meta{raise} allows adjusting the height of the en-dash above the
3456 % baseline just as the macros in \cref{sec:raise-characters}; it is meant for one-off
3457 % solutions. If an en-dash is needed that is both raised and spaced prefer
3458 % macro~\hyperref[syn:spacedcapitalendash]{\cs{spacedcapitalendash}}.
3459 %
3460 %
3461 % \begin{important}[\packagename{hyperref} bookmarks]\label{imp:hyperref-bookmarks-spacedendash}\relax
3462 % If any of \cs{leftspacedendash}, \cs{rightspacedendash}, \cs{spacedendash},
3463 % \cs{spaceddash}, or \cs{spacedemdash} (see below)\spacedemdash whether starred or
3464 % un-starred\spacedemdash occur in an argument that is processed with
3465 % package~\packagename{hyperref}\index{hyperref=\packagename{hyperref} (package)|userman} for
3466 % inclusion into the document's
3467 % \acronym{PDF}-bookmarks\index{PDF=\acronym{PDF}|userman}\index{bookmark|userman} an
3468 % additional argument is necessary to parse the macro. This argument either is \cs{relax}
3469 % or~the empty group~\sample*{\{\kern.1em\}}.
3470 %
3471 % We showcase the modifications of the plain calls for macro~\cs{spaceddash}. They apply to
3472 % all macros that generate spaced en- and em-dashes.
3473 %
3474 % \begin{synopsis}
3475 % \begin{tabbing}
3476 % \cs{spaceddash*}\oarg{raise}\cs{relax}\qquad\= \cs{spaceddash}\oarg{raise}\cs{relax} \\
3477 % \cs{spaceddash*}\oarg{raise}\code{\{\}}\> \cs{spaceddash}\oarg{raise}\code{\{\}}
3478 % \end{tabbing}
3479 % \end{synopsis}
3480 %
3481 % The prototypical places where this processing for \acronym{PDF}~bookmarks happens are the
3482 % sectioning macros, e.\,g., \cs{chapter}, \cs{section}, \cs{subsection},~etc.
3483 %
3484 % \LaTeX{} will trip with \doublequotes{Undefined control sequence} on
3485 % \cs{typog@\-missing@\-argument} if the extra argument is not passed.
3486 %
3487 % Alternatively use \cs{texorpdfstring}~\cite[Sec.~4.1.2, p.~22]{package:hyperref}.
3488 % \end{important}
3489 %
3490 % \DescribeMacro{\swapendashskip}
3491 % \sinceversion{Since v0.5}
3492 % If a \cs{rightspacedendash} is immediately followed by another punctuation mark as, e.\,g., a
3493 % comma, the space at the right-hand side of the en-dash is ill-placed. It either should by
3494 % removed by following the macro with an \cs{unskip} or \cs{swapendashskip}. Furthermore,
3495 % \cs{rightspacedendash} should be made unbreakable.
3496 %
3497 % \begin{synopsis}\label{syn:swapendashskip}
3498 % \cs{swapendashskip}\marg{arg}
3499 % \end{synopsis}
3500 %
3501 % Use \cs{swapendashskip}\marg{arg}, where \meta{arg} typically is a punctuation mark, to
3502 % remove the right-hand space of any spaced en-dash macro and put exactly that amount of space
3503 % on the right-hand side of \meta{arg}. \Cref{tab:swapendashskip} compares the effects on the
3504 % spacing.
3505 %
3506 % \begin{table}
3507 % \centering
3508 % \caption[Comparison of \cs{rightspacedendash}-comma combinations]
3509 % {Comparison of uncorrected and corrected \cs{right\-spaced\-endash}-comma
3510 % combinations for a space width of \nativetextfraction{1}{3}\:em and a
3511 % (exaggerated) \hyperref[item:endashspace]{\code{endashspace}} of
3512 % \nativetextfraction{1}{2}\:em. We have added \doublequotes{book struts} to the
3513 % left and to the right of the results to indicate the width of the output.}
3514 % \label{tab:swapendashskip}
3515 %
3516 % \begin{typogsetup}{endashspace=.5em}
3517 % \begin{tabular}{@{}ll@{}}
3518 % \toprule
3519 % Code & Result \\
3520 % \midrule
3521 % \code{\cs{rightspacedendash*},\cs{space}} &
3522 % \indicatewidth{\rightspacedendash*,\hspace*{.3333em}} \\
3523 % \code{\cs{rightspacedendash*}\cs{unskip},\cs{space}} &
3524 % \indicatewidth{\rightspacedendash*\unskip,\hspace*{.3333em}} \\
3525 % \code{\cs{rightspacedendash*}\cs{swapendashskip},} &
3526 % \indicatewidth{\rightspacedendash*\swapendashskip,} \\
3527 % \bottomrule
3528 % \end{tabular}
3529 % \end{typogsetup}
3530 % \end{table}
3531 %
3532 % \index{spaced character>em-dash|userman}
3533 % \DescribeMacro{\leftspacedemdash}
3534 % \DescribeMacro{\leftspacedemdash*}
3535 % \DescribeMacro{\rightspacedemdash}
3536 % \DescribeMacro{\rightspacedemdash*}
3537 % \DescribeMacro{\spacedemdash}
3538 % \DescribeMacro{\spacedemdash*}
3539 % \sinceversion{All since v0.5}
3540 % The four macros \cs{leftspacedemdash}, \cs{leftspacedemdash*}, \cs{right\-spaced\-emdash},
3541 % and \cs{rightspacedemdash*} all expand to an em-dash~\sample{---} that is surrounded by
3542 % whitespace. They differ in the ways they handle line breaking before or after the em-dash.
3543 %
3544 % Let us pick up the alternatives explained in the section on en-dashes and adapt them to
3545 % em-dashes. Note that by joining words with em-dashes \TeX{} \emph{turns off} automatic
3546 % hyphenation, which usually is the right thing to do to avoid confusion with dashes and
3547 % hyphens. The spaced em-dash macros duplicate this behavior.
3548 %
3549 % \begin{enumerate}
3550 % \item Tie the em-dashes to the insertion.
3551 %
3552 % \begin{codeexample}
3553 % before\cs{breakpoint}\cs{mbox}\{-\nolig*-\nolig*-\} \\
3554 % insertion-\nolig*-\nolig*-after
3555 % \end{codeexample}
3556 %
3557 % Macro \hyperref[syn:breakpoint]{\cs{breakpoint}} was introduced in
3558 % \Cref{sec:latex-hyphenation}.
3559 %
3560 % \begin{codeexample}
3561 % before\cs{leftspacedemdash} \\
3562 % insertion\cs{rightspacedemdash} after
3563 % \end{codeexample}
3564 %
3565 % \item By default \TeX{} inserts breakpoints after em-dashes. So that we can just write
3566 %
3567 % \begin{codeexample}
3568 % before-\nolig*-\nolig*-insertion-\nolig*-\nolig*-after
3569 % \end{codeexample}
3570 %
3571 % The spaced solution with package~\packagename{typog} looks like this:
3572 %
3573 % \begin{codeexample}
3574 % before\cs{spacedemdash} \\
3575 % insertion\cs{spacedemdash} after
3576 % \end{codeexample}
3577 % \end{enumerate}
3578 %
3579 % \begin{synopsis}\label{syn:spacedemdash}
3580 % \begin{tabbing}
3581 % \cs{rightspacedemdash*}\oarg{raise}\qquad \= \kill
3582 % \cs{leftspacedemdash}\oarg{raise} \> \cs{leftspaceddash} (alias) \\
3583 % \cs{leftspacedemdash*}\oarg{raise} \> \cs{leftspaceddash*} (alias) \\[\smallskipamount]
3584 % \cs{rightspacedemdash}\oarg{raise} \> \cs{rightspaceddash} (alias) \\
3585 % \> \cs{spacedemdash} (alias) \\
3586 % \cs{rightspacedemdash*}\oarg{raise}
3587 % \> \cs{spacedemdash*} (alias)
3588 % \end{tabbing}
3589 % \end{synopsis}
3590 %
3591 % Typeset an unbreakable em-dash with any of the starred variants. The unstarred
3592 % \cs{left\ttdots}\itcorr*{3}-macros have breakpoints at their left-hand sides and the
3593 % \cs{right\ttdots}\itcorr*{3}-macros breakpoints at their right-hand sides.
3594 %
3595 % The size of the space before and after the dash is configured with
3596 % option~\hyperref[item:emdashspace]{\code{emdashspace}}.
3597 %
3598 % The optional argument~\meta{raise} allows adjusting the height of the em-dash above the
3599 % baseline just as the macros in \cref{sec:raise-characters}; it is meant for one-off
3600 % solutions. If an em-dash is needed that is both raised and spaced prefer
3601 % macro~\hyperref[syn:spacedcapitalemdash]{\cs{spacedcapitalemdash}}.
3602 %
3603 % The same \hyperref[imp:hyperref-bookmarks-spacedendash]{\emph{Important} note} on hyperref
3604 % bookmarks holds for \cs{spacedemdash} as for \cs{spacedendash}.
3605 %
3606 % \begin{note}
3607 % Alternatively use package \packagename{microtype} to achieve a similar effect.
3608 % Macro~\cs{SetExtraKerning}~\cite[Sec.~5.4]{package:microtype} allows modifying the
3609 % side-bearings of any glyph.
3610 % \end{note}
3611 %
3612 % \begin{tip}\label{tip:textemdash-textendash}\relax
3613 % \index{textemdash=\verb!*+\textemdash+|userman}\relax
3614 % \index{textendash=\verb!*+\textendash+|userman}\relax
3615 % The macros rely on \cs{textemdash} and \cs{textendash} to typeset em-dashes and en-dashes.
3616 % If different glyphs are desired redefine them (preferably locally).
3617 %
3618 % \noindent
3619 % Example with the fictitious macro~\cs{fancydash}:
3620 %
3621 % \begin{codeexample}
3622 % \cs{let}\cs{origspacedemdash}=\cs{spacedemdash} \\
3623 % \cs{renewcommand*}\=\{\cs{spacedemdash}\} \\
3624 % \>\{\cs{begingroup} \\
3625 % \>~\cs{typogsetup}\{emdashspace=.2pt\}\% \\
3626 % \>~\cs{let}\cs{textemdash}=\cs{fancydash} \\
3627 % \>~\cs{origspacedemdash} \\
3628 % \>~\cs{endgroup}\}\specialsectionendhere
3629 % \end{codeexample}
3630 % \end{tip}
3631 %
3632 %
3633 % \subsection{Raise Selected Characters}\label{sec:raise-characters}
3634 % \index{raised character|userman}
3635 %
3636 % Usually all hyphens and dashes of a font are designed to join lowercase letters. This holds
3637 % also true for most of our \cs{labelitem}\meta{N} markers, bullets, stars, and even fancy
3638 % dingbats. If these hyphens and dashes connect uppercase letters (or lining numerals) they
3639 % sometimes appear to low; they disrespect the glyphs' symmetry axis. A similar situation
3640 % arises if |itemize|~list markers precede an uppercase letter, a lining numeral, or a big
3641 % mathematical operator.
3642 %
3643 % We introduce a set of macros for the most common cases that typeset these characters at a
3644 % user definable, adjusted height above the baseline. Readers familiar with
3645 % \mbox{OpenType} fonts will be reminded of the \code{case}~feature. Users can base their own
3646 % definitions of raised characters on their associated dimensions.\!\footnote{Also compare with
3647 % Ex.~12 in reference~\citenum{wermuth:2023} for an attempt to automate vertical alignment.}
3648 %
3649 % \begin{caution}
3650 % The height adjustment disables a font's built-in kerning.
3651 % \end{caution}
3652 %
3653 % \noindent
3654 % General note for all raised hyphen-like macros: Prefer the starred version if applied in
3655 % front of any punctuation.
3656 %
3657 %
3658 % \subsubsection{Capital Hyphen}\label{sec:capital-hyphen}
3659 % \index{raised character>hyphen|userman}
3660 %
3661 % \DescribeMacro{\capitalhyphen}
3662 % \DescribeMacro{\capitalhyphen*}
3663 % In many fonts the height of the hyphen character~\sample{-} above the baseline is optimized
3664 % for lowercase letters. In languages that capitalize their nouns as, e.\,g., German, this may
3665 % be too low for compounds involving capitals.
3666 %
3667 % \begin{synopsis}\label{syn:capitalhyphen}
3668 % \cs{capitalhyphen}\qquad \cs{capitalhyphen*}
3669 % \end{synopsis}
3670 %
3671 % \indexpackageoption{breakpenalty}
3672 % The unstarred version introduces a hyphenation opportunity right after the hyphen character
3673 % (with penalty~\hyperref[item:breakpenalty]{|breakpenalty|}) whereas the starred version does
3674 % not. The actual amount the hyphen gets raised in \cs{capitalhyphen} is determined by
3675 % \hyperref[item:raisecapitalhyphen]{|raisecapitalhyphen|}.
3676 %
3677 % \begin{usecases}
3678 % In languages that capitalize their nouns, the typical use-case is between an
3679 % \meta{ab\-bre\-vi\-a\-tion} and a \meta{noun} when \meta{ab\-bre\-vi\-a\-tion} is a string
3680 % of uppercase letters. The same holds true for a connection of an uppercase variable in
3681 % mathematical mode and a \meta{noun} starting with a capital letter.\visualpar Abbreviated
3682 % compound first names (e.\,g., A.\capitalhyphen* M.~Legendre) can be joined with the starred
3683 % version.\visualpar Also, the starred form is suited for \acronym{ISO~8601}-formatted dates
3684 % if they are composed with lining-style numerals.
3685 % \end{usecases}
3686 %
3687 %
3688 % \newpagetofixtoc
3689 % \subsubsection{Capital En-Dash and Capital Em-Dash}\label{sec:capital-dash}
3690 % \index{raised character>en-dash|userman}
3691 %
3692 % \DescribeMacro{\capitalendash}
3693 % \DescribeMacro{\capitalendash*}
3694 % \DescribeMacro{\capitaldash}
3695 % \DescribeMacro{\capitaldash*}
3696 % The situation of the en-dash~\sample{--} is almost identical to the one of the hyphen
3697 % character~\sample{-} described in the previous section or the number dash to be introduced in
3698 % the next section.
3699 %
3700 % \begin{synopsis}\label{syn:capitalendash}\label{syn:capitaldash}
3701 % \begin{tabbing}
3702 % \cs{capitalendash}\qquad\= \cs{capitaldash} (alias) \\
3703 % \cs{capitalendash*} \> \cs{capitaldash*} (alias)
3704 % \end{tabbing}
3705 % \end{synopsis}
3706 %
3707 % \indexpackageoption{breakpenalty}
3708 % The unstarred version introduces a hyphenation opportunity right after the dash (with
3709 % penalty~\hyperref[item:breakpenalty]{|breakpenalty|}) whereas the starred version does not.
3710 % \indexpackageoption{raisecapitaldash}
3711 % The actual amount the hyphen gets raised in \cs{capitaldash} is determined by
3712 % \hyperref[item:raisecapitaldash]{|raisecapitaldash|}.
3713 %
3714 % \begin{usecases}
3715 % Letter ranges as used in the title of an index.\visualpar Any mixed letter-digit ranges
3716 % (of capital letters and lining-style numerals) as in e.\,g., Sec.~B\capitaldash* 2.
3717 % \end{usecases}
3718 %
3719 % \index{raised character>em-dash|userman}
3720 % \noindent
3721 % \DescribeMacro{\capitalemdash}
3722 % \DescribeMacro{\capitalemdash*}
3723 % For completeness we also introduce a raised em-dash~\sample{---}. It behaves just like its
3724 % en-dash sibling.
3725 %
3726 % \begin{synopsis}\label{syn:capitalemdash}
3727 % \cs{capitalemdash}\qquad \cs{capitalemdash*}
3728 % \end{synopsis}
3729 %
3730 % \begin{usecases}
3731 % Item symbols in \code{itemized} lists if the item text starts with an uppercase
3732 % letter.\visualpar Theorem headings, like, e.\,g., \mbox{Definition 6.2 \capitalemdash{}
3733 % \textsc{Lie} Algebra}.
3734 % \end{usecases}
3735 %
3736 % \DescribeMacro{\leftspacedcapitalendash}
3737 % \DescribeMacro{\leftspacedcapitaldash}
3738 % \DescribeMacro{\leftspacedcapitalendash*}
3739 % \DescribeMacro{\leftspacedcapitaldash*}
3740 % \DescribeMacro{\rightspacedcapitalendash}
3741 % \DescribeMacro{\rightspacedcapitaldash}
3742 % \DescribeMacro{\rightspacedcapitalendash*}
3743 % \DescribeMacro{\rightspacedcapitaldash*}
3744 % \sinceversion{All since v0.5}
3745 % Combine raising a en-dash and adding some extra space around it.
3746 %
3747 % \begin{list}{}{\leftmargin=15pt \rightmargin=-30pt}\item
3748 % \begin{synopsis}\label{syn:spacedcapitalendash}
3749 % \begin{tabbing}
3750 % \cs{rightspacedcapitalendash*}\qquad \= \kill
3751 % \cs{leftspacedcapitalendash} \> \cs{leftspacedcapitaldash} (alias) \\
3752 % \cs{leftspacedcapitalendash*} \> \cs{leftspacedcapitaldash*} (alias) \\[\smallskipamount]
3753 % \cs{rightspacedcapitalendash} \> \cs{rightspacedcapitaldash} (alias) \\
3754 % \> \cs{spacedcapitalendash} (alias) \\
3755 % \> \cs{spacedcapitaldash} (alias) \\
3756 % \cs{rightspacedcapitalendash*}
3757 % \> \cs{spacedcapitalendash*} (alias) \\
3758 % \> \cs{spacedcapitaldash*} (alias)
3759 % \end{tabbing}
3760 % \end{synopsis}
3761 % \end{list}
3762 %
3763 % These macros unite the features of \hyperref[syn:capitalendash]{\cs{capitalendash}} with
3764 % those of \hyperref[syn:spacedendash]{\cs{spacedendash}} as described in
3765 % \cref{sec:spaced-dashes}.
3766 %
3767 % \DescribeMacro{\leftspacedcapitalemdash}
3768 % \DescribeMacro{\leftspacedcapitalemdash*}
3769 % \DescribeMacro{\rightspacedcapitalemdash}
3770 % \DescribeMacro{\rightspacedcapitalemdash*}
3771 % \DescribeMacro{\spacedcapitalemdash}
3772 % \DescribeMacro{\spacedcapitalemdash*}
3773 % \sinceversion{All since v0.5}
3774 % Combine raising a em-dash and adding some extra space around it.
3775 %
3776 % \begin{list}{}{\leftmargin=15pt \rightmargin=-30pt}\item
3777 % \begin{synopsis}\label{syn:spacedcapitalemdash}
3778 % \begin{tabbing}
3779 % \cs{rightspacedcapitalemdash*}\qquad \= \kill
3780 % \cs{leftspacedcapitalemdash} \\
3781 % \cs{leftspacedcapitalemdash*} \\[\smallskipamount]
3782 % \cs{rightspacedcapitalemdash}
3783 % \> \cs{spacedcapitalemdash} (alias) \\
3784 % \cs{rightspacedcapitalemdash*}
3785 % \> \cs{spacedcapitalemdash*} (alias)
3786 % \end{tabbing}
3787 % \end{synopsis}
3788 % \end{list}
3789 %
3790 % These macros unite the features of \hyperref[syn:capitalemdash]{\cs{capitalemdash}} with
3791 % those of \hyperref[syn:spacedemdash]{\cs{spacedemdash}} as described in
3792 % \cref{sec:spaced-dashes}.
3793 %
3794 % \begin{tip}
3795 % \index{textemdash=\verb!*+\textemdash+|userman}\relax
3796 % \index{textendash=\verb!*+\textendash+|userman}\relax
3797 % The macros rely on \cs{textemdash} and \cs{textendash} to typeset em-dashes and en-dashes.
3798 % If different glyphs are desired redefine them (preferably locally).
3799 %
3800 % See the \hyperref[tip:textemdash-textendash]{tip} on \cpageref{tip:textemdash-textendash}
3801 % for a code example.
3802 % \end{tip}
3803 %
3804 %
3805 % \subsubsection{Number Dash (Figure Dash)}\label{sec:number-dash}
3806 % \index{raised character>number dash|userman}
3807 %
3808 % \DescribeMacro{\figuredash}
3809 % \DescribeMacro{\figuredash*}
3810 % The en-dash often gets used as separator for numerical ranges. In most fonts it has the
3811 % correct height above baseline for oldstyle numerals,
3812 % e.\,g.~\oldstylenums{12}--\oldstylenums{34}--\oldstylenums{56}--\oldstylenums{78}, but with
3813 % lining numerals\leftspacedendash depending on the font\rightspacedendash it may look like
3814 % it suffers from \doublequotes{broken suspenders}:
3815 % 12\textendash34\textendash56\textendash78.\marginnote{\cs{figuredash} yields
3816 % 12\figuredash34\figuredash56\figuredash78 for sans-serif and {\rm
3817 % 12\figuredash34\figuredash56\figuredash78} for the roman typeface.} The situation is similar
3818 % to \cs{capitaldash} and \cs{capitalhyphen} discussed in
3819 % \cref{sec:capital-hyphen,sec:capital-dash}.
3820 %
3821 % \begin{synopsis}\label{syn:figuredash}
3822 % \cs{figuredash}\qquad \cs{figuredash*}
3823 % \end{synopsis}
3824 %
3825 % \indexpackageoption{breakpenalty}
3826 % The unstarred version introduces a hyphenation opportunity right after the en-dash with
3827 % penalty~\hyperref[item:breakpenalty]{|breakpenalty|} whereas the starred version does not.
3828 % \indexpackageoption{raisefiguredash}
3829 % The actual amount the en-dash gets raised in \cs{figuredash} is determined by
3830 % \hyperref[item:raisefiguredash]{|raisefiguredash|}.
3831 %
3832 % Values of .05\,em to .1\,em are typical for fonts that need this kind of correction
3833 % and~.1\,em is a good starting point. \Cref{tab:raisefiguredash} summarizes some findings.
3834 %
3835 % \begin{table}
3836 % \centering
3837 % \caption[Suggested raise amounts for \cs{figuredash}]%
3838 % {Suggested values for raising \cs{figuredash}, which actually is an en-dash,
3839 % between lining numerals of some selected fonts in multiples of~1\,em.}
3840 % \label{tab:raisefiguredash}
3841 %
3842 % \newcommand*{\fbbmark}{\tablenotemark{\tablenotesymbol{1}}}
3843 %
3844 % \begin{tabfigures}
3845 % \begin{tabularx}{\linewidth}{@{}>{\RaggedRight}Xl@{}}
3846 % \toprule
3847 % Font & Raise \\
3848 % \midrule
3849 % Alegreya\detoxindex{font>typeface>Alegreya|userman}, Arvo\detoxindex{font>typeface>Arvo|userman},
3850 % Bitter\detoxindex{font>typeface>Bitter|userman}, Clara\detoxindex{font>typeface>Clara|userman},
3851 % \acronym{EB}~Garamond\detoxindex{font>typeface>EB Garamond=\acronym{EB} Garamond|userman},
3852 % Gentium\detoxindex{font>typeface>Gentium|userman},
3853 % Ibarra Real Nova\detoxindex{font>typeface>Ibarra Real Nova|userman},
3854 % \acronym{Inria}~Serif\detoxindex{font>typeface>Inria Serif=\acronym{Inria} Serif|userman},
3855 % Libertine\detoxindex{font>typeface>Libertine|userman},
3856 % Libertinus\detoxindex{font>typeface>Libertinus Serif|userman},
3857 % Merriweather\detoxindex{font>typeface>Merriweather|userman},
3858 % \acronym{PT}~Serif\detoxindex{font>typeface>PT Serif=\acronym{PT} Serif|userman},
3859 % Roboto Slab\detoxindex{font>typeface>Roboto Slab|userman},
3860 % Spectral\detoxindex{font>typeface>Spectral|userman},
3861 % \acronym{STIX}\detoxindex{font>typeface>STIX=\acronym{STIX}|userman}, and many more &
3862 % .0 \\
3863 % Charis \acronym{SIL}\detoxindex{font>typeface>Charis SIL=Charis \acronym{SIL}|userman},
3864 % fbb\fbbmark\detoxindex{font>typeface>fbb|userman}\!,
3865 % Source Serif Pro\detoxindex{font>typeface>Source Serif Pro|userman} &
3866 % .05 \\
3867 % Libre Baskerville\detoxindex{font>typeface>Libre Baskerville|userman},
3868 % Crimson Pro\detoxindex{font>typeface>Crimson Pro|userman},
3869 % Erewhon\detoxindex{font>typeface>Erewhon|userman},
3870 % Droid Serif\detoxindex{font>typeface>Droid Serif|userman} &
3871 % .0667 \\
3872 % \acronym{GFS}~Artemisia\detoxindex{font>typeface>GFS Artemisia=\acronym{GFS} Artemisia|userman},
3873 % Libre Caslon\detoxindex{font>typeface>Libre Caslon|userman},
3874 % Coelacanth\detoxindex{font>typeface>Coelacanth|userman},
3875 % Crimson Pro\detoxindex{font>typeface>Crimson Pro|userman},
3876 % Crimson Text\detoxindex{font>typeface>Crimson Text|userman},
3877 % \TeX{} Gyre~Pagella\detoxindex{font>typeface>TeX Gyre Pagella=\TeX{} Gyre Pagella|userman},
3878 % Quattrocento\detoxindex{font>typeface>Quattrocento|userman},
3879 % \acronym{TX}~Fonts\detoxindex{font>typeface>TX Fonts=\acronym{TX} Fonts|userman},
3880 % \acronym{ADF}~Venturis\detoxindex{font>typeface>ADF Venturis=\acronym{ADF} Venturis|userman},
3881 % and many more &
3882 % .1 \\
3883 % \bottomrule
3884 % \end{tabularx}
3885 % \end{tabfigures}
3886 %
3887 % \begin{tablenotes}
3888 % \renewcommand*{\tablenotemark}[1]{#1}%
3889 % \fbbmark\enspace Free Bembo.
3890 % \end{tablenotes}
3891 % \end{table}
3892 %
3893 % Other macros may be redefined with \cs{figuredash} for a consistent appearance of the copy,
3894 % like, for example, \cs{citedash} (package~\packagename{cite}~\cite{package:cite}), or
3895 % \cs{crefrangeconjunction} (package~\packagename{cleveref}~\cite{package:cleveref}).
3896 %
3897 % \begin{usecase}
3898 % The key customers of \cs{figuredash} are the |PAGES|~entries of bibliography
3899 % databases.\visualpar In an index generated with \command{makeindex} the range
3900 % delimiter~\code{delim\_r} is a candidate for \cs{figuredash*}.
3901 % \end{usecase}
3902 %
3903 %
3904 % \newpagetofixtoc
3905 % \subsubsection[Multiplication Sign]%
3906 % {Multiplication Sign -- Times~\sample{\texttimes}}\label{sec:mult-sign}
3907 % \index{raised character>multiplication sign|userman}
3908 %
3909 % \DescribeMacro{\capitaltimes}
3910 % The \cs{capitaltimes}~macro is a variation of the
3911 % \hyperref[syn:capitalhyphen]{\cs{capitalhyphen}}~theme.
3912 %
3913 % \begin{synopsis}\label{syn:capitaltimes}
3914 % \cs{capitaltimes}
3915 % \end{synopsis}
3916 %
3917 % \indexpackageoption{raisecapitaltimes}
3918 % In text mode, it expands to an appropriately raised \cs{texttimes}, and in math~mode to a
3919 % raised \cs{times} binary~operator, where
3920 % \hyperref[item:raisecapitaltimes]{|raisecapitaltimes|} determines the amount of
3921 % upward-shifting applied; it never inserts any break points.
3922 %
3923 % \begin{usecase}
3924 % Prime use are two- or higher-dimensional shape specifications with lining numerals or
3925 % uppercase letters in mathematical mode as, for example, matrix or tensor sizes.
3926 % \end{usecase}
3927 %
3928 %
3929 % \subsubsection{Guillemets}\label{sec:guillemets}
3930 % \index{raised character>guillemets|userman}
3931 %
3932 % Another possible typographic problem this package addresses is that both
3933 % sets\leftspacedendash\marginnote{The sentence uses
3934 % \hyperref[syn:spacedendash]{\cs{left\-spaced\-endash}} and
3935 % \hyperref[syn:spacedendash]{\cs{right\-spaced\-endash}}.} single and double
3936 % quotes\rightspacedendash of guillemets may suffer from a too small distance to the baseline.
3937 %
3938 % For the implementation \packagename{typog} relies on the T1\footnote{Font
3939 % encoding~T1\detoxindex{font>encoding|userman} can be forced via
3940 % \cs{usepackage}|[T1]\{fontenc\}| in the document preamble.}~font encoding not on
3941 % package~\packagename{babel}.
3942 %
3943 %
3944 % \paragraph{Lowercase Versions.}
3945 %
3946 % \DescribeMacro{\singleguillemetleft}
3947 % \DescribeMacro{\singleguillemetright}
3948 % \DescribeMacro{\doubleguillemetleft}
3949 % \DescribeMacro{\doubleguillemetright}
3950 % \begin{synopsis}
3951 % \label{syn:singleguillemetleft}
3952 % \label{syn:singleguillemetright}
3953 % \label{syn:doubleguillemetleft}
3954 % \label{syn:doubleguillemetright}
3955 % \begin{tabbing}
3956 % \cs{singleguillemetleft}\qquad\= \cs{singleguillemetright} \\
3957 % \cs{doubleguillemetleft}\> \cs{doubleguillemetright}
3958 % \end{tabbing}
3959 % \end{synopsis}
3960 %
3961 % \noindent
3962 % For consistency and easy accessibility we define height-adjusted left and right single
3963 % guillemets as \cs{singleguillemetleft} and \cs{singleguillemetright}; double guillemets are
3964 % available with \cs{doubleguillemetleft} and \cs{doubleguillemetright}.
3965 % \indexpackageoption{raiseguillemets}
3966 % Their heights above the baseline are collectively adjusted with
3967 % \hyperref[item:raiseguillemets]{|raiseguillemets|}.
3968 %
3969 %
3970 % \paragraph{Uppercase Versions.}
3971 %
3972 % \DescribeMacro{\Singleguillemetleft}
3973 % \DescribeMacro{\Singleguillemetright}
3974 % \DescribeMacro{\Doubleguillemetleft}
3975 % \DescribeMacro{\Doubleguillemetright}
3976 % \begin{synopsis}
3977 % \label{syn:Singleguillemetleft}
3978 % \label{syn:Singleguillemetright}
3979 % \label{syn:Doubleguillemetleft}
3980 % \label{syn:Doubleguillemetright}
3981 % \begin{tabbing}
3982 % \cs{Singleguillemetleft}\qquad\= \cs{Singleguillemetright} \\
3983 % \cs{Doubleguillemetleft}\> \cs{Doubleguillemetright}
3984 % \end{tabbing}
3985 % \end{synopsis}
3986 %
3987 % \noindent
3988 % The companion set of single, double, left, and right quotes corrected for uppercase letters
3989 % or lining numerals is \cs{Singleguillemetleft} and \cs{Singleguillemetright} and
3990 % \cs{Doubleguillemetleft} and \cs{doubleguillemetright}. Mnemonic: These macros start with an
3991 % uppercase letter.
3992 % \indexpackageoption{raisecapitalguillemets}
3993 % Their height above the baseline is adjusted with
3994 % \hyperref[item:raisecapitalguillemets]{|raisecapitalguillemets|}. Values of .025\,em to
3995 % .075\,em are typical for fonts that need this kind of correction. \Cref{tab:raiseguillemets}
3996 % summarizes some findings.
3997 %
3998 % \begin{table}
3999 % \centering
4000 % \caption[Suggested raise amounts for guillemets]%
4001 % {Suggested values for raising guillemets of some selected fonts in multiples
4002 % of~1\,em.}
4003 % \label{tab:raiseguillemets}
4004 %
4005 % \begin{tabfigures}
4006 % \def~{\hphantom{0}}
4007 % \begin{tabular}{@{}>{\RaggedRight}p{.5\textwidth}cc@{}}
4008 % \toprule
4009 % Font & Uppercase & Lowercase \\
4010 % \midrule
4011 % \acronym{EB} Garamond\detoxindex{font>typeface>EB Garamond=\acronym{EB} Garamond|userman},
4012 % Libertinus\index{font>typeface>Libertinus Serif|userman},
4013 % Merriweather\index{font>typeface>Merriweather|userman}, and many more &
4014 % .05~~ & .0~~~ \\
4015 % Gentium\index{font>typeface>Gentium|userman} &
4016 % .05~~ & .025~ \\
4017 % \acronym{GFS} Artemisia\detoxindex{font>typeface>GFS Artemisia=\acronym{GFS} Artemisia|userman},
4018 % \acronym{GFS} Didot\detoxindex{font>typeface>GFS Didot=\acronym{GFS} Didot|userman} &
4019 % .0625 & .05~~ \\
4020 % Charis \acronym{SIL}\detoxindex{font>typeface>Charis SIL=Charis \acronym{SIL}|userman} &
4021 % .0667 & .0333 \\
4022 % \acronym{ADF} Baskervald\index{font>typeface>ADF Baskervald=\acronym{ADF} Baskervald|userman} &
4023 % .0667 & .04~~ \\
4024 % \bottomrule
4025 % \end{tabular}
4026 % \end{tabfigures}
4027 % \end{table}
4028 %
4029 % \begin{tip}
4030 % Define shorthand macros that simplify the application of guillemets, like, e.\,g.,
4031 %
4032 % \begin{codeexample}
4033 % \cs{newcommand*}\= \{\= \cs{singlequotes}\}[1] \\
4034 % \> \{\cs{singleguillemetright} \#1\% \\
4035 % \> \> \cs{singleguillemetleft}\} \\
4036 % \cs{let}\cs{sq}=\cs{singlequotes}
4037 % \end{codeexample}
4038 %
4039 % \noindent
4040 % and similar definitions for \cs{Singlequotes}, \cs{doublequotes}, and \cs{Doublequotes}.
4041 %
4042 % Users working according to the French typesetting conventions will want to add extra
4043 % spacing between the guillemets and the macro argument already in these macros.
4044 % \end{tip}
4045 %
4046 % \noindent
4047 % Whether the guillemets must be height-adjusted for lowercase letters depends on the font.
4048 % Careful judgment at various magnifications with a variety of samples is necessary.
4049 %
4050 %
4051 % \paragraph{Interaction with package~\packagename{csquotes}.}
4052 % \index{csquotes=\packagename{csquotes} (package)|userman}
4053 %
4054 % The users of package~\packagename{csquotes}
4055 % can hook up the guillemets as defined by \packagename{typog}
4056 % with \cs{DeclareQuoteStyle}:
4057 %
4058 % \begin{codeexample}
4059 % 12\=\kill
4060 % \cs{DeclareQuoteStyle}\{typog-guillemets\} \\
4061 % \> \{\cs{doubleguillemetright}\}\%\qquad\= opening outer mark \\
4062 % \> \{\cs{doubleguillemetleft}\}\% \> closing outer mark \\
4063 % \> \{\cs{singleguillemetright}\}\% \> opening inner mark \\
4064 % \> \{\cs{singleguillemetleft}\}\% \> closing inner mark
4065 % \end{codeexample}
4066 %
4067 % \noindent
4068 % As always, the influence of package~\packagename{babel} on \packagename{csquotes} has to be
4069 % put into consideration. See Sec.~8 of the \packagename{csquotes}~manual for a description of
4070 % its configuration possibilities.
4071 %
4072 % \begin{usecase}
4073 % All-capital words as for example acronyms put in guillemets that are raised somewhat almost
4074 % always look better, whether using the French typographic convention (guillemets pointing
4075 % outward plus some extra kerning) or the other way round (guillemets pointing inward).
4076 % \end{usecase}
4077 %
4078 % \begin{futuredirection}
4079 % A correction in the other direction, i.\,e., lowering certain characters may also be
4080 % desirable, to visually align them to the surrounding copy. Parentheses and in particular
4081 % square brackets around all-lowercase text come into mind.
4082 % \end{futuredirection}
4083 %
4084 %
4085 % \subsubsection[Inverted Marks]
4086 % {Inverted Exclamation Mark and
4087 % Inverted Question Mark}\label{sec:inverted-marks}
4088 % \index{inverted>exclamation mark|userman}
4089 % \index{inverted>question mark|userman}
4090 % \index{raised character>inverted exclamation mark|userman}
4091 % \index{raised character>inverted question mark|userman}
4092 %
4093 % The Spanish (Castilian, Asturian, etc.) language requires exclamatory sentences and questions
4094 % to be followed by exclamation marks and question marks and recommends that they are preceded
4095 % by inverted (or \singlequotes{upside-down}) versions of these punctuation characters.
4096 %
4097 % Usually the horizontally-mirrored versions' designs follow that of the lowercase letters. In
4098 % particular the inverted marks exhibit descenders (see left-hand side of
4099 % \cref{fig:inverted-marks}). For all-uppercase or all-smallcaps phrases, e.\,g.~in headlines
4100 % the descending parts of these marks disturb the tight block structure and it may be
4101 % preferable to have inverted marks that align with the baseline.
4102 %
4103 % \hangindent=3\parindent
4104 % \hangafter=-3
4105 % \noindent
4106 % \DescribeMacro{\capitalinvertedexclamationmark}
4107 % \DescribeMacro{\capitalinvertedquestionmark}
4108 % \sinceversion{Both since v0.5}
4109 % The macros \cs{capitalinvertedexclamationmark} and \cs{capitalinvertedquestionmark}
4110 % simultaneously provide bottom-aligned inverted marks for up to three different sets of
4111 % exclamation marks or question marks, e.\,g., for uppercase, med-caps, and small-caps
4112 % text\footnote{The small exclamation and question marks even made it into Unicode.} or just
4113 % for some stylistic alternatives offered by particularly well equipped fonts.
4114 %
4115 % \begin{synopsis}
4116 % \label{syn:capitalinvertedexclamationmark}
4117 % \label{syn:capitalinvertedquestionmark}
4118 % \cs{capitalinvertedexclamationmark}\marg{number} \\
4119 % \cs{capitalinvertedquestionmark}\marg{number}
4120 % \end{synopsis}
4121 %
4122 % Typeset inverted exclamation marks and inverted question mark. Select the appropriate mark
4123 % and the associated raise-amount with \meta{number}=1, 2, or~3. We sketch the result of the
4124 % automated correction process in \Cref{fig:inverted-marks}.
4125 %
4126 % \iffalse
4127 %<*invertedmarks>
4128 prologues := 3;
4129 bboxmargin := 0;% Extremely important setting: otherwise all our bboxes are too loose!
4130 linecap := butt;
4131 truecorners := 1;
4132
4133 string roman_font;
4134 roman_font := "pplr8r"; % URW Palladio L - Roman
4135
4136 font_scale := 5;
4137
4138 picture letter_a;
4139 letter_a := thelabel("a" infont roman_font scaled font_scale, origin);
4140 path bbox_a;
4141 bbox_a := bbox letter_a;
4142 ex_height := ypart (ulcorner bbox_a - llcorner bbox_a);
4143 show ex_height;
4144
4145 picture letter_g;
4146 letter_g := thelabel("g" infont roman_font scaled font_scale, origin);
4147 path bbox_g;
4148 bbox_g := bbox letter_g;
4149 descender_height := ypart (ulcorner bbox_g - llcorner bbox_g) - ex_height;
4150 show descender_height;
4151
4152 string inverted_exclamation_mark_char;
4153 inverted_exclamation_mark_char := char(161);
4154
4155 string inverted_question_mark_char;
4156 inverted_question_mark_char := char(191);
4157
4158 picture font_sample;
4159 font_sample := thelabel(("g" & inverted_exclamation_mark_char & "jk" &
4160 inverted_question_mark_char & "y " &
4161 inverted_exclamation_mark_char & " E! " &
4162 inverted_question_mark_char & " Q?")
4163 infont roman_font scaled font_scale, origin);
4164 path bbox_sample;
4165 bbox_sample := bbox font_sample;
4166
4167 %% The locations of shifted_inverted_exclamation_mark and
4168 %% shifted_inverted_question_mark are 100% pure fudge!
4169 picture shifted_inverted_exclamation_mark;
4170 shifted_inverted_exclamation_mark :=
4171 thelabel(inverted_exclamation_mark_char infont roman_font scaled font_scale,
4172 font_scale * (2.6, 1.333));
4173
4174 picture shifted_inverted_question_mark;
4175 shifted_inverted_question_mark :=
4176 thelabel(inverted_question_mark_char infont roman_font scaled font_scale,
4177 font_scale * (20.6, 1.333));
4178
4179
4180 beginfig(1);
4181 draw font_sample;
4182 draw shifted_inverted_exclamation_mark withcolor .8 white;
4183 draw shifted_inverted_question_mark withcolor .8 white;
4184
4185 draw (xpart (llcorner bbox_sample), ypart (llcorner bbox_sample) + descender_height) --
4186 (xpart (lrcorner bbox_sample), ypart (lrcorner bbox_sample) + descender_height)
4187 withpen pencircle scaled .3333pt;
4188 draw (llcorner bbox_sample) -- (lrcorner bbox_sample)
4189 dashed evenly withpen pencircle scaled .25pt;
4190 draw (xpart (llcorner bbox_sample), ypart (llcorner bbox_sample) + descender_height + ex_height) --
4191 (xpart (lrcorner bbox_sample), ypart (lrcorner bbox_sample) + descender_height + ex_height)
4192 dashed evenly withpen pencircle scaled .25pt;
4193 endfig;
4194 end
4195 %</invertedmarks>
4196 % \fi
4197 %
4198 % \begin{figure}
4199 % \centering
4200 % \includegraphics{inverted-marks-1.mps}
4201 % \caption[Inverted exclamation and question marks]
4202 % {The left-hand sample shows the inverted exclamation marks and question marks
4203 % wedged between some lowercase letters. The baseline is drawn with a solid lineand
4204 % the ex-height as well as the descender depth are indicated with dashed
4205 % lines.\visualpar On the right hand side we display the same marks in conjunction
4206 % with capital letters. The gray glyphs demonstrate the result of shifting them up
4207 % such that they exactly touch the baseline, which mimics the auto-raise mode
4208 % described in the text.\visualpar The sample font once again is
4209 % \acronym{URW}~Palladio%
4210 % \detoxindex{font>typeface>URW Palladio=\acronym{URW} Palladio|userman}.%
4211 % \label{fig:inverted-marks}}
4212 % \end{figure}
4213 %
4214 % \indexpackageoption{raiseinvertedmarks}
4215 % Inverted exclamation and inverted question marks by the same \meta{number} are raised by the
4216 % same amount which is configurable with
4217 % option~\hyperref[item:raiseinvertedmarks]{\code{raiseinvertedmarks}}, where \meta{number}
4218 % corresponds to the dimension at position~\meta{number}. If the dimension is equal to
4219 % \formatdimen*{0pt} the marks are auto-raised as shown in \cref{fig:inverted-marks}. This may
4220 % amount to different lengths for the inverted exclamation mark and inverted question mark even
4221 % at the same \meta{number}. A nonzero dimension raises the marks by exactly that length. To
4222 % get a near-zero length use e.\,g.~1\,sp.
4223 %
4224 % \begin{tip}
4225 % \index{itcorr=\verb!*+\itcorr+|userman}\relax
4226 % The letters \sample{\itcorr{-2}V}, \sample{\itcorr{-2}W}, and \sample{\itcorr{-1}Y}
4227 % following an inverted question mark may need some manual kerning as well as
4228 % \sample{\itcorr{3}J} following an inverted exclamation mark.
4229 % Macro~\hyperref[syn:itcorr]{\cs{itcorr}} (\cpageref{syn:itcorr}) offers a solution that is
4230 % almost portable across font changes and a \meta{strength} of \textminus1 is a good starting
4231 % point.
4232 % \end{tip}
4233 %
4234 % The user-side macros \cs{capitalinvertedexclamationmark}\marg{number} and
4235 % \cs{capitalinvertedquestionmark}\marg{number} call the parameter-less, internal macros
4236 %
4237 % \begin{synopsis}
4238 % \cs{typog@inverted@exclamationmark@}\meta{roman-numeral} \\
4239 % \cs{typog@inverted@questionmark@}\meta{roman-numeral}
4240 % \end{synopsis}
4241 %
4242 % \index{textexclamdown=\verb!*+\textexclamdown+|userman}
4243 % \index{textquestiondown=\verb!*+\textquestiondown+|userman}
4244 % \noindent
4245 % where \meta{roman-numeral}=\code{i}, \code{ii}, and~\code{iii} correpspond to
4246 % \meta{number}=1, 2, and~3. Their defaults are \cs{textexclamdown} and \cs{textquestiondown}
4247 % for all three numbers. Users can redefine the internal macros to hook up special fonts or
4248 % characters.
4249 %
4250 %
4251 % \subsection[Vertically Adjust Label Items]
4252 % {Vertically Adjust Label Items of
4253 % Environment \code{itemize}}\label{sec:adjust-label-items}
4254 % \index{label items|userman}
4255 %
4256 % \begin{whittyquote}
4257 % Perfection of planned layout \\
4258 % is achieved only by institutions \\
4259 % on the point of collapse. \\
4260 % \capitalemdash*~\propername{Cyril Northcote Parkinson}
4261 % \end{whittyquote}
4262 %
4263 % \noindent
4264 % The symbols that \LaTeX{} uses to distinguish the items of |itemize|~lists do not always
4265 % align well in the vertical direction with the following text. Sometimes the label is too
4266 % low, especially if followed by an uppercase (initial) letter. In rare occasions the label is
4267 % placed too far above the baseline. If any label has been taken from a math-font vertical
4268 % alignment with the text font is almost purely accidental.\!\footnote{The exception being
4269 % mathematics typeset as text via package~\packagename{mathastext}~\cite{package:mathastext}.}
4270 %
4271 % \hangindent=2\parindent
4272 % \hangafter=-3
4273 % \noindent
4274 % \DescribeMacro{\uppercaseadjustlabelitems}
4275 % \DescribeMacro{\lowercaseadjustlabelitems}
4276 % \DescribeMacro{\noadjustlabelitems}
4277 % \sinceversion{All three since v0.5}
4278 % Package~\packagename{typog} lets the user vertically align the \code{itemize}~labels for
4279 % subsequent uppercase or lowercase letters, where the designations~\singlequotes{uppercase}
4280 % and \singlequotes{lowercase} are just names for two four-tuples of lengths (technically:
4281 % |dimen|s) to shift the labels up or down.
4282 %
4283 % \begin{synopsis}
4284 % \label{syn:lowercaseadjustlabelitems}
4285 % \label{syn:noadjustlabelitems}
4286 % \label{syn:uppercaseadjustlabelitems}
4287 % \cs{uppercaseadjustlabelitems}\marg{levels-to-adjust} \\
4288 % \cs{lowercaseadjustlabelitems}\marg{levels-to-adjust} \\
4289 % \cs{noadjustlabelitems}\marg{levels-to-adjust}
4290 % \end{synopsis}
4291 %
4292 % \indexpackageoption{lowercase\-labelitem\-adjustments}
4293 % \indexpackageoption{uppercase\-labelitem\-adjustments}
4294 % Apply uppercase adjustment, lowercase adjustment or no adjustment to the labels in
4295 % |itemize|~environments at the \meta{levels-to-adjust}. The adjustment values themselves,
4296 % this is the vertical shifts are configured with
4297 % options~\hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}}
4298 % and~\hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}}.
4299 % They are doubly font dependent: on the one hand the font where the label itself comes from
4300 % and on the other hand the font of the copy.
4301 %
4302 % The argument \meta{levels-to-adjust} is a\leftspacedendash possibly empty\rightspacedendash
4303 % comma separated list of the levels the adjustments are to be applied to. The levels
4304 % themselves are given as \emph{decimal} numbers, this is, 1, 2, 3, 4 or the special
4305 % value~\samplestar{} which stands for all four levels. An empty argument list also has a
4306 % special meaning. Used within any \code{itemize}~environment it automatically applies the
4307 % adjustment to exactly this level.
4308 %
4309 % \begin{example}
4310 % \begin{typogsetup}{uppercaselabelitemadjustments={.1em}}
4311 % With the flexible syntax the following settings are possible.
4312 %
4313 % \renewcommand*{\labelitemi}{{\small$\rhd$}}%
4314 % \begin{itemize}\uppercaseadjustlabelitems{}
4315 % \item Correct all |itemize| labels for uppercase letters.
4316 %
4317 % \begin{codeexample}
4318 % \cs{uppercaseadjustlabelitems}\{*\}
4319 % \end{codeexample}
4320 %
4321 % \item Adjust nesting levels~1, 2, and~3 for uppercase letters and level~4 for lowercase.
4322 %
4323 % \begin{codeexample}
4324 % \cs{lowercaseadjustlabelitems}\{4\} \\
4325 % \cs{uppercaseadjustlabelitems}\{2,3,1\}
4326 % \end{codeexample}
4327 %
4328 % \item Within an |itemize|~environment just turn off any correction for this level whatever
4329 % it may be.
4330 %
4331 % \begin{codeexample}
4332 % \cs{begin}\{itemize\} \\
4333 % \cs{noadjustlabelitems}\{\} \\
4334 % \cs{item} \ttdots \\
4335 % \cs{end}\{itemize\}
4336 % \end{codeexample}
4337 %
4338 % \item Override \cs{labelitemi} with a right-pointing triangle and adjust its vertical
4339 % position inside of a \code{typogsetup}~environment.
4340 %
4341 % \begin{codeexample}
4342 % \cs{begin}\=\{typogsetup\} \\
4343 % \>\{uppercaselabelitemadjustments=\{.1em\}\} \\
4344 % 12\=34567890 \kill
4345 % \>\cs{renewcommand*}\{\cs{labelitemi}\}\{\{\cs{small}\$\cs{rhd}\$\}\} \\
4346 % \>\cs{begin}\{itemize\} \\
4347 % \>\cs{uppercaseadjustlabelitems}\{\} \\
4348 % \>\cs{item} \ttdots \\
4349 % \>\cs{end}\{itemize\} \\
4350 % \cs{end}\{typogsetup\}
4351 % \end{codeexample}
4352 % \end{itemize}
4353 %
4354 % The observant reader will have noticed that the itemized list in this example uses this
4355 % code.
4356 % \end{typogsetup}
4357 % \end{example}
4358 %
4359 %
4360 % \paragraph{Setup.}
4361 %
4362 % To assist the user in finding the desired adjustments of the labels of \packagename{typog}
4363 % provides macros that help setting up
4364 % \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}} and
4365 % \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}}. Their
4366 % intended uses are in the draft phase of a document or in non-printed sections of the text.
4367 %
4368 % The macros assume a \singlequotes{correct} height that they derive from the measured height
4369 % of a sample text scaled by a user-defined factor, which defaults
4370 % to~\nativetextfraction{1}{2}.\!\footnote{The default factor of~\nativetextfraction{1}{2}
4371 % hearkens back to \propername{Strizver's} suggestion that \doublequotes{[b]ullets should be
4372 % centered on either the cap~height or x-height of the neighboring
4373 % text,~[\dots].}~\cite[p.~220]{strizver:2014}.} The then correct height gets indicated by a
4374 % thin horizontal line parallel to the baseline. Thus, at sufficiently high magnifications it
4375 % is possible to judge whether a label gets typeset too high or too low with respect to this
4376 % reference line.
4377 %
4378 % \begin{note}
4379 % The macros use the actual height of a given sample~text. So, a lowercase~sample should not
4380 % contain any letters with ascenders.
4381 %
4382 % Swashes whether upper- or lowercase always need special attention.
4383 % \end{note}
4384 %
4385 % \DescribeMacro{\Adjustedlabelitemi}
4386 % \DescribeMacro{\Adjustedlabelitemii}
4387 % \DescribeMacro{\Adjustedlabelitemiii}
4388 % \DescribeMacro{\Adjustedlabelitemiv}
4389 % \DescribeMacro{\adjustedlabelitemi}
4390 % \DescribeMacro{\adjustedlabelitemii}
4391 % \DescribeMacro{\adjustedlabelitemiii}
4392 % \DescribeMacro{\adjustedlabelitemiv}
4393 % \sinceversion{All eight since v0.5}
4394 % Sometimes uppercase-adjusted or lowercase-adjusted label items are needed outside of
4395 % \code{itemize}~environments.
4396 %
4397 % \begin{synopsis}\label{syn:Adjustedlabelitem}\label{syn:adjustedlabelitem}
4398 % \begin{tabular}{@{}l@{\hspace{2em}}l@{}}
4399 % \cs{Adjustedlabelitemi} & \cs{adjustedlabelitemi} \\
4400 % \cs{Adjustedlabelitemii} & \cs{adjustedlabelitemii} \\
4401 % \cs{Adjustedlabelitemiii} & \cs{adjustedlabelitemiii} \\
4402 % \cs{Adjustedlabelitemiv} & \cs{adjustedlabelitemiv}
4403 % \end{tabular}
4404 % \end{synopsis}
4405 %
4406 % Typeset label items that are height-adjusted according to
4407 % \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}} or
4408 % \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}} either
4409 % for uppercase (macros starting with a capital~\sample{A}) or lowercase (macros starting with
4410 % a small~\sample{a}). These macros can be used anywhere. They are \emph{not} controlled by
4411 % \hyperref[syn:uppercaseadjustlabelitems]{\cs{uppercaseadjustlabelitems}},
4412 % \hyperref[syn:lowercaseadjustlabelitems]{\cs{lowercaseadjustlabelitems}}, nor
4413 % \hyperref[syn:noadjustlabelitems]{\cs{noadjustlabelitems}}.
4414 %
4415 % \begin{usecases}
4416 % Free, user-defined lists.\visualpar
4417 % Injection of \packagename{typog}'s height-adjustment functionality in other packages as,
4418 % for example, \packagename{tasks}~\cite{package:tasks}.
4419 % \end{usecases}
4420 %
4421 % \DescribeMacro{\typogadjuststairs}
4422 % \sinceversion{Since v0.5}
4423 % To get a quick overview how the four \code{itemize}~labels align vertically
4424 % \cs{typogadjuststairs} draws them at user-defined steps, typically
4425 % \nativetextfraction{1}{4}\,pt, \nativetextfraction{1}{3}\,pt, or
4426 % \nativetextfraction{1}{2}\,pt. It ignores any existing adjustments and in that way can be
4427 % utilized as a first configuration step or, for a small \meta{step-size} and a high
4428 % \meta{number-of-steps}, for an easy refinement.
4429 %
4430 % \begin{synopsis}
4431 % \begin{tabbing}
4432 % \label{syn:typogadjuststairs}
4433 % \cs{typogadjuststairs}\=[\meta{scale-factor}=.5] \\
4434 % \>\marg{step-size}\marg{number-of-steps} \\
4435 % \>\marg{sample}
4436 % \end{tabbing}
4437 % \end{synopsis}
4438 %
4439 % Generate stairs of \meta{number-of-steps} vertically shifted label items; use the next odd
4440 % number, if \meta{number-of-steps} is even. Draw a reference hairline at \meta{scale-factor}
4441 % times the height of \meta{sample}, where \meta{scale-factor} defaults to~.5. The stairs
4442 % start at a vertical shift of
4443 % \begin{gather*}
4444 % -\frac{\text{\meta{number-of-steps}} - 1}{2} \times \text{\meta{step-size}} \\
4445 % \intertext{and repeat up to}
4446 % \frac{\text{\meta{number-of-steps}} - 1}{2} \times \text{\meta{step-size}}.
4447 % \end{gather*}
4448 %
4449 % The central step\leftspacedendash which is always surrounded by a bit more
4450 % space\rightspacedendash shows the neutral, uncorrected alignment, this is, 0\,pt.
4451 % \cs{typogadjuststairs} never prints the contents of \meta{sample}.
4452 %
4453 % \begin{example}
4454 % Play ball!
4455 %
4456 % \begin{center}
4457 % \typogadjuststairs{.25pt}{11}{ABC}
4458 % \end{center}
4459 %
4460 % This is the result of \code{\string\typogadjuststairs\{.25pt\}\{11\}\{ABC\}} with the
4461 % document's definitions of \cs{labelitem}\meta{N}. The middle (6\textsuperscript{th})
4462 % label~item in each line is the uncorrected one.
4463 % \end{example}
4464 %
4465 % \hangindent=2\parindent
4466 % \hangafter=-3
4467 % \noindent
4468 % \DescribeMacro{\typoguppercaseadjustcheck}
4469 % \DescribeMacro{\typoglowercaseadjustcheck}
4470 % \sinceversion{Both since v0.5}
4471 % For a quick and easy check how the four label items vertically align \emph{as configured} use
4472 % \code{\string\typoguppercaseadjustcheck} and \code{\string\typoglowercaseadjustcheck}.
4473 % Experienced users with a keen eye for type can apply these macros even in the initial setup.
4474 % An accurate determination of \code{uppercaselabelitemadjustments} and
4475 % \code{lowercaselabelitemadjustments} is preferably done at a high magnification (e.\,g.,
4476 % 400\% to 600\% on a 100\,dpi screen) with a representative sample of initial letters.
4477 %
4478 % \begin{synopsis}
4479 % \label{syn:typoguppercaseadjustcheck}
4480 % \label{syn:typoglowercaseadjustcheck}
4481 % \cs{typoguppercaseadjustcheck}[\meta{scale-factor}=.5]\marg{sample} \\
4482 % \cs{typoglowercaseadjustcheck}[\meta{scale-factor}=.5]\marg{sample}
4483 % \end{synopsis}
4484 %
4485 % Typeset all four label items adjusted for uppercase or for lowercase with an indicator line
4486 % at \meta{scale-factor} times the \meta{sample}'s actual height. The default
4487 % \meta{scale-factor} is~.5. Both macros refer to the currently configured values for the
4488 % uppercase or lowercase adjustments but they are independent of any settings done with
4489 % \cs{uppercaseadjustlabelitems}, \cs{lowercaseadjustlabelitems}, or \cs{noadjustlabelitems}.
4490 % Again, \meta{sample} does not get printed.
4491 %
4492 % \begin{example}
4493 % Uppercase check with \code{\string\typoguppercaseadjustcheck\{ABCXYZ\}}:
4494 %
4495 % \centering
4496 % ABGH\typoguppercaseadjustcheck{ABCXYZ}QWYZ,\enspace
4497 % 0123\typoguppercaseadjustcheck{ABCXYZ}4567
4498 %
4499 % \justifying
4500 % \noindent
4501 % and similarly for lowercase: \code{\string\typoglowercaseadjustcheck\{acexyz\}}:
4502 %
4503 % \centering
4504 % ace\typoglowercaseadjustcheck{acexyz}mno,\enspace
4505 % bdf\typoglowercaseadjustcheck{acexyz}gjy,\enspace
4506 % {\proportionaloldstylefigures 0123\typoglowercaseadjustcheck{acexyz}4567,}
4507 %
4508 % \justifying
4509 % \noindent
4510 % where we have bracketed the macro calls with selected uppercase and lowercase letters, or
4511 % suitable figures.
4512 % \end{example}
4513 %
4514 % In \Cref{tab:labelitemadjustvalues} on \cpageref{tab:labelitemadjustvalues} we collected some
4515 % suggestions for adjustment values in the \emph{default} case when the label items are not
4516 % redefined by the user and expand like
4517 %
4518 % \begin{center}
4519 % \def\arraystretch{1}
4520 % \begin{tabular}{@{}l@{\enspace\(\vdash\)\enspace}l@{}}
4521 % \cs{labelitemi} & \dumpmacro{\labelitemi}, \\
4522 % \cs{labelitemii} & \dumpmacro{\labelitemii}, \\
4523 % \cs{labelitemiii} & \dumpmacro{\labelitemiii}, and \\
4524 % \cs{labelitemiv} & \dumpmacro{\labelitemiv}.
4525 % \end{tabular}
4526 % \end{center}
4527 %
4528 % \noindent
4529 % They display as \sample{\labelitemi}, \sample{\labelitemii}, \sample{\labelitemiii}, and
4530 % \sample{\labelitemiv}.
4531 %
4532 % \begin{table}
4533 % \centering
4534 % \caption[Label item adjustment suggestions]%
4535 % {Some suggested values for the vertical adjustments of label items. The table
4536 % assumes that the default definitions (of class~\packagename{article}) for
4537 % \cs{labelitem}\meta{N} are in effect. The \code{itemize}-list levels~\code{i},
4538 % \code{ii}, \code{iii}, and~\code{iv} are referred to with \(N = 1, 2, 3, 4\). All
4539 % lengths are given as printer points~(pt) and relate to a document font size of
4540 % \formatdimen*{10pt}.}
4541 % \label{tab:labelitemadjustvalues}
4542 %
4543 % \newcommand*{\etbbmark}{\tablenotemark{\tablenotesymbol{1}}}
4544 % \newcommand*{\xchartermark}{\tablenotemark{\tablenotesymbol{2}}}
4545 % \newcommand*{\kpmark}{\tablenotemark{\tablenotesymbol{3}}}
4546 % \newcommand*{\palladiomark}{\tablenotemark{\tablenotesymbol{4}}}
4547 % \newcommand*{\utopiamark}{\tablenotemark{\tablenotesymbol{5}}}
4548 %
4549 % \begin{tabfigures}
4550 % \def~{\hphantom{0}}
4551 % \def\mc#1{#1~~~}
4552 % \noindent
4553 % \makebox[0pt]{%
4554 % \begin{tabular}{@{}l*{4}{r}@{\qquad}*{4}{r}@{}}
4555 % \toprule
4556 % Font Name &
4557 % \multicolumn{4}{c}{Uppercase Adjustments} & \multicolumn{4}{c@{}}{Lowercase Adjustments} \\
4558 % {} &
4559 % \mc{1} & \mc{2} & \mc{3} & \mc{4} &
4560 % \mc{1} & \mc{2} & \mc{3} & \mc{4} \\
4561 % \midrule
4562 % \acronym{ADF} Accanthis\detoxindex{font>typeface>ADF Venturis=\acronym{ADF} Accanthis|userman} &
4563 % 1.0~~ & .75~ & 1.125 & 1.125 &
4564 % .0~~ & \textminus.25~ & \textminus.125 & .0~~ \\
4565 % \acronym{ADF} Venturis\detoxindex{font>typeface>ADF Venturis=\acronym{ADF} Venturis|userman} &
4566 % .75~ & .5~~ & .75~ & .875 &
4567 % \textminus.125 & \textminus.25~ & \textminus.125 & \textminus.125 \\
4568 % Aleo\detoxindex{font>typeface>Aleo|userman} &
4569 % 1.25~ & 1.0~~ & 1.25~ & 1.25~ &
4570 % .0~~ & \textminus.25~ & .0~~ & .125 \\
4571 % Charis \acronym{SIL}\detoxindex{font>typeface>Charis SIL=Charis \acronym{SIL}|userman} &
4572 % 1.0~~ & 1.0~~ & 1.0~~ & 1.125 &
4573 % .0~~ & \textminus.25~ & .0~~ & .125 \\
4574 % \acronym{CM} Roman\detoxindex{font>typeface>CM Roman=\acronym{CM} Roman|userman} &
4575 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4576 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4577 % Domitian\detoxindex{font>typeface>Domitian|userman} &
4578 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4579 % .0~~ & \textminus.25~ & \textminus.25~ & .0~~ \\
4580 % Cochineal\detoxindex{font>typeface>Cochineal|userman} &
4581 % .75~ & .75~ & .75~ & .75~ &
4582 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4583 % \acronym{EB} Garamond\detoxindex{font>typeface>EB Garamond=\acronym{EB} Garamond|userman} &
4584 % 1.0~~ & .75~ & .75~ & 1.0~~ &
4585 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4586 % etbb\etbbmark\detoxindex{font>typeface>etbb|userman} &
4587 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4588 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4589 % Extended Charter\xchartermark\detoxindex{font>typeface>Extended Charter|userman} &
4590 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4591 % .0~~ & \textminus.25~ & .0~~ & .0~~ \\
4592 % Gentium Plus\detoxindex{font>typeface>Gentium Plus|userman} &
4593 % .75~ & .5~~ & .75~ & .75~ &
4594 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & .0~~ \\
4595 % \acronym{GFS} Bodoni\detoxindex{font>typeface>GFS Bodoni=\acronym{GFS} Bodoni|userman} &
4596 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4597 % .0~~ & \textminus.25~ & \textminus.125 & .0~~ \\
4598 % \acronym{GFS} Didot\detoxindex{font>typeface>GFS Didot=\acronym{GFS} Didot|userman} &
4599 % 1.25~ & 1.0~~ & 1.25~ & 1.25~ &
4600 % .0~~ & .0~~ & .0~~ & .0~~ \\
4601 % \acronym{IBM} Plex Serif\detoxindex{font>typeface>IBM Plex Serif=\acronym{IBM} Plex Serif|userman} &
4602 % 1.125 & 1.0~~ & 1.125 & 1.25~ &
4603 % .25~ & .25~ & .25~ & .25~ \\
4604 % \acronym{KP} Serif\itcorr{8}\kpmark\detoxindex{font>typeface>KP Serif=\acronym{KP} Serif|userman} &
4605 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4606 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4607 % Libertinus Serif\detoxindex{font>typeface>Libertinus Serif|userman} &
4608 % .75~ & .5~~ & .75~ & .875 &
4609 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4610 % \acronym{ML} Modern\detoxindex{font>typeface>ML Modern=\acronym{ML} Modern|userman} &
4611 % 1.~~~ & .75~ & 1.0~~ & 1.0~~ &
4612 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4613 % Source Serif Pro\detoxindex{font>typeface>Source Serif Pro|userman} &
4614 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4615 % .0~~ & \textminus.25~ & .0~~ & .0~~ \\
4616 % Spectral\detoxindex{font>typeface>Spectral|userman} &
4617 % 1.0~~ & .75~ & .75~ & 1.0~~ &
4618 % .0~~ & \textminus.25~ & \textminus.25~ & .0~~ \\
4619 % \acronym{STIX}\detoxindex{font>typeface>STIX=\acronym{STIX}|userman} &
4620 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4621 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & .0~~ \\
4622 % \acronym{URW} Palladio\palladiomark\detoxindex{font>typeface>URW Palladio=\acronym{URW} Palladio|userman} &
4623 % 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
4624 % .0~~ & .0~~ & .0~~ & .0~~ \\
4625 % Utopia\itcorr{2}\utopiamark\detoxindex{font>typeface>Utopia|userman} &
4626 % .75~ & .5~~ & .75~ & .75~ &
4627 % \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
4628 % \bottomrule
4629 % \end{tabular}}
4630 % \end{tabfigures}
4631 %
4632 % \begin{tablenotes}
4633 % \renewcommand*{\tablenotemark}[1]{#1}%
4634 % \etbbmark\enspace
4635 % \propername{Edward Tufte}'s Bembo in package~\packagename{ETbb}. Note the two initial
4636 % capital letters in the filename.
4637 %
4638 % \xchartermark\enspace
4639 % Found in package \packagename{XCharter}. Again note the two initial capitals in the
4640 % filename.
4641 %
4642 % \kpmark\enspace
4643 % In package \packagename{kpfonts}.
4644 %
4645 % \palladiomark\enspace
4646 % Contained in package~\packagename{mathpazo}.
4647 %
4648 % \utopiamark\enspace
4649 % Utopia is available through package~\packagename{fourier} or
4650 % package~\packagename{mathdesign}. For the latter pass option~\code{adobe-utopia} to the
4651 % package.
4652 % \end{tablenotes}
4653 %
4654 % \begin{note}
4655 % Depending on the font packages loaded (and on their load order) the three
4656 % macros~\cs{text\-endash}, \cs{text\-asterisk\-centered}, \cs{text\-period\-centered} may
4657 % be redefined and thus expand to different glyphs which need different adjustment values
4658 % than the ones mentioned in \Cref{tab:labelitemadjustvalues}. To ensure a set of
4659 % correction values works use
4660 % macros~\hyperref[syn:typoguppercaseadjustcheck]{\cs{typog\-upper\-case\-adjust\-check}}
4661 % or \hyperref[syn:typoglowercaseadjustcheck]{\cs{typog\-lower\-case\-adjust\-check}}
4662 % inside of the target document.
4663 % \end{note}
4664 % \end{table}
4665 %
4666 %
4667 % \subsection[Align Last Line]
4668 % {Align Last Line of a Paragraph}\label{sec:align-last-line}
4669 % \index{paragraph>align last line|userman}
4670 %
4671 % The usual algorithms of \LaTeX{} typeset the last line of a paragraph flush with the left
4672 % margin unless |center|, |raggedleft| or |Centering|, |FlushRight|
4673 % (package~\packagename{ragged2e}~\cite{package:ragged2e}) are in effect. For an instructive
4674 % discussion consult Ch.~17, \doublequotes{Paragraph End}, of reference~\citenum{eijkhout:2007}.
4675 % The following environments adjust the last lines of paragraphs in different ways.
4676 %
4677 % \DescribeEnv{lastlineraggedleftpar}
4678 % \DescribeEnv{lastlineflushrightpar}
4679 % The environment \code{lastlineraggedleftpar}\index{paragraph>align last line>flush right|userman}
4680 % adjusts the various skips such that the last lines of the paragraphs gets typeset flush with
4681 % the right margin.
4682 %
4683 % \begin{synopsis}\label{syn:lastlineraggedleftpar}\label{syn:lastlineflushrightpar}
4684 % \cs{begin}|{lastlineraggedleftpar}| \\
4685 % \hspace*{1em}\ttdots \\
4686 % \cs{end}|{lastlineraggedleftpar}| \\[\smallskipamount]
4687 % |lastlineflushrightpar|~(alias)
4688 % \end{synopsis}
4689 %
4690 % The name |lastlineflushrightpar| is an alias for~\code{lastlineraggedleftpar}.
4691 %
4692 % \DescribeEnv{lastlinecenteredpar}
4693 % Center\index{paragraph>align last line>centered|userman} the last lines of the paragraphs
4694 % enclosed by this environment.\!\footnote{Also compare with the approach taken in
4695 % reference~\citenum{wermuth:2018}.}
4696 %
4697 % \begin{synopsis}\label{syn:lastlinecenteredpar}
4698 % \cs{begin}|{lastlinecenteredpar}| \ttdots{} \cs{end}|{lastlinecenteredpar}|
4699 % \end{synopsis}
4700 %
4701 % \begin{usecases}
4702 % |lastlineflushrightpar|: Narrow, justified parts of the text put flush against the right
4703 % margin.\visualpar |lastlinecenteredpar|: Table or figure captions typeset justified as
4704 % centered boxes.
4705 % \end{usecases}
4706 %
4707 %
4708 % \newpagetofixtoc
4709 % \toccontinuesonnextpage
4710 % \subsection[Fill Last Line]
4711 % {Fill Last Line of a Paragraph}\label{sec:fill-last-line}
4712 % \index{paragraph>fill last line|userman}
4713 %
4714 % The problem of when and how to \singlequotes{fill} the last line of a paragraph is quite
4715 % intricate. We first define the problem then we proceed to general purpose functions and we
4716 % close the section with specific environments to control the length of the last line.
4717 %
4718 %
4719 % \subsubsection{Problem Description}
4720 %
4721 % Depending on the value of \cs{parindent}, either zero or nonzero, there may be the need to
4722 % control the length of the last line of a paragraph.
4723 %
4724 % \iffalse
4725 %<*crookedparagraphs>
4726 prologues := 3;
4727
4728 def draw_filled_rectangle(expr lower_left, upper_right, color) =
4729 fill lower_left -- (xpart upper_right, ypart lower_left) --
4730 upper_right -- (xpart lower_left, ypart upper_right) --
4731 cycle
4732 withcolor color;
4733 enddef;
4734
4735
4736 u := 100;
4737
4738 em := 10;
4739 linelength := 2u;
4740 baselineskip := 1.2em;
4741 parskip := 3;
4742 parindent := 2.5em;
4743
4744 cmykcolor line_color;
4745 line_color := (.08, 0, 0, .18); % cold silver
4746
4747 color customred[];
4748 customred[1] := (.890, .282, .282);
4749 customred[2] := (.831, .110, .110);
4750 customred[3] := (.686, .043, .043);
4751 customred[4] := (.569, .000, .000);
4752 customred[5] := (.420, .000, .000);
4753
4754 color margin_color;
4755 margin_color := customred[2];
4756
4757
4758 beginfig(1); % short line -- gap
4759 y := 0;
4760 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4761 y := y - baselineskip;
4762 draw_filled_rectangle((0, y), (1.1em, y + 1em), line_color);
4763 y := y - baselineskip;
4764 draw_filled_rectangle((parindent, y), (linelength, y + 1em), line_color);
4765 y := y - baselineskip;
4766 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4767
4768 draw_filled_rectangle((-.667em, 1em), (-.333em, -3baselineskip), margin_color);
4769 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -3baselineskip), margin_color);
4770 endfig;
4771
4772
4773 beginfig(2); % short line -- covered
4774 y := 0;
4775 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4776 y := y - baselineskip;
4777 draw_filled_rectangle((0, y), (2parindent, y + 1em), line_color);
4778 y := y - baselineskip;
4779 draw_filled_rectangle((parindent, y), (linelength, y + 1em), line_color);
4780 y := y - baselineskip;
4781 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4782
4783 draw_filled_rectangle((-.667em, 1em), (-.333em, -3baselineskip), margin_color);
4784 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -3baselineskip), margin_color);
4785 endfig;
4786
4787
4788 beginfig(3); % completely filled line -- no clear paragraph break
4789 y := 0;
4790 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4791 y := y - baselineskip;
4792 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4793 y := y - baselineskip - parskip;
4794 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4795 y := y - baselineskip;
4796 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4797
4798 draw_filled_rectangle((-.667em, 1em), (-.333em, -3baselineskip - parskip), margin_color);
4799 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -3baselineskip - parskip),
4800 margin_color);
4801 endfig;
4802
4803
4804 beginfig(4); % completely filled line -- opened right margin
4805 y := 0;
4806 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4807 y := y - baselineskip;
4808 draw_filled_rectangle((0, y), (linelength - parindent, y + 1em), line_color);
4809 y := y - baselineskip - parskip;
4810 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4811 y := y - baselineskip;
4812 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color);
4813
4814 draw_filled_rectangle((-.667em, 1em), (-.333em, -3baselineskip - parskip), margin_color);
4815 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -3baselineskip - parskip),
4816 margin_color);
4817 endfig;
4818 end
4819 %</crookedparagraphs>
4820 % \fi
4821 %
4822 % \begin{enumerate}
4823 % \item\label{item:o1}
4824 % \(\cs{parindent} > 0\) \cite[O1]{wermuth:2018}
4825 %
4826 % \begin{minipage}{\linewidth}
4827 % If the last line of a paragraph is shorter than the \cs{parindent} of the following
4828 % paragraph a visual gap tears open.
4829 %
4830 % \begin{center}
4831 % \includegraphics{crooked-paragraphs-1.mps}
4832 % \end{center}
4833 % \end{minipage}
4834 %
4835 % A similar issue occurs with displayed math in a flush left\footnote{The common practice of
4836 % centering displayed equations does not call for the manipulations of a paragraph's last
4837 % line discussed here.} setting, e.\,g., \packagename{amsmath}~\cite{package:amsmath} and
4838 % option~|fleqn|.\!\footnote{For displayed equations and \packagename{amsmath} the relevant
4839 % parameter is~\cs{mathindent}.}
4840 %
4841 % \begin{minipage}{\linewidth}
4842 % A possible remedy is to reflow the paragraph in a way that its last line is clearly wider
4843 % than \cs{parindent}, a typical suggestion being twice the~\cs{parindent}.
4844 %
4845 % \begin{center}
4846 % \includegraphics{crooked-paragraphs-2.mps}
4847 % \end{center}
4848 % \end{minipage}
4849 %
4850 % \needspace{2\baselineskip}
4851 % \item\label{item:o2}
4852 % \(\cs{parindent} = 0\) \cite[O2]{wermuth:2018}
4853 %
4854 % \begin{minipage}{\linewidth}
4855 % If the last line of a paragraph is completely filled with text, i.\,e., flush with the
4856 % right margin, it may become hard to spot the start of the following paragraph unless
4857 % \cs{parskip} is large.\footnotemark
4858 %
4859 % \begin{center}
4860 % \includegraphics{crooked-paragraphs-3.mps}
4861 % \end{center}
4862 % \end{minipage}\footnotetext{Package~\packagename{parskip} defines \cs{parskip}
4863 % as \mbox{6\,pt plus 2\,pt} for a base size of~10\,pt.}
4864 %
4865 % \medskip
4866 %
4867 % \begin{minipage}{\linewidth}
4868 % A possible, more legible solution is to reformat the paragraph such that its last line
4869 % leaves a marked gap with respect to the right margin.
4870 %
4871 % \begin{center}
4872 % \includegraphics{crooked-paragraphs-4.mps}
4873 % \end{center}
4874 % \end{minipage}
4875 %
4876 % \medskip
4877 %
4878 % Recommended gap widths range from two ems to twice the typical \cs{parindent}\footnote{For
4879 % example, \LaTeX's class \packagename{article} uses a \cs{parindent}
4880 % of~25\,pt.} value~\cite{carlisle:1996}.
4881 % \end{enumerate}
4882 %
4883 % \begin{tip}
4884 % In theory both problems, O1 and O2 can be resolved by either shortening or prolonging the
4885 % last line of the paragraph. The user to decide which direction to go and to choose the
4886 % method that yields the most pleasing typographic results.
4887 %
4888 % \TeX{} evaluates paragraphs as a whole. Therefore, even changes intended for just the last
4889 % line may affect the entire paragraph and potentially degrade its appearance.
4890 %
4891 % Prudent users check the appearance of the problematic, original paragraph against one or
4892 % more corrected versions\spacedemdash at a minimum, visually. Quantitative comparisons can
4893 % be performed using \cs{tracingparagraphs}.
4894 % \end{tip}
4895 %
4896 % \begin{important}
4897 % For the techniques in the following two subsections to work the paragraphs treated with
4898 % them should have certain advantageous properties.
4899 %
4900 % \begin{itemize}
4901 % \item Technically, the paragraphs need to contain enough glue (see for example
4902 % \cref{sec:sloppy-paragraphs}) to achieve a low badness such that the desired paragraph
4903 % end is deemed feasible by \TeX.\shiftedmarginnote{This \code{itemize} list demonstrates
4904 % vertically adjusted label items (\cref{sec:adjust-label-items}).}
4905 %
4906 % \item Aesthetically, the paragraphs must be long enough to absorb the change in last-line
4907 % fill level otherwise their gray-values visibly deviate from the
4908 % average.\specialsectionendhere
4909 % \end{itemize}
4910 % \end{important}
4911 %
4912 %
4913 % \subsubsection{Manual Changes}\label{sec:fill-last-line-other-methods}
4914 %
4915 % Most \hyperref[item:o1]{O1} or \hyperref[item:o2]{O2} situations can be navigated with
4916 % do-it-yourself methods. Here are some common recipes.
4917 %
4918 % \begin{enumerate}
4919 % \item End-of-paragraph intervention.\label{enum:end-of-paragraph-intervention}
4920 %
4921 % \begin{enumerate}[notopsep]
4922 % \item Tie~\sample{\texttt{\char126}}\label{enum:tie-last-words}
4923 % \index{paragraph>fill last line>tie|userman}
4924 %
4925 % Tie the last words.
4926 %
4927 % The problem with the tie may be a hyphenation of one of the words that participates in
4928 % the tie. The next item avoids this disadvantage.
4929 %
4930 % \item \cs{mbox}\label{enum:mbox-last-words}
4931 % \index{paragraph>fill last line>mbox=\cs{mbox}|userman}
4932 %
4933 % Join the last words or inline equation at the end of the paragraph with an~\cs{mbox}.
4934 %
4935 % \item \cs{linebreak}\label{enum:linebreak}
4936 % \index{paragraph>fill last line>linebreak=\cs{linebreak}|userman}
4937 %
4938 % Add a \cs{linebreak} to the back part of the paragraph (approximately where the
4939 % \cs{mbox} of item~\ref{enum:mbox-last-words} would start) in a way that the last line
4940 % receives the desired length~\cite{wermuth:2022-8-2}. As a result, the penultimate
4941 % lines may become unsightly. Counteract this degradation e.\,g.~with
4942 % recipes~\ref{enum:vary-spacing} to~\ref{enum:vary-font-expansion}.
4943 % \end{enumerate}
4944 %
4945 % Tying and the use of \cs{mbox} can be generalized. They are useful not only at the end of
4946 % paragraphs but also effective for grouping logical units of sentences or inline equations,
4947 % ensuring the key information remains in the reader's focus. Of course, binding text
4948 % segments together must stop when overfull lines begin to appear.
4949 %
4950 % \item Uniform paragraph change.\label{enum:uniform-paragraph-change}
4951 %
4952 % \begin{enumerate}[notopsep]
4953 % \item Vary spacing.\label{enum:vary-spacing}
4954 % \index{font>spacing|userman}
4955 %
4956 % Modify the inter-word spacing, for example, with the macros introduced in
4957 % \cref{sec:looser-tighter-spacing}.
4958 %
4959 % Enclose the paragraph in either \hyperref[syn:loosespacing]{|loosespacing|}
4960 % or~\hyperref[syn:tightspacing]{|tightspacing|}.
4961 % Increase the spacing~\meta{level} until the last line gets the desired length.
4962 %
4963 % \item Vary font tracking.\label{enum:vary-font-tracking}
4964 % \index{font>tracking|userman}
4965 %
4966 % Enclose the paragraph in a \hyperref[syn:setfonttracking]{\code{setfonttracking}}~group.
4967 % See \cref{sec:tracking-control}. Increase or decrease the tracking in steps of
4968 % \nativetextfraction{1}{1000}\,em until the last line looks good.
4969 %
4970 % \item Vary font expansion.\label{enum:vary-font-expansion}
4971 % \index{font>expansion|userman}
4972 %
4973 % Enclose the paragraph in a \hyperref[syn:setfontexpand]{\code{setfontexpand}}~group. See
4974 % \cref{sec:font-expansion-control}.
4975 % \end{enumerate}
4976 %
4977 % \item A combination of any of the above items.
4978 %
4979 % \item Some curveballs.\label{enum:gonzo-tips}\par
4980 % \begin{enumerate}[notopsep]
4981 % \item If the paragraph already suffers from one of the problems that \TeX{} addresses with
4982 % \cs{doublehyphendemerits}, \cs{finalhyphendemerits}, or~\cs{adjdemerits}, crank up one or
4983 % all of these values to~10000 and observe whether the length of last line changes in the
4984 % desired direction.
4985 %
4986 % \item If any influential \packagename{microtype} features have been enabled try with one
4987 % more more of them \emph{disabled}. See, e.\,g.,
4988 % environment~\hyperref[syn:nofontexpansion]{\code{nofontexpansion}} in
4989 % \cref{sec:font-expansion-control}.
4990 % \end{enumerate}
4991 % \end{enumerate}
4992 %
4993 %
4994 % \subsubsection{Multi\capitalhyphen Purpose Environments}\label{sec:fill-last-line-gp-environments}
4995 %
4996 % \DescribeEnv{shortenpar}
4997 % \DescribeEnv{prolongpar}
4998 % The two environments
4999 % \code{shortenpar}\index{paragraph>fill last line>shortenpar=\code{shortenpar}|userman}
5000 % and \code{prolongpar}\index{paragraph>fill last line>prolongpar=\code{prolongpar}|userman}
5001 % can be employed in quite general situations when a
5002 % paragraph should be typeset one line longer or shorter, e.\,g., to avoid a
5003 % widow~line\footnote{The last line of a paragraph becomes a
5004 % \singlequotes{widow}\detoxindex{forlorn line>widow|userman} (ger.~\foreignphrase{Hurenkind}) if it
5005 % starts the following page or column.} or a club~line\footnote{The first line of a paragraph
5006 % is called \singlequotes{club}\detoxindex{forlorn line>club|userman}
5007 % or~\singlequotes{orphan}\detoxindex{forlorn line>orphan|userman}
5008 % (ger.~\foreignphrase{Schusterjunge}) if it appears at the bottom of the page or
5009 % column.}~[\citenum{knuth:1986}, p.~104 and~\citenum{mittelbach:2018c}]. (See also
5010 % \cref{sec:vtie-paragraph} for special functions to avoid clubs or widows.)
5011 % \singlequotes{Accidentally}, they also change the length of the last line of the paragraph.
5012 %
5013 % \begin{synopsis}\label{syn:shortenpar}
5014 % \cs{begin}|{shortenpar}|
5015 % \ttdots{}
5016 % \cs{end}|{shortenpar}|
5017 % \end{synopsis}
5018 %
5019 % Environment |shortenpar| decreases the \cs{looseness} of the
5020 % paragraph.\!\footnote{\cs{looseness} is a \TeX{}~primitive~\cite[p.~103n]{knuth:1986}. A
5021 % thorough discussion of the interaction of \cs{linepenalty} and \cs{looseness} can be found in
5022 % reference~\citenum{wermuth:2017c}.} This environment works well when the last line is short or
5023 % the paragraph overall is loosely set.
5024 %
5025 % \begin{synopsis}\label{syn:prolongpar}
5026 % \cs{begin}|{prolongpar}|
5027 % \ttdots{}
5028 % \cs{end}|{prolongpar}|
5029 % \end{synopsis}
5030 %
5031 % This environment increases the \cs{looseness} of the paragraph, which is why it works best
5032 % with decent or tight last lines that are nearly full.
5033 %
5034 %
5035 % \subsubsection{Specialized Environments}\label{sec:fill-last-line-specialized-environments}
5036 %
5037 % We introduce environments not just skips to get the correct behavior\leftspacedendash set up
5038 % all paragraph parameters \emph{before} the paragraph ends\rightspacedendash and, at the same
5039 % time, limit the range of this parameter change.
5040 %
5041 % \DescribeEnv{covernextindentpar}
5042 % Environment \code{covernextindentpar}%
5043 % \index{paragraph>fill last line>covernextindentpar=\code{covernextindentpar}|userman}
5044 % can be helpful for \hyperref[item:o1]{case~O1}, i.\,e., a too short last line.
5045 %
5046 % \begin{synopsis}\label{syn:covernextindentpar}
5047 % \cs{begin}|{covernextindentpar}|\oarg{dim} \\
5048 % \hspace*{1em}\ttdots \\
5049 % \cs{end}|{covernextindentpar}|
5050 % \end{synopsis}
5051 %
5052 % The environment forces \TeX{} to extend the last line of a paragraph such that it takes at
5053 % least
5054 % \makeatletter\dumpmacro{\typog@covernextindentpar@nonzero@parindent}\makeatother{}
5055 % (if \(\cs{parindent} \not= 0\)),
5056 % \makeatletter\typog@covernextindentpar@zero@parindent\makeatother{}
5057 % (if \(\cs{parindent} = 0\)), or \meta{dim} if called with an optional argument.
5058 %
5059 % \DescribeEnv{openlastlinepar}
5060 % The next environment, \code{openlastlinepar},%
5061 % \index{paragraph>fill last line>openlastlinepar=\code{openlastlinepar}|userman}
5062 % takes care of \hyperref[item:o2]{case~O2}, i.\,e., a last line in a paragraph that is almost
5063 % full or completely filled.
5064 %
5065 % \begin{synopsis}\label{syn:openlastlinepar}
5066 % \cs{begin}|{openlastlinepar}|\oarg{dim} \ttdots{} \cs{end}|{openlastlinepar}|
5067 % \end{synopsis}
5068 %
5069 % It may resolve \hyperref[item:o2]{case~O2} as it attempts to prevent a completely filled line
5070 % by introducing a partly unshrinkable \cs{parfillskip}. Without optional argument the
5071 % threshold of unused last-line length is either
5072 % \makeatletter\dumpmacro{\typog@openlastlinepar@nonzero@parindent}\makeatother{} (if
5073 % \(\cs{parindent} \not= 0\)) or
5074 % \makeatletter\typog@openlastlinepar@zero@parindent\makeatother{} (if \(\cs{parindent} = 0\)).
5075 % The optional argument~\meta{dim} directly sets the gap threshold.
5076 %
5077 % Note that using this environment can succeed in avoiding a fully filled last line; however,
5078 % the result might still fall into case \hyperref[item:o1]{type~O1}.
5079 %
5080 %
5081 % \newpagetofixtoc
5082 % \subsubsection{Consistent Spacing of Last Line}\label{sec:consistent-spacing-of-last-line}
5083 %
5084 % \index{lastlinefit=\verb!*+\lastlinefit+|userman}
5085 % Since \eTeX{} the paragraph-breaking algorithm can be instructed to match the spacing of the
5086 % last line of a paragraph to the next-to-last line with the
5087 % built-in~\cs{lastlinefit}~\cite[Sec.~3.8]{package:etex}.\!\footnote{The actual algorithm is
5088 % somewhat involved. So, for ease of reference, we have included the relevant part of the
5089 % \eTeX-manual as \Cref{app:epsilon-tex-lastlinefit} starting on
5090 % \cpageref{app:epsilon-tex-lastlinefit}.} Package~\packagename{typog} wraps this control in
5091 % an environment to limit the scope as its effects are not always beneficial to the appearance
5092 % of the body.
5093 %
5094 % \DescribeEnv{lastlinefitpar}
5095 % \sinceversion{Since v0.5}
5096 % Typeset a single paragraph with \cs{lastlinefit} set to a given value.
5097 %
5098 % \begin{synopsis}\label{syn:lastlinefitpar}
5099 % \cs{begin}|{lastlinefitpar}|\oarg{value} \ttdots{} \cs{end}|{lastlinefitpar}|
5100 % \end{synopsis}
5101 %
5102 % The parameter range of \meta{value} is zero to thousand. It controls the fraction of
5103 % thousandths of the next-to-last-line's spacing to be used in the last line. This means that
5104 % \(\meta{value} = 0\) requests no transfer (as if \code{lastlinefit} is not used at all) and
5105 % \(\meta{value} = 1000\) initiates exact transfer of the spacing. The default \meta{value}
5106 % is~1000.
5107 %
5108 % Note that different \meta{value}s can lead to different breakpoints in the affected
5109 % paragraph. \eTeX{} still considers the \emph{whole} paragraph when calculating the optimal
5110 % line breaks.
5111 %
5112 % \begin{usecases}
5113 % Adapt the spacing of the last line of a paragraph to a very loose or very tight
5114 % next-to-last line or to a whole paragraph that is very loose or very tight.
5115 % \end{usecases}
5116 %
5117 %
5118 % \needtocspace
5119 % \subsection{Spacing}\label{sec:spacing-control}
5120 % \index{font>spacing|userman}
5121 %
5122 % \begin{whittyquote}
5123 % 90\% of design is typography. \\
5124 % And the other 90\% is whitespace. \\
5125 % \capitalemdash*~\propername{Jeffrey Zeldman}
5126 % \end{whittyquote}
5127 %
5128 % \noindent
5129 % The functions described in this section rely only on plain \LaTeX. No extra packages are
5130 % required. Compare to the \packagename{microtype}-based functionality of
5131 % \cref{sec:microtype-frontend}.
5132 %
5133 %
5134 % \subsubsection[Looser\kernedslash Tighter]{Looser or Tighter Spacing}\label{sec:looser-tighter-spacing}
5135 % \index{font>spacing>loose|userman}
5136 % \index{font>spacing>tight|userman}
5137 %
5138 % \begin{whittyquote}
5139 % Never try to adjust lines by squeezing or stretching the tracking. \\
5140 % Go for the subtle solution: adjust word spacing instead. \\
5141 % \capitalemdash*~\propername{Jan Middendorp}~\cite[p.~119]{middendorp:2014}
5142 % \end{whittyquote}
5143 %
5144 % \noindent
5145 % The environments in this section directly influence the spacing, this is, they change the
5146 % width and stretchability of the horizontal space.
5147 %
5148 % On the one hand, they act gently by adjusting the spacing only by a small amount. On the
5149 % other hand, they operate decidedly in controlling the glue associated with the adjusted
5150 % space. The latter is also important to ensure the monotonicity of the different
5151 % \meta{level}s. However, the strictly managed stretchability\slash shrinkability may lead to
5152 % many overfull boxes with \cs{fussy}, or when applied to short lines.
5153 %
5154 % \DescribeEnv{loosespacing}
5155 % \DescribeEnv{tightspacing}
5156 % Environments |loosespacing| and |tightspacing| introduce four \meta{level}s of
5157 % \singlequotes{looseness} or \singlequotes{tightness}, where \meta{level}~=~0 disables the
5158 % functionalities. The higher the \meta{level} the looser or tighter the text will by typeset.
5159 %
5160 % \begin{synopsis}\label{syn:loosespacing}
5161 % \cs{begin}|{loosespacing}|\oarg{level}
5162 % \ttdots{}
5163 % \cs{end}|{loosespacing}|
5164 % \end{synopsis}
5165 %
5166 % Environment~|loosespacing| increases the width of a space by the percentages given in
5167 % \cref{tab:loosespacing}.
5168 %
5169 % \begin{SCtable}[10]
5170 % \caption[Spacing changes made by \code{loosespacing}]%
5171 % {Adjustments made by environment \code{loosespacing} to \cs{spaceskip}.
5172 % The mapping of \meta{level} to the exact skip definitions are
5173 % \(1 \mapsto \formatskip{1.05}{.5}{.1}\),
5174 % \(2 \mapsto \formatskip{1.1}{.5}{.1}\),
5175 % \(3 \mapsto \formatskip{1.2}{.6}{.2}\), and
5176 % \(\ge 4 \mapsto \formatskip{1.3}{.8}{.3}\),
5177 % where all factors scale with \cs{dimen2},
5178 % the current font's space-width.}
5179 % \label{tab:loosespacing}
5180 %
5181 % \begin{tabfigures}
5182 % \def~{\hphantom{0}}%
5183 % \begin{tabular}{@{}ccl@{}}
5184 % \toprule
5185 % \meta{level} & Adjustment & Note \\
5186 % {} & \% & \\
5187 % \midrule
5188 % 0 & n/a & neutral \\
5189 % 1 & +5~ & default \\
5190 % 2 & +10 & \\
5191 % 3 & +20 & \\
5192 % \(\ge\)\:4 & +30 & \\
5193 % \bottomrule
5194 % \end{tabular}
5195 % \end{tabfigures}
5196 % \end{SCtable}
5197 %
5198 % The default level of |loosespacing| is~1.
5199 %
5200 % \begin{synopsis}\label{syn:tightspacing}
5201 % \cs{begin}|{tightspacing}|\oarg{level}
5202 % \ttdots{}
5203 % \cs{end}|{tightspacing}|
5204 % \end{synopsis}
5205 %
5206 % Environment~|tightspacing| decreases the width of a space by the percentages given in
5207 % \cref{tab:tightspacing}.
5208 %
5209 % \begin{SCtable}[10]
5210 % \def~{\hphantom{0}}
5211 % \caption[Spacing changes made by \code{tightspacing}]%
5212 % {Adjustments made by environment \code{tightspacing} to \cs{spaceskip}.
5213 % The mapping of \meta{level} to the exact skip definitions are
5214 % \(1 \mapsto \formatskip{.9875}{.0125}{.5~~~}\)\!,
5215 % \(2 \mapsto \formatskip{.975}{.025}{.5~~}\)\!,
5216 % \(3 \mapsto \formatskip{.95}{.05}{.5~}\)\!, and
5217 % \(\ge 4 \mapsto \formatskip{.9}{.1}{.5}\),
5218 % where all factors scale with \cs{dimen2},
5219 % the current font's space-width.}
5220 % \label{tab:tightspacing}
5221 %
5222 % \begin{tabfigures}
5223 % \begin{tabular}{@{}ccl@{}}
5224 % \toprule
5225 % \meta{level} & Adjustment & Note \\
5226 % {} & \% & \\
5227 % \midrule
5228 % 0 & n/a & neutral \\
5229 % 1 & ~\textminus 1.25 & default \\
5230 % 2 & ~\textminus 2.5~ & \\
5231 % 3 & ~\textminus 5\hphantom{.}~~ & \\
5232 % \(\ge\)\:4 & \textminus 10\hphantom{.}~~ & \\
5233 % \bottomrule
5234 % \end{tabular}
5235 % \end{tabfigures}
5236 % \end{SCtable}
5237 %
5238 % The default level of |tightspacing| is~1.
5239 %
5240 % \begin{note}
5241 % At a given \meta{level} the changes of |loosespacing| are much larger than those of
5242 % |tightspacing|.
5243 % \end{note}
5244 %
5245 % \begin{usecases}
5246 % Tighten spacing in narrow lines as, for example, in multi-column environments.\visualpar
5247 % Nudge line breaks or hyphenation points.\visualpar Separate clashing descenders and
5248 % ascenders.\visualpar Eliminate rivers.
5249 % \end{usecases}
5250 %
5251 %
5252 % \newpagetofixtoc
5253 % \subsubsection{Wide Space}\label{sec:wide-space}
5254 % \index{wide space|userman}
5255 %
5256 % The \cs{widespace} macro and its companion \cs{narrowspace} derive their appearances from
5257 % several of the current font's \cs{fontdimen}\meta{number}s. \TeX{} addresses the latter by
5258 % integers, which is totally non-memnonic. Therefore, we play softball by first presenting
5259 % \cref{tab:fontdimen} that associates the \cs{fontdimen}\meta{number}s with their meanings and
5260 % also reports on their current values (for this document).\!\footnote{The association is given
5261 % in Appendix~F (p.~433) of reference~\citenum{knuth:1986}. For a concise and understandable
5262 % explanation of the \TeX~\cs{fontdimen} parameters consult reference~\citenum{carlisle:2013}.}
5263 %
5264 % \begin{SCtable}
5265 % \caption[\cs{fontdimen}\meta{number} parameters]
5266 % {All \TeX{} font parameters normalized to the font's quad-size. The first
5267 % column~\sample{\#} states the index of the \cs{fontdimen} parameter:
5268 % \meta{number}. Column~2 presents short descriptions of
5269 % \cs{fontdimen}\meta{number}. As examples, the values for the current font are
5270 % shown in column~3 as percentages.\bottomstrut}
5271 % \label{tab:fontdimen}
5272 %
5273 % \begin{tabfigures}
5274 % \def~{\hphantom{0}}%
5275 % \ExplSyntaxOn
5276 % \def\straightfontdimen#1{\fp_eval:n {\the\fontdimen#1\font}}
5277 % \def\roundfontdimen#1{\fp_eval:n {round (1000 * \the\fontdimen#1\font) / 1000}}
5278 % \def\relativefontdimen#1{\fp_eval:n {round (1000 * \the\fontdimen#1\font / \the\fontdimen6\font) / 10}}
5279 % \ExplSyntaxOff
5280 %
5281 % \begin{tabular}{@{}lll@{}}
5282 % \toprule
5283 % \# & Description & Value \\
5284 % \midrule
5285 % 1 & Slant per 1\,pt height & ~~\relativefontdimen1\topstrut \\
5286 % 2 & Interword space width & ~\relativefontdimen2 \\
5287 % 3 & Interword stretch & ~\relativefontdimen3 \\
5288 % 4 & Interword shrink & ~~\relativefontdimen4 \\
5289 % 5 & \sample{\itcorr{2}x\itcorr{2}} height & ~\relativefontdimen5 \\
5290 % 6 & \cs{quad} height & \relativefontdimen6 \\
5291 % 7 & Extra space width & ~~\relativefontdimen7 \\
5292 % \bottomrule
5293 % \end{tabular}
5294 % \end{tabfigures}
5295 % \end{SCtable}
5296 %
5297 % \DescribeMacro{\widespace}
5298 % \DescribeMacro{\widespace*}
5299 % \sinceversion{Starred form since v0.2}
5300 % Typeset a wide, sentence-ending space as if in \cs{nonfrenchspacing}~mode. Consult
5301 % \Cref{tab:space-sizes} for a comparison of the various sizes.
5302 %
5303 % \begin{synopsis}\label{syn:widespace}
5304 % \cs{widespace}\qquad \cs{widespace*}
5305 % \end{synopsis}
5306 %
5307 % \index{widespacestrength=\verb!*+\widespacestrength+|userman}
5308 % The unstarred macro~\cs{widespace} inserts a space that is as wide as the font's
5309 % sentence-ending space in \cs{nonfrenchspacing}~mode, this is
5310 % \begin{equation*}
5311 % |\fontdimen2| + \cs{widespacestrength} \times |\fontdimen7|.
5312 % \end{equation*}
5313 %
5314 % \noindent
5315 % Its width is independent of any \cs{frenchspacing} or \cs{nonfrenchspacing}~settings, but
5316 % depends on \cs{widespacestrength} which defaults
5317 % to~\widespacestrength\widespace\marginnote{The sentence that ends with
5318 % \singlequotes{\widespacestrength} uses \cs{widespace} after the period.} The latter can be
5319 % overridden by the user to get a more or less pronounced effect.
5320 %
5321 % \index{widespacescale=\verb!*+\widespacescale+|userman}
5322 % If |\fontdimen7| happens to be zero \cs{widespace} uses
5323 % \begin{equation*}
5324 % \cs{widespacescale} \times |\fontdimen2|
5325 % \end{equation*}
5326 %
5327 % \noindent
5328 % as width instead, where \cs{widespacescale} defaults to \widespacescale. The stretchability
5329 % and shrinkability of \cs{widespace} always are scaled with \cs{widespacescale}. The
5330 % \cs{widespacescale} too can be redefined by the user to achieve different effects.
5331 %
5332 % The starred form, \cs{widespace*}, unconditionally uses the \(|\fontdimen7| = 0\) code-path.
5333 %
5334 % \begin{usecase}
5335 % Useful as a sentence-ending space if, for example, the sentence ends in an abbreviation
5336 % with a period or decimal number without trailing digits \emph{and} the next sentence should
5337 % be delimited in a clearer way.\visualpar Open tight lines with a series
5338 % of~\cs{widespace}s.\!\footnote{\label{fn:widespace}See also \doublequotes{Investigating the
5339 % badness of a paragraph} on \Cpageref{sec:investigating-paragraph-badness}.}
5340 % \end{usecase}
5341 %
5342 %
5343 % \subsubsection{Narrow Space}\label{sec:narrow-space}
5344 % \index{narrow space|userman}
5345 %
5346 % \DescribeMacro{\narrowspace}
5347 % \DescribeMacro{\narrowspace*}
5348 % \sinceversion{Since v0.2}
5349 % Typeset a narrow space. Consult \Cref{tab:space-sizes} for a comparison of the various
5350 % sizes.
5351 %
5352 % \begin{synopsis}\label{syn:narrowspace}
5353 % \cs{narrowspace}\qquad \cs{narrowspace*}
5354 % \end{synopsis}
5355 %
5356 % \index{narrowspacestrength=\verb!*+\narrowspacestrength+|userman}
5357 % The unstarred macro~\cs{narrowspace} inserts a narrow space with the width
5358 % \begin{equation*}
5359 % |\fontdimen2| - \cs{narrowspacestrength} \times |\fontdimen7|
5360 % \end{equation*}
5361 %
5362 % \index{narrowspacescale=\verb!*+\narrowspacescale+|userman}
5363 % \noindent
5364 % if |\fontdimen7| is different from zero or otherwise
5365 % \begin{equation*}
5366 % \cs{narrowspacescale} \times |\fontdimen2|.
5367 % \end{equation*}
5368 %
5369 % \noindent
5370 % The starred version, \cs{narrowspace*}, unconditionally uses the \(\cs{fontdimen7} = 0\)
5371 % code-path. Refer to \Cref{tab:fontdimen} for the meanings of the various
5372 % \cs{fontdimen}~parameters.
5373 %
5374 % The stretchability and shrinkability of \cs{narrowspace} always get scaled with
5375 % \cs{narrowspacescale}. Both factors, \cs{narrowspacestrength} and \cs{narrowspacescale} can
5376 % be redefined by the user; their defaults are \narrowspacestrength{} and \narrowspacescale.
5377 %
5378 % \begin{usecases}
5379 % Tighten loose lines with a series of~\cs{narrowspace}s.\!\footnote{Footnote
5380 % \ref{fn:widespace} again applies.}\visualpar Compensate the visual gap that may occur when
5381 % switching from upright shape to italic shape.
5382 % \end{usecases}
5383 %
5384 % \begin{table}
5385 % \centering
5386 % \caption[Comparison of some space sizes]
5387 % {Exemplary comparison of standard \cs{space} versus \cs{narrowspace} and
5388 % \cs{widespace}. All values are relative to the size of the current font's
5389 % quad-size and shown as a percentage of it. \cs{narrowspace} and \cs{widespace}
5390 % use the package's defaults.\visualpar The upper values in the
5391 % \singlequotes{Width}~column for \cs{narrowspace} and \cs{widespace} refer to the
5392 % \(\cs{fontdimen7} \not= 0\) case and the lower ones to the \(\cs{fontdimen7} = 0\)
5393 % code-path.}
5394 % \label{tab:space-sizes}
5395 %
5396 % \begin{tabfigures}
5397 % \def~{\hphantom{0}}
5398 % \ExplSyntaxOn
5399 % \def\relativedimen#1{\fp_eval:n {round (1000 * (#1) / \the\fontdimen6\font) / 10}}
5400 % \def\relativefontdimen#1{\relativedimen{\the\fontdimen#1\font}}
5401 % \ExplSyntaxOff
5402 % \def\nrows{1.75}
5403 %
5404 % \begin{tabular}{@{}l*{3}{r}@{}}
5405 % \toprule
5406 % Macro & Width & Stretch & Shrink \\
5407 % \midrule
5408 % \multirow{\nrows}{*}{\cs{narrowspace}} &
5409 % \relativedimen{\the\fontdimen2\font - \narrowspacestrength * \the\fontdimen7\font} &
5410 % \multirow{\nrows}{*}{\relativedimen{\narrowspacescale * \the\fontdimen3\font}} &
5411 % \multirow{\nrows}{*}{\relativedimen{\narrowspacescale * \the\fontdimen4\font}} \\[-.25\normalbaselineskip]
5412 % {} & \relativedimen{\narrowspacescale * \the\fontdimen2\font} & & \\
5413 % \cs{space} & \relativefontdimen2 & \relativefontdimen3 & \relativefontdimen4 \\
5414 % \multirow{\nrows}{*}{\cs{widespace}} &
5415 % \relativedimen{\the\fontdimen2\font + \widespacestrength * \the\fontdimen7\font} &
5416 % \multirow{\nrows}{*}{\relativedimen{\widespacescale * \the\fontdimen3\font}} &
5417 % \multirow{\nrows}{*}{\relativedimen{\widespacescale * \the\fontdimen4\font}} \\[-.25\normalbaselineskip]
5418 % {} & \relativedimen{\widespacescale * \the\fontdimen2\font} & & \\
5419 % \bottomrule
5420 % \end{tabular}
5421 % \end{tabfigures}
5422 % \end{table}
5423 %
5424 %
5425 % \subsection{\packagename{Microtype} Front\capitalhyphen End}\label{sec:microtype-frontend}
5426 % \index{microtype=\packagename{microtype} (package)|userman}
5427 %
5428 % \marginnote{The manual uses \hyperref[syn:spacedemdash]{\cs{spacedemdash}} for the em-dash.}
5429 % The functionalities are just front ends of selected macros in
5430 % package~\packagename{microtype}\spacedemdash welcome syntactic sugar.
5431 %
5432 % \begin{important}
5433 % All macros and environments introduced in this section require that
5434 % package~\packagename{microtype}~\cite{package:microtype} has been loaded, preferably
5435 % \emph{before} package~\packagename{typog}
5436 %
5437 % \begin{codeexample}
5438 % \cs{usepackage}[\meta{microtype-options}\ttdots]\{microtype\} \\
5439 % \cs{usepackage}[\meta{typog-options}\ttdots]\{typog\}
5440 % \end{codeexample}
5441 %
5442 % \noindent
5443 % in the document preamble.
5444 % \end{important}
5445 %
5446 %
5447 % \subsubsection{Tracking}\label{sec:tracking-control}
5448 % \index{font>tracking|userman}
5449 %
5450 % \begin{caution}
5451 % The tracking changes may interfere with implicit changes of tracking declared with
5452 % \cs{SetTracking}. Explicit calls to \cs{textls} remain in effect.
5453 % \end{caution}
5454 %
5455 % \noindent
5456 % \DescribeEnv{setfonttracking}
5457 % Override the default tracking for all fonts.
5458 %
5459 % \begin{synopsis}\label{syn:setfonttracking}
5460 % \cs{begin}|{setfonttracking}|\marg{delta} \ttdots{} \cs{end}|{setfonttracking}|
5461 % \end{synopsis}
5462 %
5463 % The environment~|setfonttracking| manages a group for \cs{lsstyle} of
5464 % package~\packagename{microtype}. The change \meta{delta} in tracking is given as multiples
5465 % of \nativetextfraction{1}{1000}\,em. Positive as well as negative values of \meta{delta} are
5466 % allowed.
5467 %
5468 % See Sec.~5.3, \singlequotes{Tracking}, and~7, \doublequotes{Letterspacing revisited}, in the
5469 % documentation of \packagename{microtype}~\cite{package:microtype} for a detailed explanation.
5470 %
5471 % For font combinations involving monospaced fonts (\TeX{} lingo: typewriter) an overly large
5472 % spacing may show up at the borders where fonts change. This is caused by the calculation of
5473 % the \doublequotes{outer spacing} described in Sec.~5.3 of the \packagename{microtype}~manual.
5474 %
5475 % \indexpackageoption{trackingttspacing}
5476 % Use configuration variable~\hyperref[item:trackingttspacing]{\code{trackingttspacing}} to
5477 % reduce the outer spacing to a reasonable value either directly at package-load time
5478 %
5479 % \begin{codeexample}
5480 % \cs{usepackage}[trackingttspacing=\{250, 75, 50\}]\{typog\}
5481 % \end{codeexample}
5482 %
5483 % \noindent
5484 % or using \cs{typogsetup} in the document \emph{preamble} (after loading
5485 % \packagename{microtype} and \packagename{typog})
5486 %
5487 % \begin{codeexample}
5488 % \cs{typogsetup}\{trackingttspacing=\{250, 75, 50\}\}
5489 % \end{codeexample}
5490 %
5491 % If the argument of option~\code{trackingttspacing} is omitted the outer spacing defaults to
5492 % \makeatletter\mbox{\typog@config@trackingttspacing}\makeatother.
5493 %
5494 % \begin{usecases}
5495 % Nudge line breaks or hyphenation points.\visualpar Avoid clashes of descenders and
5496 % ascenders, e.\,g., for \cs{smash}ed symbols of inline math.\spacedemdash Think of
5497 % integrals.\visualpar Control the length of the last line in a paragraph.
5498 % \end{usecases}
5499 %
5500 %
5501 % \subsubsection{Font Expansion}\label{sec:font-expansion-control}
5502 % \index{font>expansion|userman}
5503 %
5504 % \DescribeEnv{setfontshrink}
5505 % \DescribeEnv{setfontstretch}
5506 % Adjust the limits of either only stretchability or only shrinkability and zero the other
5507 % component, i.\,e., shrinkability and stretchability.
5508 %
5509 % \begin{synopsis}\label{syn:setfontshrink}\label{syn:setfontstretch}
5510 % \cs{begin}|{setfontshrink}|\oarg{level}
5511 % \ttdots{}
5512 % \cs{end}|{setfontshrink}| \\
5513 % \cs{begin}|{setfontstretch}|\oarg{level}
5514 % \ttdots{}
5515 % \cs{end}|{setfontstretch}|
5516 % \end{synopsis}
5517 %
5518 % A \meta{level} of zero is a no-op. \Cref{tab:setfontshrink-values,tab:setfontstretch-values}
5519 % summarize the values for |stretch| and |shrink| in these environments.
5520 %
5521 % \begin{SCtable}
5522 % \caption[Shrink values of \code{setfontshrink}]
5523 % {\slightlysloppy[2] Preconfigured values for |shrink| inside of
5524 % environment~\code{setfontshrink} as \nativetextfraction{1}{1000}\,em. Note that all
5525 % |stretch| values are zero, so the fonts only can shrink.}
5526 % \label{tab:setfontshrink-values}
5527 %
5528 % \begin{tabfigures}
5529 % \def~{\hphantom{0}}
5530 % \begin{tabular}{@{}cccl@{}}
5531 % \toprule
5532 % \meta{level} & |stretch| & |shrink| & Note \\
5533 % \midrule
5534 % 0 & n/a & n/a & no operation \\
5535 % 1 & 0 & ~\makeatletter\typog@shrink@i\makeatother & default \\
5536 % 2 & 0 & \makeatletter\typog@shrink@ii\makeatother & \\
5537 % 3 & 0 & \makeatletter\typog@shrink@iii\makeatother & \\
5538 % \bottomrule
5539 % \end{tabular}
5540 % \end{tabfigures}
5541 % \end{SCtable}
5542 %
5543 % \begin{SCtable}
5544 % \centering
5545 % \caption[Stretch values of \code{setfontstretch}]
5546 % {\slightlysloppy[2] Preconfigured values for |stretch| inside of
5547 % environment~\code{setfontstretch} as \nativetextfraction{1}{1000}\,em. Note that all
5548 % |shrink| values are zero, so the fonts only can stretch.}
5549 % \label{tab:setfontstretch-values}
5550 %
5551 % \begin{tabfigures}
5552 % \def~{\hphantom{0}}
5553 % \begin{tabular}{@{}cccl@{}}
5554 % \toprule
5555 % \meta{level} & |stretch| & |shrink| \\
5556 % \midrule
5557 % 0 & n/a & n/a & no operation \\
5558 % 1 & ~\makeatletter\typog@stretch@i\makeatother & 0 & default \\
5559 % 2 & \makeatletter\typog@stretch@ii\makeatother & 0 & \\
5560 % 3 & \makeatletter\typog@stretch@iii\makeatother & 0 & \\
5561 % \bottomrule
5562 % \end{tabular}
5563 % \end{tabfigures}
5564 % \end{SCtable}
5565 %
5566 % \indexpackageoption{shrinklimits}
5567 % \indexpackageoption{stretchlimits}
5568 % The three (nonzero) shrink limits of \code{setfontshrink} can be configured with package
5569 % option~\hyperref[item:shrinklimits]{\code{shrinklimits}} and\leftspacedendash in the same
5570 % way\rightspacedendash the three (nonzero) stretch limits of \code{setfontstretch} with
5571 % package option~\hyperref[item:stretchlimits]{\code{stretchlimits}}.
5572 %
5573 % \begin{usecases}
5574 % Nudge line breaks or hyphenation points.\visualpar Control the length of the last line in
5575 % a paragraph.
5576 % \end{usecases}
5577 %
5578 % \noindent
5579 % \DescribeEnv{setfontexpand}
5580 % Manipulate both, |stretch| and |shrink|~values at the same time.
5581 %
5582 % \begin{synopsis}\label{syn:setfontexpand}
5583 % \cs{begin}|{setfontexpand}|\oarg{level}
5584 % \ttdots{}
5585 % \cs{end}|{setfontexpand}|
5586 % \end{synopsis}
5587 %
5588 % \Cref{tab:setfontexpand-values} gives an overview of the values associated with \meta{level}.
5589 %
5590 % \begin{SCtable}
5591 % \caption[Shrink and stretch values of \code{setfontexpand}]
5592 % {\slightlysloppy[2] Preconfigured values for |shrink| and |stretch| inside of
5593 % environment~\code{setfontexpand} as \nativetextfraction{1}{1000}\,em. Note that both
5594 % |shrink| and |stretch| values are nonzero, so the fonts can shrink or expand.}
5595 % \label{tab:setfontexpand-values}
5596 %
5597 % \begin{tabfigures}
5598 % \def~{\hphantom{0}}
5599 % \begin{tabular}{@{}cccl@{}}
5600 % \toprule
5601 % \meta{level} & |stretch| & |shrink| & Note \\
5602 % \midrule
5603 % 0 & n/a & n/a & no operation \\
5604 % 1 & ~\makeatletter\typog@stretch@i\makeatother & ~\makeatletter\typog@stretch@i\makeatother & default \\
5605 % 2 & \makeatletter\typog@stretch@ii\makeatother & \makeatletter\typog@stretch@ii\makeatother & \\
5606 % 3 & \makeatletter\typog@stretch@iii\makeatother & \makeatletter\typog@stretch@iii\makeatother & \\
5607 % \bottomrule
5608 % \end{tabular}
5609 % \end{tabfigures}
5610 % \end{SCtable}
5611 %
5612 % The six shrink and stretch limits of \code{setfontexpand} can be configured with package
5613 % options~\hyperref[item:shrinklimits]{\code{shrinklimits}}
5614 % and~\hyperref[item:stretchlimits]{\code{stretchlimits}}.
5615 %
5616 % \begin{notes}
5617 % \begin{itemize}[notopsep]
5618 % \item Environment~|setfontexpand| shares its
5619 % \hyperref[item:shrinklimits]{\code{shrinklimits}} with \code{setfontshrink} and its
5620 % \hyperref[item:stretchlimits]{\code{stretchlimits}} with \code{setfontstretch}.
5621 %
5622 % \item These environments do not nail down any font's expansion but only set up its
5623 % available range. See Sec.~3.3, \doublequotes{Font Expansion}, in the
5624 % \packagename{microtype} documentation~\cite{package:microtype}.
5625 %
5626 % Moreover, a text may not \singlequotes{respond} neither to \code{setfontshrink},
5627 % \code{setfontstretch}, nor~\code{setfontexpand} because \TeX{} already considers it
5628 % optimal without expansion or within the previous expansion limits, e.\,g., those set at
5629 % \packagename{microtype} load~time as opposed to \packagename{typog}'s
5630 % load~time.\specialsectionendhere
5631 % \end{itemize}
5632 % \end{notes}\unskip
5633 %
5634 % \begin{usecases}
5635 % Nudge line breaks or hyphenation points.\visualpar Control the length of a paragraph,
5636 % e.\,g., to avoid a widow.
5637 % \end{usecases}
5638 %
5639 % \noindent
5640 % \DescribeEnv{nofontexpansion}
5641 % \DescribeEnv{nofontexpand}
5642 % Disable the \packagename{microtype} feature~\singlequotes{expansion} inside of the
5643 % environment.
5644 %
5645 % \begin{synopsis}\label{syn:nofontexpansion}\label{syn:nofontexpand}
5646 % \cs{begin}|{nofontexpansion}|
5647 % \ttdots{}
5648 % \cs{end}|{nofontexpansion}| \\[\smallskipamount]
5649 % |nofontexpand|~(alias)
5650 % \end{synopsis}
5651 %
5652 % The name |nofontexpand| is an alias for~|nofontexpansion|.
5653 %
5654 % \begin{usecases}
5655 % Nudge line breaks or hyphenation points.\visualpar Prevent severe scaling effects in
5656 % paragraphs strongly manipulated by other means, e.\,g.,
5657 % \hyperref[syn:shortenpar]{\code{shortenpar}}
5658 % or~\hyperref[syn:prolongpar]{\code{prolongpar}}.
5659 % \end{usecases}
5660 %
5661 %
5662 % \subsubsection{Character Protrusion}\label{sec:protrusion}
5663 % \index{font>protrusion|userman}
5664 %
5665 % \DescribeEnv{nocharprotrusion}
5666 % Disable the \packagename{microtype} feature~\singlequotes{protrusion} inside of the
5667 % environment.
5668 %
5669 % \begin{synopsis}\label{syn:nocharprotrusion}
5670 % \cs{begin}|{nocharprotrusion}|
5671 % \ttdots{}
5672 % \cs{end}|{nocharprotrusion}|
5673 % \end{synopsis}
5674 %
5675 % \begin{usecases}
5676 % Table of Contents or similar tables with aligned section numbers.\visualpar Any table with
5677 % left- or right-aligned numerals in particular tabular numerals.\visualpar
5678 % Index.\label{secend:microtype-frontend}
5679 % \end{usecases}
5680 %
5681 %
5682 % \subsection{Sloppy Paragraphs}\label{sec:sloppy-paragraphs}
5683 % \index{paragraph>sloppy|userman}
5684 %
5685 % Experienced \LaTeX{} users know that \cs{sloppy} is more of a problem by itself and not
5686 % really a viable solution of the \doublequotes{overfull~box} syndrome.
5687 %
5688 % \DescribeMacro{\slightlysloppy}
5689 % \DescribeEnv{slightlysloppypar}
5690 % We define the macro~\cs{slightlysloppy} and the associated environment,
5691 % \code{slightlysloppypar}, with a user-selectable \meta{sloppiness} parameter. The
5692 % constructions recover the known settings \cs{fussy} (\meta{sloppiness}~=~0) and \cs{sloppy}
5693 % (\meta{sloppiness}~\(\ge\)~8), and introduce seven intermediate
5694 % \meta{sloppiness}~levels.\!\footnote{Also compare with the findings for \cs{emergencystretch}
5695 % in reference~\citenum{wermuth:2017a}.} The default \meta{sloppiness} is 1.
5696 %
5697 % \begin{synopsis}\label{syn:slightlysloppy}\label{syn:slightlysloppypar}
5698 % \cs{slightlysloppy}\oarg{sloppiness} \\[\smallskipamount]
5699 % \cs{begin}|{slightlysloppypar}|\oarg{sloppiness} \\
5700 % \hspace*{1em}\ttdots \\
5701 % \cs{end}|{slightlysloppypar}|
5702 % \end{synopsis}
5703 %
5704 % \Cref{tab:slightlysloppy} summarizes the adjustments that \cs{slightlysloppy} makes depending
5705 % on the \meta{sloppiness}~level.
5706 %
5707 % \begin{table}
5708 % \centering
5709 % \caption[Parameter adjustments of \cs{slightlysloppy}]%
5710 % {Adjustments made by \cs{slightlysloppy} to various \TeX~parameters at different
5711 % levels of \meta{sloppiness}.}
5712 % \label{tab:slightlysloppy}
5713 %
5714 % \newcommand*{\tolerancemark}{\tablenotemark{\dag}}%
5715 % \newcommand*{\scaledmark}{\tablenotemark{\ddag}}%
5716 %
5717 % \begin{suspendshortverb}
5718 % \begin{tabfigures}
5719 % \def~{\hphantom{0}}
5720 % \begin{tabular}{@{}ccccl@{}}
5721 % \toprule
5722 % \meta{sloppiness} & \cs{toler-} & \cs{hfuzz} & \cs{emergency-} & Note \\
5723 % {} & \code{ance} & \cs{vfuzz} & \code{stretch}~\(G\) & \\
5724 % {} & & pt & em & \\
5725 % \midrule
5726 % 0 & ~200\hphantom{\tolerancemark} & .1~ & 0\hphantom{.000\scaledmark} & \TeX: \verb+\fussy+ \\
5727 % 1 & ~330\tolerancemark & .15 & ~.375\scaledmark & default \\
5728 % 2 & ~530\tolerancemark & .2~ & ~.75\scaledmark~ & \\
5729 % 3 & ~870\tolerancemark & .25 & 1.125\scaledmark & \\
5730 % 4 & 1410\tolerancemark & .3~ & 1.5\scaledmark~~ & \\
5731 % 5 & 2310\tolerancemark & .35 & 1.875\scaledmark & \\
5732 % 6 & 3760\tolerancemark & .4~ & 2.25\scaledmark~ & \\
5733 % 7 & 6130\tolerancemark & .45 & 2.625\scaledmark & \\
5734 % \(\ge\)\:8 & 9999\hphantom{\tolerancemark} & .5~ & 3\hphantom{.000\scaledmark} & \TeX: \verb+\sloppy+ \\
5735 % \bottomrule
5736 % \end{tabular}
5737 % \end{tabfigures}
5738 % \end{suspendshortverb}
5739 %
5740 % \begin{tablenotes}
5741 % \renewcommand*{\tablenotemark}[1]{#1}%
5742 % \tolerancemark\enspace
5743 % All intermediate levels set \(\cs{pretolerance} = \cs{tolerance} / 2\).
5744 %
5745 % \scaledmark\enspace
5746 % The intermediate levels scale the amount of available glue~\(G\) (indicated in column~4
5747 % of the table) for \cs{emergencystretch} with the actual line length, this means, in these
5748 % levels
5749 % \begin{equation*}
5750 % \cs{emergencystretch} = G \times \frac{\cs{linewidth}}{\cs{textwidth}}.
5751 % \end{equation*}
5752 % to prevent excessive stretchability in narrow lines.
5753 % \end{tablenotes}
5754 % \end{table}
5755 %
5756 % Environment~|slightlysloppypar|\oarg{sloppiness} mimics \LaTeX's~\code{sloppypar}, while
5757 % offering the flexibility of~\cs{slightlysloppy}.
5758 %
5759 % \begin{usecases}
5760 % Drop-in replacement for \cs{sloppy}, whether explicit or implicit (think of
5761 % \cs{parbox}).\visualpar Initial paragraphs in theorem environments (e.\,g., as defined by
5762 % \packagename{amsmath} or \packagename{amsthm}), where the theorem~head already takes a lot
5763 % of space.\visualpar Bibliographies as environment~\code{thebibliography} sets~\cs{sloppy}.
5764 % \end{usecases}
5765 %
5766 %
5767 % \newpagetofixtoc
5768 % \subsection{Vertically Partially-Tied Paragraphs}\label{sec:vtie-paragraph}
5769 % \index{paragraph>vertically tied|userman}
5770 %
5771 % \LaTeX{} provides several macros and environments to tie material vertically\spacedemdash
5772 % most prominently |samepage| and |minipage|.\!\footnote{A valuable complement to these is
5773 % package~\packagename{needspace}~\cite{package:needspace} which takes a different approach and
5774 % reliably works in \emph{mixed} horizontal and vertical mode situations.}
5775 % \packagename{Typog's} macros and environments constitute more sophisticated but weaker forms
5776 % of these. They tie only the first or last couple of lines in a paragraph while the rest of
5777 % the paragraph gets broken into pages by \TeX{} in the usual way.
5778 %
5779 % The macros and environments described in this section locally set \eTeX{} penalty
5780 % arrays~\cite[Sec.~3.8]{package:etex}. In addition the environments~\code{vtietoppar},
5781 % \code{vtiebotpar}, and~\code{vtiebotdisptoppar} explicitly issue a \cs{par} at the end of the
5782 % group.
5783 %
5784 % \DescribeMacro{\vtietop}
5785 % \DescribeEnv{vtietoppar}
5786 % Avoid a club\index{forlorn line>club|userman} line in each partial paragraph.
5787 %
5788 % \begin{synopsis}\label{syn:vtietop}\label{syn:vtietoppar}
5789 % \cs{vtietop}\oarg{number-of-lines} \\[\smallskipamount]
5790 % \cs{begin}|{vtietoppar}|\oarg{number-of-lines}
5791 % \ttdots{}
5792 % \cs{end}|{vtietoppar}|
5793 % \end{synopsis}
5794 %
5795 % Vertically tie the first \meta{number\hyp{}of\hyp{}lines} in a paragraph. Zero or one for
5796 % \meta{number\hyp{}of\hyp{}lines} are no-ops. Up to nine lines can be fused. The default is
5797 % to link three lines.
5798 %
5799 % \begin{usecases}
5800 % String together the first paragraph right after a sectioning macro.\visualpar Tie the
5801 % first line of an itemized, enumerated, or a description list\index{list|userman} with the
5802 % paragraph following~\cs{item}.
5803 % \end{usecases}
5804 %
5805 % \noindent
5806 % \DescribeMacro{\splicevtietop}
5807 % Inside of a \code{list} a one-off solution simply concatenates
5808 % \cs{item}[\dots\itcorr{-5}]\cs{vtietop} to fuse the line with the \code{item\#}, the
5809 % representation of the \code{enum\#}, or the description term with the first paragraph. For a
5810 % systematic use prefer \cs{splicevtietop} and apply it as the first thing in the
5811 % \code{list}~body.
5812 %
5813 % \begin{synopsis}\label{syn:splicevtietop}
5814 % \cs{splicevtietop}\oarg{number-of-lines}
5815 % \end{synopsis}
5816 %
5817 % Use this macro \emph{inside} of a \code{list}-like environment to equip each \cs{item} with
5818 % \cs{vtietop}\oarg{number-of-lines}. The default \meta{number-of-lines} is three as for any
5819 % of the \code{vtie\ttdots}~functions.
5820 %
5821 % Example for a \code{description}~list and plain \LaTeX:
5822 %
5823 % \begin{codeexample}
5824 % 12\=\kill
5825 % \cs{begin}\{description\} \\
5826 % \> \cs{splicevtietop}[2] \\
5827 % \> \cs{item}[...] \\
5828 % \cs{end}\{description\}
5829 % \end{codeexample}
5830 %
5831 % Alternatively with package~\packagename{enumitem}~\cite{package:enumitem}:
5832 %
5833 % \begin{codeexample}
5834 % 12\=\kill
5835 % \cs{begin}\= \{description\}[first=\cs{splicevtietop[2]}] \\
5836 % \> \cs{item}[...] \\
5837 % \cs{end}\{description\}
5838 % \end{codeexample}
5839 %
5840 % \noindent
5841 % or shorter and with the default \meta{number-of-lines},~3, using the \packagename{enumitem}
5842 % style\footnote{The documentation of \packagename{enumitem} prosaically calls them
5843 % \singlequotes{keys} (Section~3) not \singlequotes{styles}.}~\code{vtietop}:
5844 %
5845 % \DescribeEnumItemKey{vtietop}
5846 % \begin{codeexample}
5847 % \cs{usepackage}\{enumitem\} \\
5848 % \cs{begin}\= \{description\}[vtietop] \\
5849 % ~~\cs{item}[...] \\
5850 % \cs{end}\{description\}
5851 % \end{codeexample}
5852 %
5853 % \medskip
5854 %
5855 % \noindent
5856 % \DescribeMacro{\vtiebot}
5857 % \DescribeEnv{vtiebotpar}
5858 % Avoid a widow\index{forlorn line>widow|userman} line in each partial paragraph.
5859 %
5860 % \begin{synopsis}\label{syn:vtiebot}\label{syn:vtiebotpar}
5861 % \cs{vtiebot}\oarg{number-of-lines} \\[\smallskipamount]
5862 % \cs{begin}|{vtiebotpar}|\oarg{number-of-lines}
5863 % \ttdots{}
5864 % \cs{end}|{vtiebotpar}|
5865 % \end{synopsis}
5866 %
5867 % Vertically tie the last \meta{number\hyp{}of\hyp{}lines} in a paragraph. Zero or one for
5868 % \meta{number\hyp{}of\hyp{}lines} are no-ops. Up to nine lines can be fused. The default is
5869 % to link three lines.
5870 %
5871 % \noindent
5872 % \DescribeEnv{vtiebotdisp}
5873 % Avoid a display widow\index{forlorn line>display widow|userman} line in each partial
5874 % paragraph.
5875 %
5876 % \begin{synopsis}\label{syn:vtiebotdisp}\label{syn:vtiebotdisppar}
5877 % \cs{begin}|vtiebotdisp|\oarg{before-disp-number-of-lines} \\
5878 % \hspace*{1em}\ttdots \\
5879 % \cs{end}|{vtiebotdisp}|
5880 % \end{synopsis}
5881 %
5882 % Vertically tie the last \meta{before\hyp{}disp\hyp{}number\hyp{}of\hyp{}lines} in a paragraph
5883 % before a display. Zero or one for \meta{before\hyp{}disp\hyp{}number\hyp{}of\hyp{}lines} are
5884 % no-ops. Up to nine lines can be fused. The default is to link three lines.
5885 %
5886 % To use the environment, bracket the paragraph before the display (the one that needs
5887 % protection) and the associated displayed math:
5888 %
5889 % \begin{codeexample}
5890 % \cs{begin}\{vtiebotdisp\} \\
5891 % ~~\% \textit{vertically tied paragraph before the math display} \\
5892 % ~~\cs{begin}\{equation\} \\
5893 % ~~~~\% \textit{math} \\
5894 % ~~\cs{end}\{equation\} \\
5895 % \cs{end}\{vtiebotdisp\}
5896 % \end{codeexample}
5897 %
5898 % \DescribeEnv{vtiebotdisptoppar}
5899 % Avoid a display widow, compound the display with its preceding \emph{and} following
5900 % paragraph, and avoid a club line in the paragraph right after the display.
5901 %
5902 % \begin{synopsis}\label{syn:vtiebotdisptop}\label{syn:vtiebotdisptoppar}
5903 % \begin{tabbing}
5904 % \cs{begin}|{vtiebotdisptoppar}|\= \oarg{before-disp-number-of-lines} \\
5905 % \> \oarg{after-disp-number-of-lines} \\
5906 % \hspace*{1em}\ttdots \\
5907 % \cs{end}|{vtiebotdisptoppar}|
5908 % \end{tabbing}
5909 % \end{synopsis}
5910 %
5911 % Vertically tie the last \meta{before\hyp{}disp\hyp{}number\hyp{}of\hyp{}lines} in the
5912 % paragraph before a display and the first
5913 % \meta{after\hyp{}disp\hyp{}number\hyp{}of\hyp{}lines} in the paragraph after the display.
5914 % Moreover, turn the paragraphs and the display into an unbreakable unit.\!\footnote{The
5915 % paragraphs and the display are concreted together by setting both \cs{predisplaypenalty}
5916 % and~\cs{postdisplaypenalty} to~10000.}
5917 %
5918 % Zero or one for \meta{before-disp-number\hyp{}of\hyp{}lines} as well as
5919 % \meta{after\hyp{}disp\hyp{}number\hyp{}of\hyp{}lines} are no-ops for the paragraph. Up to
5920 % nine lines each can be fused.
5921 %
5922 % Both optional arguments default to three. If only the first argument is given the second
5923 % acquires the same value.
5924 %
5925 % To use the environment, bracket the paragraphs before and after the display:
5926 %
5927 % \begin{codeexample}
5928 % \cs{begin}\{vtiebotdisptoppar\} \\
5929 % ~~\% \textit{vertically tied paragraph before the math display} \\
5930 % ~~\cs{begin}\{equation\} \\
5931 % ~~~~\% \textit{math} \\
5932 % ~~\cs{end}\{equation\} \\
5933 % ~~\% \textit{vertically tied paragraph after the math display} \\
5934 % \cs{end}\{vtiebotdisptoppar\}
5935 % \end{codeexample}
5936 %
5937 % \smallskip
5938 %
5939 % \noindent
5940 % See also \cref{sec:fill-last-line-gp-environments} for other methods to avoid club or widow
5941 % lines.
5942 %
5943 % \begin{typoginspectpar}{partial-paragraphs}
5944 % \setlength{\smoothraggedrightragwidth}{8pt}
5945 % \paragraph{Partial Paragraphs And Counting Lines.}
5946 %
5947 % The top-of-paragraph ties, \cs{vtietop} and \code{vtietoppar} count
5948 % \meta{number\hyp{}of\hyp{}lines} from the beginning of every partial paragraph. Each
5949 % displayed math in the paragraph resets the count. The bottom-paragraph ties, \cs{vtiebot},
5950 % \code{vtiebotpar}, \cs{vtiebotdisp}, and \code{vtiebotdisppar} count backward from the end
5951 % of each partial paragraph. Again, each displayed math in the paragraph resets the count.
5952 % According to \TeX's rules, a displayed math formula always is counted as \emph{three} lines
5953 % no matter its contents. \Cref{tab:partial-paragraph-line-counts} summarizes these rules
5954 % with the help of an example.
5955 % \end{typoginspectpar}
5956 %
5957 % \begin{table}
5958 % \centering
5959 % \caption[Partial paragraph line counts]
5960 % {Exemplary, eight-line paragraph compounded of two partial paragraphs of three and
5961 % two lines and a displayed math formula of arbitrary size sandwiched in between.}
5962 % \label{tab:partial-paragraph-line-counts}
5963 %
5964 % \newcommand*{\clubmark}{\tablenotemark{\dag}}
5965 % \newcommand*{\widowmark}{\tablenotemark{\ddag}}
5966 %
5967 % \begin{tabfigures}
5968 % \begin{tabular}{@{}clcc@{}}
5969 % \toprule
5970 % Continuous & Example & \cs{vtietop}\clubmark & \cs{vtiebot}\widowmark \\
5971 % Line Number & Contents & Count & Count \\
5972 % \midrule
5973 % 1 & Text line\textsubscript{1} & 1 & 3 \\
5974 % 2 & Text line\textsubscript{2} & 2 & 2 \\
5975 % 3 & Text line\textsubscript{3} & 3 & 1 \\
5976 % 4 & & & \\
5977 % 5 & \(\smash{\Biggr\}}\) \parbox[c][0pt]{3.5em}{Display \\[-.12em] math} & & \\
5978 % 6 & & & \\
5979 % 7 & Text line\textsubscript{4} & 1 & 2 \\
5980 % 8 & Text line\textsubscript{5} & 2 & 1 \\
5981 % \bottomrule
5982 % \end{tabular}
5983 % \end{tabfigures}
5984 %
5985 % \begin{tablenotes}
5986 % \renewcommand*{\tablenotemark}[1]{#1}%
5987 % \clubmark\enspace
5988 % This is \eTeX's counting scheme of \cs{clubpenalties}; it also holds for
5989 % \code{vtietoppar}.
5990 %
5991 % \widowmark\enspace
5992 % The same counting scheme also holds for \code{vtiebotpar}, \cs{vtiebotdisp},
5993 % and~\code{vtiebotdisppar}. It is implied by \eTeX's line counts of \cs{widowpenalties}
5994 % and~\cs{displaywidowpenalties} on which the functions of this package are based.
5995 % \end{tablenotes}
5996 % \end{table}
5997 %
5998 % \begin{tips}
5999 % \begin{itemize}[notopsep]
6000 % \item The environments can be combined to arrive at paragraphs that simultaneously are
6001 % protected against club lines and (display) widow lines.
6002 %
6003 % \item For very long derivations that are not interrupted and thus made breakable with the
6004 % help of \cs{intertext}\footnote{Introduced in
6005 % package~\packagename{amsmath}~\cite{package:amsmath}.} or
6006 % \cs{shortintertext}\footnote{Defined in
6007 % package~\packagename{mathtools}~\cite{package:mathtools}.} it is desirable to make the
6008 % display breakable. This is achieved with \cs{allowdisplaybreaks} or the
6009 % environment~\code{breakabledisplay} which will be described
6010 % in~\cref{sec:breakable-display}.\specialsectionendhere
6011 % \end{itemize}
6012 % \end{tips}\unskip
6013 %
6014 % \begin{usecases}
6015 % Avoid widows and orphans, e.\,g., those turned up by
6016 % package~\packagename{widows-and-orphans}~\cite{package:widows-and-orphans}.\visualpar
6017 % Extend the convention of using three to four lines instead of a single club or widow line
6018 % to a flexible, context-dependent rule that aims to keep all the relevant information
6019 % together for the reader\spacedemdash ideally, at least.
6020 % \end{usecases}
6021 %
6022 %
6023 % \subsection{Breakable Displayed Equations}\label{sec:breakable-display}
6024 % \index{page break|userman}
6025 %
6026 % \DescribeEnv{breakabledisplay}
6027 % Package~\packagename{amsmath}\index{amsmath=\packagename{amsmath} (package)|userman} offers
6028 % \cs{allowdisplaybreaks} to render displayed equations breakable at each of their lines.
6029 % Environment~\cs{breakabledisplay} is a wrapper around it which limits the macro's influence
6030 % to the environment. Furthermore, the default \meta{level} of \code{breakabledisplay} is~3
6031 % whereas that of \cs{allowdisplaybreaks} is~4. This results in fewer breaks in displayed
6032 % equations, making \code{breakabledisplay} more suitable for automated page breaking.
6033 %
6034 % \begin{synopsis}\label{syn:breakabledisplay}
6035 % \cs{begin}|{breakabledisplay}|\oarg{level} \\
6036 % \hspace*{1em}\ttdots \\
6037 % \cs{end}|{breakabledisplay}|
6038 % \end{synopsis}
6039 %
6040 % Environment~|breakabledisplay| simply passes on \meta{level} to \cs{allowdisplaybreaks}.
6041 % \Cref{tab:allowdisplaybreaks-penalties} shows the default penalties that
6042 % \packagename{amsmath} associated with each of the \meta{level}s.
6043 %
6044 % \begin{table}
6045 % \centering
6046 % \caption[Env.~\code{breakabledisplay} and \cs{interdisplaylinepenalty}]%
6047 % {Penalties~\cs{interdisplaylinepenalty} associated with different \meta{level}s of
6048 % environment~\code{breakabledisplay}. Depending on the version of
6049 % package~\packagename{amsmath} the actual penalties may differ.}
6050 % \label{tab:allowdisplaybreaks-penalties}
6051 %
6052 % \newcommand*{\clubmark}{\tablenotemark{\dag}}
6053 %
6054 % \begin{tabfigures}
6055 % \def~{\hphantom{0}}
6056 % \begin{tabular}{@{}ccl@{}}
6057 % \toprule
6058 % \meta{level} & \cs{interdisplay-} & Note \\
6059 % {} & \code{linepenalty} & \\
6060 % \midrule
6061 % 0 & 10000 & no operation \\
6062 % 1 & ~9999 & \\
6063 % 2 & ~6999 & \\
6064 % 3 & ~2999 & default \\
6065 % 4 & ~~~~0\rlap{\clubmark} & \\
6066 % \bottomrule
6067 % \end{tabular}
6068 % \end{tabfigures}
6069 %
6070 % \begin{tablenotes}
6071 % \renewcommand*{\tablenotemark}[1]{#1}%
6072 % \clubmark\enspace
6073 % This is the default of \cs{allowdisplaybreaks}.
6074 % \end{tablenotes}
6075 % \end{table}
6076 %
6077 % \begin{tips}
6078 % \begin{itemize}[notopsep]
6079 % \item Terminating a line with \sample{\code{\textbackslash\textbackslash*}} inhibits a
6080 % break after this line.
6081 %
6082 % \item A \cs{displaybreak}\oarg{level} can be set for \emph{each} line of the displayed
6083 % equation separately. \LaTeX{} resumes with the original value of
6084 % \cs{interdisplaylinepenalty} in the following lines. Note, however, that
6085 % \cs{displaybreak} is only effective (immediately) in front of
6086 % \sample{\code{\textbackslash\textbackslash}}. See the \doublequotes{User's Guide for the
6087 % \packagename{amsmath}~Package} for a discussion~\cite[Sec.~3.9]{package:amsmath}.
6088 %
6089 % \item If a discretionary break of the displayed equation is to be accompanied with some aid
6090 % for the reader, team \cs{intertext} (or \cs{shortintertext}) with \cs{displaybreak} as,
6091 % e.\,g.,
6092 %
6093 % \begin{codeexample}
6094 % \cs{newcommand*}\{\cs{discretionarydisplaybreak}\} \\
6095 % 12\=3\=\kill
6096 % \> \{ \> \cs{intertext}\{\cs{hfill} Eq.\textasciitilde cont.\textasciitilde on next page.\}\% \\
6097 % \> \> \cs{displaybreak} \\
6098 % \> \> \cs{intertext}\{Eq.\textasciitilde cont.\textasciitilde
6099 % from prev.\textasciitilde page.\cs{hfill}\}\}\specialsectionendhere
6100 % \end{codeexample}
6101 % \end{itemize}
6102 % \end{tips}\unskip
6103 %
6104 % \begin{usecases}
6105 % Extremely long derivations without interspersed \cs{intertext} or
6106 % \cs{shortintertext}.\visualpar Draft phase of a document.
6107 % \end{usecases}
6108 %
6109 %
6110 % \subsection{\packagename{Setspace} Front End}\label{sec:setspace-frontend}
6111 %
6112 % Package \packagename{setspace} \cite{package:setspace} is a base hit when it comes to
6113 % consistently setting the line skip for a document via the macro~\cs{setstretch}. The
6114 % interface of \cs{setstretch} though is unintuitive as it asks for an obscure
6115 % factor.\fontsizeinfo{setspacefontsizeinfo}\marginnote{The copy of this document gets typeset
6116 % with~\setspacefontsizeinfo*.} The \LaTeX{} user however prefers to keep her eyes on the ball
6117 % and set the line skip\index{baseline skip|userman} directly (e.\,g.~12.5\,pt) or the lines'
6118 % leading\index{leading|userman} to a length or percentage of the font's size.\!\footnote{To
6119 % find out about the current font's size and the \cs{baselineskip} in printable form check out
6120 % \cref{sec:font-information} on \cpageref{sec:font-information}.} This is where the following
6121 % macros go to bat.
6122 %
6123 % \begin{important}
6124 % All macros that are introduced in this section rely on macro~\cs{setstretch}. So
6125 % package~\packagename{setspace} must have been loaded with
6126 %
6127 % \begin{codeexample}
6128 % \cs{usepackage}\{setspace\}
6129 % \end{codeexample}
6130 %
6131 % \noindent
6132 % in the document preamble.
6133 % \end{important}
6134 %
6135 % \DescribeMacro{\setbaselineskip}
6136 % \sinceversion{Since v0.3}
6137 % Set the line skip using an absolute length\spacedemdash technically: a |dimen|.
6138 %
6139 % \begin{synopsis}\label{syn:setbaselineskip}
6140 % \cs{setbaselineskip}\marg{baseline-skip}
6141 % \end{synopsis}
6142 %
6143 % Set the \cs{baselineskip} to \meta{baseline-skip}. This is what a non-initiated user expects
6144 % from the assignment
6145 %
6146 % \begin{codeexample}
6147 % \cs{setlength}\{\cs{baselineskip}\}\{\meta{baseline-skip}\}
6148 % \end{codeexample}
6149 %
6150 % The \meta{baseline-skip} can contain a rubber (stretch/shrink) component, however,
6151 % \cs{setbaselineskip} will discard of it and issue a warning that only the fixed-length part
6152 % will be used in the computation.
6153 %
6154 % \begin{example}
6155 % \begin{itemize}[notopsep]
6156 % \item Let us assume we want to lighten the gray value of the copy a tad with the
6157 % \cs{baselineskip} increased from 12\,pt to~12.5\,pt. To this end we say:
6158 %
6159 % \begin{codeexample}
6160 % \cs{setbaselineskip}\{12.5\,pt\}
6161 % \end{codeexample}
6162 %
6163 % \item In a generic part of the document, where the actual \cs{baselineskip} is not known,
6164 % we can refer to its current value and rescale it:
6165 %
6166 % \begin{codeexample}
6167 % \cs{setbaselineskip}\{\cs{baselineskip} * 12.5 / 12\}
6168 % \end{codeexample}
6169 %
6170 % Care should be taken if code like the above is implicitly or explicitly
6171 % repeated, because it results in a geometric series.\specialsectionendhere
6172 % \end{itemize}
6173 % \end{example}
6174 %
6175 % \DescribeMacro{\resetbaselineskip}
6176 % \sinceversion{Since v0.3}
6177 % Reset the \cs{baselineskip} to its original value.
6178 %
6179 % \begin{synopsis}\label{syn:resetbaselineskip}
6180 % \cs{resetbaselineskip}
6181 % \end{synopsis}
6182 %
6183 % This macro simply expands to |\setstretch{1}|. So, we rely on \packagename{setspace}'s
6184 % notion of what is a single-line \cs{baselineskip}.
6185 %
6186 %
6187 % \hangindent=2\parindent
6188 % \hangafter=-2
6189 % \noindent
6190 % \DescribeMacro{\setbaselineskippercentage}
6191 % \sinceversion{Since v0.3}
6192 % Set the \cs{baselineskip} with a relative value calculated as a percentage of the current
6193 % font's point size.
6194 %
6195 % \begin{synopsis}\label{syn:setbaselineskippercentage}
6196 % \cs{setbaselineskippercentage}\marg{baselineskip-percentage}
6197 % \end{synopsis}
6198 %
6199 % Set \cs{baselineskip} to \(\cs{typogfontsize} \times \meta{baselineskip-percentage} / 100\).
6200 %
6201 % \begin{example}
6202 % We modify the previous example and assume a point size of 10\,pt, but now write
6203 %
6204 % \begin{codeexample}
6205 % \cs{setbaselineskippercentage}\{125\}
6206 % \end{codeexample}
6207 %
6208 % \noindent
6209 % which sets \cs{baselineskip} to \(10\text{\,pt} \times 125 / 100 = 12.5\text{\,pt}\).
6210 % \end{example}
6211 %
6212 % \DescribeMacro{\setleading}
6213 % \sinceversion{Since v0.3}
6214 % Set the \cs{baselineskip} with an absolute length that gets \emph{added to} \cs{typogfontsize}.
6215 %
6216 % \begin{synopsis}\label{syn:setleading}
6217 % \cs{setleading}\marg{leading}
6218 % \end{synopsis}
6219 %
6220 % Set the \cs{baselineskip} to \cs{typogfontsize} plus \meta{leading}. Note that
6221 % \meta{leading} can be negative, e.\,g.~to set solid.
6222 %
6223 % \begin{example}
6224 % Another solution of the previous example, given a point size of 10\,pt is to write
6225 %
6226 % \begin{codeexample}
6227 % \cs{setleading}\{2.5pt\}
6228 % \end{codeexample}
6229 %
6230 % \noindent
6231 % which sets \cs{baselineskip} to \(10\text{pt} + 2.5\text{pt} = 12.5\text{pt}\).
6232 % \end{example}
6233 %
6234 % \DescribeMacro{\setleadingpercentage}
6235 % \sinceversion{Since v0.3}
6236 % Set the \cs{baselineskip} to \cs{typogfontsize} \emph{plus} a relative value calculated as a
6237 % percentage of \cs{typogfontsize}.
6238 %
6239 % \begin{synopsis}\label{syn:setleadingpercentage}
6240 % \cs{setleadingpercentage}\marg{leading-percentage}
6241 % \end{synopsis}
6242 %
6243 % Set \cs{baselineskip} to \(\cs{typogfontsize} \times (1 + \meta{leading-percentage} / 100)\).
6244 %
6245 % \begin{example}
6246 % We modify the previous example and again assume a point size of 10\,pt, but now write
6247 %
6248 % \begin{codeexample}
6249 % \cs{setleadingpercentage}\{25\}
6250 % \end{codeexample}
6251 %
6252 % \noindent
6253 % which sets \cs{baselineskip} to \(10\text{\,pt} \times (1 + 25 / 100) = 12.5\text{\,pt}\).
6254 % \end{example}
6255 %
6256 % \smallskip
6257 %
6258 % \DescribeLaTeXDimen{\typogfontsize}
6259 % \sinceversion{Since v0.3}
6260 % The macros \cs{setbaselineskippercentage}, \cs{setleading}, and \cs{setleadingpercentage} all
6261 % depend on the font size. By changing \cs{typogfontsize} they can be configured for different
6262 % font sizes.
6263 %
6264 % The length \cs{typogfontsize} gets initialized at the end of the preamble to the default
6265 % font's quad size:\footnote{For an overview of the various
6266 % \cs{fontdimen}\meta{number}~parameters consult \cref{tab:fontdimen} on
6267 % \cpageref{tab:fontdimen}.}
6268 %
6269 % \begin{codeexample}\label{syn:typogfontsize}
6270 % \cs{typogfontsize}=\cs{fontdimen6}\cs{font}
6271 % \end{codeexample}
6272 %
6273 % \noindent
6274 % which is also called its \doublequotes{nominal size} or its \doublequotes{point size}. This
6275 % assignment can be repeated at any point in the document to record a reference font's size.
6276 % To set just \cs{typogfontsize} without changing the current font, encapsulate the font change
6277 % in a group and export the new value:
6278 %
6279 % \begin{codeexample}
6280 % \cs{begingroup} \\
6281 % ~~\cs{usefont}\{T1\}\{Arvo-TLF\}\{m\}\{n\}\cs{selectfont} \\
6282 % ~~\cs{normalsize} \\
6283 % ~~\cs{global}\cs{typogfontsize}=\cs{fontdimen6}\cs{font} \\
6284 % \cs{endgroup}
6285 % \end{codeexample}
6286 %
6287 % An alternative to relying on the point size is using the actual size of an uppercase letter:
6288 %
6289 % \begin{codeexample}
6290 % \cs{settoheight}\{\cs{typogfontsize}\}\{CEMNORSUVWXZ\}
6291 % \end{codeexample}
6292 %
6293 % \noindent
6294 % With \cs{typogfontsize} defined this way it becomes trivial to set solid:
6295 %
6296 % \begin{codeexample}
6297 % \cs{setleading}\{0pt\}
6298 % \end{codeexample}
6299 %
6300 % \noindent
6301 % or
6302 %
6303 % \begin{codeexample}
6304 % \cs{setleadingpercentage}\{0\}
6305 % \end{codeexample}
6306 %
6307 % \begin{tip}
6308 % All macros in this section actually accept expressions of their argument types, though the
6309 % sick rules of \TeX{} \meta{dimen}- and \meta{skip}-expressions apply.
6310 %
6311 % Here are some forms that do work:
6312 %
6313 % \begin{codeexample}
6314 % \cs{setbaselineskip}\{12pt + 0.6667pt\} \\
6315 % \cs{setbaselineskip}\{12pt * 110 / 100\} \\
6316 % \cs{setbaselineskippercentage}\{100 + 25\} \\
6317 % \cs{setleading}\{1pt / -2.0\} \\
6318 % \cs{setleadingpercentage}\{10 - 25 / 2\}\specialsectionendhere
6319 % \end{codeexample}\label{secend:setspace-frontend}
6320 % \end{tip}
6321 %
6322 %
6323 % \clearpage
6324 % \subsection{Smooth Ragged}\label{sec:smooth-ragged}
6325 % \index{ragged right|userman}
6326 %
6327 % \begin{whittyquote}
6328 % The attention someone gives \\
6329 % to what he or she makes \\
6330 % is reflected in the end result, \\
6331 % whether it is obvious or not. \\
6332 % \capitalemdash*~\propername{Erik Spiekermann}
6333 % \end{whittyquote}
6334 %
6335 % \noindent
6336 % Package \packagename{typog} implements a novel approach to typesetting ragged paragraphs.
6337 % Instead of setting the glue inside a paragraph to zero and letting the line~widths vary
6338 % accordingly~\cite{wermuth:2020}, we prescribe the line~widths with \TeX's
6339 % \cs{parshape}~primitive and leave the stretchability and shrinkability of the glue unchanged.
6340 %
6341 % \begin{caution}
6342 % None of the following environments work within lists (e.\,g.~\code{description},
6343 % \code{enumerate}, or \code{itemize}).
6344 % \end{caution}
6345 %
6346 % \begin{slightlysloppypar}[2]
6347 % \hangindent=3.5\parindent
6348 % \hangafter=-6
6349 % \noindent
6350 % \DescribeEnv{smoothraggedrightshapetriplet}
6351 % \DescribeEnv{smoothraggedrightshapequintuplet}
6352 % \DescribeEnv{smoothraggedrightshapeseptuplet}
6353 % We introduce three environments that define three, five, or seven different line~lengths
6354 % (which \TeX{} will, of course, repeat for paragraphs longer than three, five, or seven
6355 % lines): \code{smoothraggedrightshapetriplet}, \code{smoothraggedrightshapequintuplet}, and
6356 % \code{smoothraggedrightshapeseptuplet}. They work for paragraph lengths up to
6357 % \makeatletter
6358 % \typog@triplet@max@lines, \typog@quintuplet@max@lines, and
6359 % \typog@septuplet@max@lines~lines, respectively.
6360 % \makeatother
6361 % \end{slightlysloppypar}
6362 %
6363 % \begin{widebody}
6364 % \begin{synopsis}\label{syn:smoothraggedrightshapetriplet}\label{syn:smoothraggedrightshapequintuplet}\label{syn:smoothraggedrightshapeseptuplet}
6365 % \cs{begin}|{smoothraggedrightshapetriplet}|{[\meta{option}\ttdots]}\marg{width1}\marg{width2}\marg{width3} \\
6366 % \hspace*{1em}\ttdots \\
6367 % \cs{end}|{smoothraggedrightshapetriplet}| \\[\smallskipamount]
6368 % \cs{begin}|{smoothraggedrightshapequintuplet}|{[\meta{option}\ttdots]}\marg{width1}\ttdots\marg{width5} \\
6369 % \hspace*{1em}\ttdots \\
6370 % \cs{end}|{smoothraggedrightshapequintuplet}| \\[\smallskipamount]
6371 % \cs{begin}|smoothraggedrightshapeseptuplet|{[\meta{option}\ttdots]}\marg{width1}\ttdots\marg{width7} \\
6372 % \hspace*{1em}\ttdots \\
6373 % \cs{end}|{smoothraggedrightshapeseptuplet}|
6374 % \end{synopsis}
6375 % \end{widebody}
6376 %
6377 % The environments take \(N\) = 3, 5, or~7 mandatory line-width parameters, where each
6378 % \meta{width\itcorr{3}I}, \(I = 1,~\dots, N\), is a skip, i.\,e., a dimen that can include
6379 % some glue.
6380 %
6381 % Option \code{leftskip=}\meta{dim} sets the left margin of the smooth ragged paragraph to
6382 % \meta{dim}; it is similar to the \TeX{} parameter~\cs{leftskip}.
6383 % Option~\code{parindent=}\meta{dim} sets the first-line indent of the smooth ragged paragraph
6384 % to \meta{dim}; it is similar to the \TeX{} parameter~\cs{parindent}.
6385 %
6386 % \noindent
6387 % \DescribeEnv{smoothraggedrightpar}
6388 % Environment~|smoothraggedrightpar| builds upon the three environments just described, using
6389 % them as \singlequotes{generators}. It prescribes three, five, or seven relative line~lengths
6390 % that are known to yield convincing rags.
6391 %
6392 % \begin{synopsis}\label{syn:smoothraggedrightpar}
6393 % \cs{begin}|{smoothraggedrightpar}|{[\meta{option}\ttdots]} \\
6394 % \hspace*{1em}\ttdots \\
6395 % \cs{end}|{smoothraggedrightpar}|
6396 % \end{synopsis}
6397 %
6398 % Typeset a single paragraph with a given rag~width---set with the global
6399 % parameter~\hyperref[syn:smoothraggedrightragwidth]{\code{smoothraggedrightragwidth}}---of the
6400 % right margin, where with \doublequotes{rag width} we mean the length difference of the
6401 % longest and the shortest lines. Select the generator with
6402 % \hyperref[syn:smoothraggedrightgenerator]{\code{smoothraggedrightgenerator}}. The line
6403 % lengths equally divide the ragged margin, i.\,e., they form an arithmetic sequence based on
6404 % the generator size.
6405 %
6406 % Option \code{linewidth=}\meta{dim} overrides the length of the longest line with \meta{dim}.
6407 % The default line~width is the current \cs{line\-width}.
6408 %
6409 % \iffalse
6410 %<*smoothparshapes>
6411 prologues := 3;
6412
6413 def draw_filled_rectangle(expr lower_left, upper_right, color) =
6414 fill lower_left -- (xpart upper_right, ypart lower_left) --
6415 upper_right -- (xpart lower_left, ypart upper_right) --
6416 cycle
6417 withcolor color;
6418 enddef;
6419
6420
6421 u := 100;
6422
6423 em := 10;
6424 linelength := 2u;
6425 baselineskip := 1.2em;
6426 parskip := 3;
6427 parindent := 2.5em;
6428 ragwidth := 2em;
6429
6430 cmykcolor line_color;
6431 line_color := (.08, 0, 0, .18); % cold silver
6432
6433 color customred[];
6434 customred[1] := (.890, .282, .282);
6435 customred[2] := (.831, .110, .110);
6436 customred[3] := (.686, .043, .043);
6437 customred[4] := (.569, .000, .000);
6438 customred[5] := (.420, .000, .000);
6439
6440 color margin_color;
6441 margin_color := customred[2];
6442
6443
6444 beginfig(1); % triplet
6445 y := 0;
6446 draw_filled_rectangle((0, y), (linelength - ragwidth, y + 1em), line_color); % (1)
6447 y := y - baselineskip;
6448 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color); % (3)
6449 y := y - baselineskip;
6450 draw_filled_rectangle((0, y), (linelength - ragwidth/2, y + 1em), line_color); % (2)
6451 y := y - baselineskip;
6452 draw_filled_rectangle((0, y), (linelength - ragwidth, y + 1em), line_color); % (1)
6453 y := y - baselineskip;
6454 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color); % (3)
6455 y := y - baselineskip;
6456 draw_filled_rectangle((0, y), (linelength - ragwidth/2, y + 1em), line_color); % (2)
6457
6458 draw_filled_rectangle((-.667em, 1em), (-.333em, -5baselineskip), margin_color);
6459 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -5baselineskip), margin_color);
6460 endfig;
6461
6462
6463 beginfig(2); % quintuplet
6464 y := 0;
6465 draw_filled_rectangle((0, y), (linelength - .75ragwidth, y + 1em), line_color); % (2)
6466 y := y - baselineskip;
6467 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color); % (5)
6468 y := y - baselineskip;
6469 draw_filled_rectangle((0, y), (linelength - .5ragwidth, y + 1em), line_color); % (3)
6470 y := y - baselineskip;
6471 draw_filled_rectangle((0, y), (linelength - .25ragwidth, y + 1em), line_color); % (4)
6472 y := y - baselineskip;
6473 draw_filled_rectangle((0, y), (linelength - ragwidth, y + 1em), line_color); % (1)
6474 y := y - baselineskip;
6475 draw_filled_rectangle((0, y), (linelength - .75ragwidth, y + 1em), line_color); % (2)
6476 y := y - baselineskip;
6477 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color); % (5)
6478 y := y - baselineskip;
6479 draw_filled_rectangle((0, y), (linelength - .5ragwidth, y + 1em), line_color); % (3)
6480 y := y - baselineskip;
6481 draw_filled_rectangle((0, y), (linelength - .25ragwidth, y + 1em), line_color); % (4)
6482 y := y - baselineskip;
6483 draw_filled_rectangle((0, y), (linelength - ragwidth, y + 1em), line_color); % (1)
6484
6485 draw_filled_rectangle((-.667em, 1em), (-.333em, -9baselineskip), margin_color);
6486 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -9baselineskip), margin_color);
6487 endfig;
6488
6489
6490 beginfig(3); % septuplet
6491 y := 0;
6492 draw_filled_rectangle((0, y), (linelength - .6667ragwidth, y + 1em), line_color); % (3)
6493 y := y - baselineskip;
6494 draw_filled_rectangle((0, y), (linelength - .1667ragwidth, y + 1em), line_color); % (6)
6495 y := y - baselineskip;
6496 draw_filled_rectangle((0, y), (linelength - ragwidth, y + 1em), line_color); % (1)
6497 y := y - baselineskip;
6498 draw_filled_rectangle((0, y), (linelength - .3333ragwidth, y + 1em), line_color); % (5)
6499 y := y - baselineskip;
6500 draw_filled_rectangle((0, y), (linelength - .8333ragwidth, y + 1em), line_color); % (2)
6501 y := y - baselineskip;
6502 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color); % (7)
6503 y := y - baselineskip;
6504 draw_filled_rectangle((0, y), (linelength - .5ragwidth, y + 1em), line_color); % (4)
6505 y := y - baselineskip;
6506 draw_filled_rectangle((0, y), (linelength - .6667ragwidth, y + 1em), line_color); % (3)
6507 y := y - baselineskip;
6508 draw_filled_rectangle((0, y), (linelength - .1667ragwidth, y + 1em), line_color); % (6)
6509 y := y - baselineskip;
6510 draw_filled_rectangle((0, y), (linelength - ragwidth, y + 1em), line_color); % (1)
6511 y := y - baselineskip;
6512 draw_filled_rectangle((0, y), (linelength - .3333ragwidth, y + 1em), line_color); % (5)
6513 y := y - baselineskip;
6514 draw_filled_rectangle((0, y), (linelength - .8333ragwidth, y + 1em), line_color); % (2)
6515 y := y - baselineskip;
6516 draw_filled_rectangle((0, y), (linelength, y + 1em), line_color); % (7)
6517 y := y - baselineskip;
6518 draw_filled_rectangle((0, y), (linelength - .5ragwidth, y + 1em), line_color); % (4)
6519
6520 draw_filled_rectangle((-.667em, 1em), (-.333em, -13baselineskip), margin_color);
6521 draw_filled_rectangle((linelength + .333em, 1em), (linelength + .667em, -13baselineskip), margin_color);
6522 endfig;
6523 end
6524 %</smoothparshapes>
6525 % \fi
6526 %
6527 % \begin{itemize}[noindent]
6528 % \item
6529 % \begin{minipage}[t]{\linewidth}
6530 % The triplet generator repeats a \emph{short~line--long~line--middle-length~line}
6531 % sequence. Shown below are two complete cycles.
6532 %
6533 % \begin{center}
6534 % \includegraphics{smooth-parshapes-1.mps}
6535 % \end{center}
6536 % \end{minipage}
6537 %
6538 % \item
6539 % \begin{minipage}[t]{\linewidth}
6540 % The quintuplet generator varies the triplet theme and avoids the \singlequotes{ladder}
6541 % pattern of lines~2\figuredash3\figuredash4 (or, if numbered by
6542 % cycle:~1.2\figuredash1.3\figuredash2.1). Shown here are two cycles.
6543 %
6544 % \begin{center}
6545 % \includegraphics{smooth-parshapes-2.mps}
6546 % \end{center}
6547 % \end{minipage}
6548 %
6549 % \item
6550 % \begin{minipage}[t]{\linewidth}
6551 % The septuplet generator uses a permutation that appears \singlequotes{random}; at the
6552 % very least, it conceals the cycle boundaries effectively. Shown here are two of them.
6553 %
6554 % \begin{center}
6555 % \includegraphics{smooth-parshapes-3.mps}
6556 % \end{center}
6557 % \end{minipage}
6558 % \end{itemize}
6559 %
6560 % The graphical representations of the smooth-ragged-right-paragraph shapes shown above are
6561 % based on the actual values used by the environments and not made~up only for pretty figures.
6562 %
6563 % \noindent
6564 % \DescribeEnv{smoothraggedright}
6565 % Environment~|smoothraggedright| is the multi-paragraph version of
6566 % \code{smoothraggedrightpar}. It takes the same optional arguments.
6567 %
6568 % \begin{synopsis}\label{syn:smoothraggedright}
6569 % \cs{begin}|{smoothraggedright}|{[\meta{option}\ttdots]} \\
6570 % \hspace*{1em}\ttdots \\
6571 % \cs{end}|{smoothraggedright}|
6572 % \end{synopsis}
6573 %
6574 % \DescribeMacro{\smoothraggedrightfuzzfactor}
6575 % \indent
6576 % The environments \code{smoothraggedright} and \code{smoothraggedrightpar} add glue to every
6577 % line~width\footnote{The shortest line only gets stretchability, the longest receives only
6578 % shrinkability. All other lines are both stretchable and shrinkable.} to achieve a more
6579 % convincing \doublequotes{ragged appearance} and to reduce the number of overfull lines. The
6580 % algorithm divides the smooth margin into 3, 5, or~7 parts depending on the chosen
6581 % \cs{smoothraggedrightgenerator} (see below).
6582 %
6583 % \begin{synopsis}\label{syn:smoothraggedrightfuzzfactor}
6584 % \cs{renewcommand*}\{\cs{smoothraggedrightfuzzfactor}\}\marg{\itcorr{7}factor}
6585 % \end{synopsis}
6586 %
6587 % The \cs{smoothraggedrightfuzzfactor} is the amount of glue of each line expressed as a
6588 % multiple of the distance between the division points. The default~\meta{\itcorr{7}factor} of
6589 % 1.0 means that glue is added just enough to prevent the lines from overlapping (assuming
6590 % justification is feasible).
6591 %
6592 % \DescribeMacro{\smoothraggedrightgenerator}
6593 % \indent
6594 % This macro selects the generator to use.
6595 %
6596 % \begin{synopsis}\label{syn:smoothraggedrightgenerator}
6597 % \cs{renewcommand*}\{\cs{smoothraggedrightgenerator}\}\marg{generator}
6598 % \end{synopsis}
6599 %
6600 % Valid \meta{generator} names are
6601 %
6602 % \begin{itemize}[noitemsep]
6603 % \item |triplet|,
6604 % \item |quintuplet|, and
6605 % \item |septuplet|.
6606 % \end{itemize}
6607 %
6608 % \noindent
6609 % The default generator is |triplet|.
6610 %
6611 % \DescribeLaTeXSkip{\smoothraggedrightleftskip}
6612 % \indent
6613 % Value for |leftskip| to pass to the generator.
6614 %
6615 % \begin{synopsis}\label{syn:smoothraggedrightleftskip}
6616 % \cs{smoothraggedrightleftskip}=\meta{dim}
6617 % \end{synopsis}
6618 %
6619 % Default: \formatdimen*{0pt}.
6620 %
6621 % \DescribeLaTeXSkip{\smoothraggedrightparindent}
6622 % \indent Value for |parindent| to pass to the generator.
6623 %
6624 % \begin{synopsis}\label{syn:smoothraggedrightparindent}
6625 % \cs{smoothraggedrightparindent}=\meta{dim}
6626 % \end{synopsis}
6627 %
6628 % Default: \formatdimen*{0pt}.
6629 %
6630 % \DescribeLaTeXSkip{\smoothraggedrightragwidth}
6631 % \indent Value for the width of the ragged right margin.
6632 %
6633 % \begin{synopsis}\label{syn:smoothraggedrightragwidth}
6634 % \cs{smoothraggedrightragwidth}=\meta{dim}
6635 % \end{synopsis}
6636 %
6637 % Default:~2\,em.\!\footnote{This is also the default rag width of \packagename{ragged2e's}
6638 % \cs{RaggedRight}~\cite{package:ragged2e}.}
6639 %
6640 % \begin{usecases}
6641 % Replacement for \cs{RaggedRight}~\cite{package:ragged2e}.\visualpar A design alternative to
6642 % fully justified paragraphs when used with a small rag~width.
6643 % \end{usecases}
6644 %
6645 % \begin{futuredirection}
6646 % Translate the code to \packagename{l3galley} which is part of the
6647 % \packagename{l3experimental}~package~\cite{package:l3experimental}. Galley~code is
6648 % supposed to work inside of lists, too.
6649 % \end{futuredirection}
6650 %
6651 %
6652 % \paragraph{Sample Smooth-Ragged-Right Paragraph at Full Text-Width}\leavevmode\par
6653 %
6654 % \begin{samepage}
6655 % \def\smoothraggedrightgenerator{quintuplet}
6656 % \setlength{\smoothraggedrightragwidth}{7pt}
6657 % \begin{nocharprotrusion}\fussy
6658 % \begin{smoothraggedright}
6659 % Throughout this manual, we have demonstrated how \code{smoothraggedright} environments
6660 % work for very narrow columns\spacedemdash namely, inside the document's margins: all
6661 % marginal notes were typeset with \code{smoothraggedright} environments (quintuplet
6662 % generator, 1.5\,em rag~width, at footnote~size in addition to using
6663 % environments~\hyperref[syn:slightlysloppy]{\code{slightlysloppy}} and
6664 % \hyperref[syn:loosespacing]{\code{loosespacing}}). In this paragraph, we utilize it
6665 % with the \smoothraggedrightgenerator~generator and a rag~width of only
6666 % \formatdimen*{\smoothraggedrightragwidth} in the body that is
6667 % \formatdimen{\linewidth}~wide and averages around twelve words per line. There is much
6668 % more glue to adapt to the line ends, and thus the desired rag is achieved more easily.
6669 % The sloppiness is minimal; that is, \cs{fussy} is in effect, and character protrusion
6670 % into the margins is disabled. A limitation of the current implementation is that it is
6671 % ineffective inside of lists. Therefore, this paragraph has not been wrapped inside of
6672 % an \singlequotes{Example} because all of our examples are implemented as lists.
6673 % \end{smoothraggedright}
6674 % \end{nocharprotrusion}
6675 % \end{samepage}
6676 %
6677 %
6678 % \sectionfinish
6679 % \clearpage
6680 % \section{Limitations and Known Problems}\label{sec:limitations}
6681 %
6682 % \index{limitations|userman}
6683 % \index{known problems|userman}
6684 % Here is a list of some known problems with \packagename{typog}.
6685 %
6686 % \begin{description}
6687 % \item[Interference with the package \packagename{pdfcomment}~\cite{package:pdfcomment}.]
6688 % To ensure compatibility, \packagename{typog} \emph{disables} the default string
6689 % substitution inside \acronym{PDF}~bookmarks for the following macros (including their
6690 % starred variants) if \emph{both} packages are loaded.
6691 %
6692 % \setlength{\columnsep}{25pt}
6693 % \begin{multicols}{2}
6694 % \newcommand*{\synpageref}[1]{\leavevmode
6695 % \unskip
6696 % \penalty9999\hbox{}\nobreak
6697 % \hfill\quad
6698 % \mbox{\footnotesize\textbf{\pageref{#1}}}}
6699 % \begin{itemize}[label={}, leftmargin=0pt, nosep]
6700 % \item \cs{Adjustedlabelitemi}\synpageref{syn:Adjustedlabelitem}
6701 % \item \cs{Adjustedlabelitemii}\synpageref{syn:Adjustedlabelitem}
6702 % \item \cs{Adjustedlabelitemiii}\synpageref{syn:Adjustedlabelitem}
6703 % \item \cs{Adjustedlabelitemiv}\synpageref{syn:Adjustedlabelitem}
6704 % \item \cs{adjustedlabelitemi}\synpageref{syn:adjustedlabelitem}
6705 % \item \cs{adjustedlabelitemii}\synpageref{syn:adjustedlabelitem}
6706 % \item \cs{adjustedlabelitemiii}\synpageref{syn:adjustedlabelitem}
6707 % \item \cs{adjustedlabelitemiv}\synpageref{syn:adjustedlabelitem}
6708 % \item \cs{breakpoint}\synpageref{syn:breakpoint}
6709 % \item \cs{capitalemdash}\synpageref{syn:capitalemdash}
6710 % \item \cs{capitalendash}\synpageref{syn:capitalendash}
6711 % \item \cs{capitalhyphen}\synpageref{syn:capitalhyphen}
6712 % \item \cs{capitaltimes}\synpageref{syn:capitaltimes}
6713 % \item \cs{Doubleguillemetleft}\synpageref{syn:Doubleguillemetleft}
6714 % \item \cs{Doubleguillemetright}\synpageref{syn:Doubleguillemetright}
6715 % \item \cs{doubleguillemetleft}\synpageref{syn:doubleguillemetleft}
6716 % \item \cs{doubleguillemetright}\synpageref{syn:doubleguillemetright}
6717 % \item \cs{figuredash}\synpageref{syn:figuredash}
6718 % \item \cs{itcorr}\synpageref{syn:itcorr}
6719 % \item \cs{kernedhyphen}\synpageref{syn:kernedhyphen}
6720 % \item \cs{kernedslash}\synpageref{syn:kernedslash}
6721 % \item \cs{leftkernedhyphen}\synpageref{syn:leftkernedhyphen}
6722 % \item \cs{leftspacedemdash}\synpageref{syn:spacedemdash}
6723 % \item \cs{leftspacedendash}\synpageref{syn:spacedendash}
6724 % \item \cs{nolig}\synpageref{syn:nolig}
6725 % \item \cs{rightkernedhyphen}\synpageref{syn:rightkernedhyphen}
6726 % \item \cs{rightspacedemdash}\synpageref{syn:spacedemdash}
6727 % \item \cs{rightspacedendash}\synpageref{syn:spacedendash}
6728 % \item \cs{Singleguillemetleft}\synpageref{syn:Singleguillemetleft}
6729 % \item \cs{Singleguillemetright}\synpageref{syn:Singleguillemetright}
6730 % \item \cs{singleguillemetleft}\synpageref{syn:singleguillemetleft}
6731 % \item \cs{singleguillemetright}\synpageref{syn:singleguillemetright}
6732 % \item \cs{spacedcapitalemdash}\synpageref{syn:spacedcapitalemdash}
6733 % \item \cs{spacedcapitalendash}\synpageref{syn:spacedcapitalendash}
6734 % \item \cs{spaceddash}\synpageref{syn:spacedendash}
6735 % \item \cs{spacedemdash}\synpageref{syn:spacedemdash}
6736 % \item \cs{spacedendash}\synpageref{syn:spacedendash}
6737 % \end{itemize}
6738 % \end{multicols}
6739 %
6740 % Use \cs{texorpdfstring}\spacedendash\marginnote{The sentence uses \cs{spaced\-endash}es.}
6741 % which is part of the package~\packagename{hyperref}~\cite{package:hyperref}\spacedendash in
6742 % the relevant sectioning macros to restore string substitution on a case-by-case basis.
6743 %
6744 % \begin{example}
6745 % \begin{codeexample}
6746 % \cs{section}\{\=\cs{(}CP\cs{)}\cs{texorpdfstring}\{\cs{capitalhyphen}\}\{-\}\% \\
6747 % \>Invariance\}
6748 % \end{codeexample}
6749 % \end{example}
6750 % \end{description}
6751 %
6752 %
6753 % \sectionfinish
6754 % \clearpage
6755 % \section{Other Packages for Fine \LaTeX~Typography}\label{sec:other-typography-packages}
6756 %
6757 % Many other packages help produce better output from \LaTeX. Here is a list\spacedemdash in
6758 % alphabetical order\spacedemdash of the ones the author considers particularly valuable.
6759 %
6760 % \sbox{\listlabelbox}{\packagename{enumitem}}
6761 % \begin{description}[font=\normalfont, labelsep*=1em, labelwidth=\wd\listlabelbox, leftmargin=!]
6762 % \item[\packagename{enumitem}]
6763 % Flexible and consistent definition of all basic \LaTeX{} list types, including inline
6764 % lists~\cite{package:enumitem}.
6765 %
6766 % \item[\packagename{geometry}]
6767 % Powerful and sophisticated configuration of page layout~\cite{package:geometry}. Best used
6768 % together with \packagename{layout}~\cite{package:layout} to visualize the page geometries.
6769 %
6770 % \item[\packagename{hyphenat}]
6771 % Provides hyphens that do not inhibit further auto-hyphenation of compound
6772 % words~\cite{package:hyphenat}.
6773 %
6774 % Also see \Cref{sec:latex-hyphenation} (pp.~\pageref{sec:latex-hyphenation}\figuredash
6775 % \pageref{secend:latex-hyphenation}) for this package's macros and environments that are
6776 % related to hyphenation.
6777 %
6778 % \item[\packagename{microtype}]
6779 % Fine control of spacing, tracking, sidebearings, character protrusion into the margins,
6780 % font expansion, and more~\cite{package:microtype}.
6781 %
6782 % See \Cref{sec:microtype-frontend} (pp.~\pageref{sec:microtype-frontend}\figuredash
6783 % \pageref{secend:microtype-frontend}) for a front end to \packagename{microtype} provided by
6784 % this package and also the discussion in reference~\citenum{khirevich:2013}.
6785 %
6786 % \item[\packagename{ragged2e}]
6787 % Improved versions of the \code{raggedleft}, \code{raggedright}, and \code{center}
6788 % environments~\cite{package:ragged2e}.
6789 %
6790 % \item[\packagename{setspace}]
6791 % Consistently sets the line spacing of a document (i.\,e., controls
6792 % \cs{baselineskip})~\cite{package:setspace}.
6793 %
6794 % See \Cref{sec:setspace-frontend} (pp.~\pageref{sec:setspace-frontend}\figuredash
6795 % \pageref{secend:setspace-frontend}) for a front end to \packagename{setspace} provided by
6796 % this package.
6797 % \end{description}
6798 %
6799 %
6800 % \sectionfinish
6801 % \appendix
6802 % \clearpage
6803 % \section{typog-grep}
6804 % \label{app:typog-grep}
6805 %
6806 % The companion program \programname{typog-grep} for analyzing the output of
6807 % \hyperref[syn:typoginspect]{\code{typoginspect}} and
6808 % \hyperref[syn:typoginspect]{\code{typoginspectpar}} has its own manual page. We reproduce it
6809 % here for completeness of the documentation.
6810 %
6811 % \addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
6812 % \begin{suspendshortverb}
6813 % \setlength{\parindent}{0pt}
6814 % \setlength{\parskip}{6.0pt plus 2.0pt minus .5pt}
6815 % \input{typog-grep.tex}
6816 % \end{suspendshortverb}
6817 % \addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
6818 %
6819 %
6820 % \sectionfinish
6821 % \clearpage
6822 % \section{\eTeX: Breaking Paragraphs into Lines}
6823 % \label{app:epsilon-tex-lastlinefit}
6824 %
6825 % \index{lastlinefit=\verb!*+\lastlinefit+|userman}
6826 % \index{lastlinefitpar={\ttfamily lastlinefitpar} (env.)|userman}
6827 % This is an excerpt from the \eTeX{} manual~\cite{package:etex}, Sec.~3.8,
6828 % \doublequotes{Breaking Paragraphs into Lines} that describes the \cs{lastlinefit}~algorithm.
6829 % Package~\packagename{typog} warps \cs{lastlinefit} in
6830 % environment~\hyperref[syn:lastlinefitpar]{\code{lastlinefitpar}}, which was introduced in
6831 % \cref{sec:consistent-spacing-of-last-line} on \cpageref{sec:consistent-spacing-of-last-line}.
6832 %
6833 % \begin{quotation}
6834 % \begin{covernextindentpar}
6835 % \noindent
6836 % Traditional typesetting with lead type used to adjust (stretch or shrink) the interword
6837 % spaces in the last line of a paragraph by the same amount as those in the preceding line.
6838 % With \TeX{} the last line is, however, usually typeset at its natural width due to
6839 % infinitely stretchable \cs{parfillskip} glue. \eTeX{} allows interpolation between these
6840 % two extremes by specifying a suitable value for \cs{lastlinefit}.\shiftedmarginnote{This
6841 % paragraph benefits from being enclosed in a \code{cover\-next\-indent\-par} environment.}
6842 % For a value of~0 or less, \eTeX{} behaves as \TeX, values from~1 to 1000 indicate a glue
6843 % adjustment fraction~\(f\) times 1000, values above 1000 are interpreted as \mbox{\(f =
6844 % 1\)}.
6845 % \end{covernextindentpar}
6846 %
6847 % The new algorithm is used only if
6848 %
6849 % \begin{tabfigures}
6850 % \begin{enumerate}[nosep]
6851 % \item \cs{lastlinefit} is positive;
6852 % \item \cs{parfillskip} has infinite stretchability; and
6853 % \item the stretchability of \cs{leftskip} plus \cs{rightskip} is finite.\!\footnote{As
6854 % usual for parameters influencing \TeX's line-breaking algorithm, the values current
6855 % at the end of the (partial) paragraph are used.}
6856 % \end{enumerate}
6857 % \end{tabfigures}
6858 %
6859 % \noindent
6860 % Thus the last line of a paragraph would normally be typeset at its natural width and the
6861 % stretchability of \cs{parfillskip} glue would be used to achieve the desired line width.
6862 % The algorithm proceeds as usual, considering all possible sequences of feasible break
6863 % points and accumulating demerits for the stretching or shrinking of lines as well as for
6864 % visually incompatible lines. When a candidate for the last line has been reached, the
6865 % following conditions are tested:
6866 %
6867 % \begin{tabfigures}
6868 % \begin{enumerate}[nosep, resume]
6869 % \item the previous line was not \doublequotes{infinitely bad} and was stretched with
6870 % positive finite stretchability or was shrunk with positive shrinkability;
6871 % \item the last line has infinite stretchability entirely due to \cs{par\-fill\-skip} glue;
6872 % \item if the previous line was stretched or shrunk the last line has positive finite
6873 % stretchability or shrinkability.
6874 % \end{enumerate}
6875 % \end{tabfigures}
6876 %
6877 % \noindent
6878 % If all three conditions are satisfied, a glue adjustment factor of \(f\)~times that of the
6879 % preceding line will be applied to the relevant stretch or shrink components of all glue
6880 % nodes in the last line, and the corresponding demerits are computed. (The last line will,
6881 % however, not be stretched beyond the desired line width.)
6882 %
6883 % When all possible candidates for the last line of the paragraph have been examined, the one
6884 % having fewest accumulated demerits is chosen. If \eTeX's modified algorithm was applied to
6885 % that last line, the actual stretching or shrinking is achieved by suitably modifying the
6886 % \cs{parfillskip} glue node.
6887 %
6888 % All computations described so far are performed with machine\hyp{}independent integer
6889 % arithmetic. Note, however, that the actual stretching requires machine\hyp{}dependent
6890 % floating point arithmetic. Therefore, when a paragraph is interrupted by a displayed
6891 % equation and the line preceding the display is subject to the adjustment just described,
6892 % the display will in general be preceded by \cs{abovedisplayskip} and not by
6893 % \cs{abovedisplayshortskip} glue.
6894 % \end{quotation}
6895 %
6896 % \noindent
6897 % Section~3.8 of the \eTeX{} manual closes with a description of the generalizations of
6898 % \cs{clubpenalties}, \cs{displaywidowpenalties}, \cs{interlinepenalties}, and
6899 % \cs{widowpenalties}. See also \cref{sec:vtie-paragraph}, \doublequotes{Vertically
6900 % Partially-Tied Paragraphs}, \cpageref{sec:vtie-paragraph} in this manual.
6901 %
6902 %
6903 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6904 %
6905 %
6906 % \newcommand*{\codeidx}[1]{\linenumberdecoration\textbf{#1}}
6907 % \renewcommand*{\main}[1]{\linenumberdecoration\textit{\textbf{#1}}}
6908 % \renewcommand*{\usage}[1]{\textit{\textbf{#1}}}
6909 %
6910 % \MaybeStop{
6911 % \sectionfinish
6912 % \clearpage
6913 % \begingroup
6914 % \setcounter{GlossaryColumns}{1}
6915 % \phantomsection
6916 % \label{sec:changes}
6917 % \resetfancyhead
6918 % \addtocontents{toc}{\bigskip}
6919 % \addcontentsline{toc}{section}{\protect\numberline{}Change History}
6920 % \GlossaryPrologue{\section*{Change History}
6921 % \markboth{\sf\letterspacedsmallcaps{Change History}}{\sf\letterspacedsmallcaps{Change History}}}
6922 % \PrintChanges
6923 % \endgroup
6924 %
6925 %
6926 % \sectionfinish
6927 % \clearpage
6928 % \phantomsection
6929 % \addtocontents{toc}{\medskip}
6930 % \addcontentsline{toc}{section}{\protect\numberline{}References}
6931 % \begin{mybibliography}
6932 % \bibitem{abrahams:2020}
6933 % \bibauthor{Abrahams, Paul~W.},
6934 % \bibauthor{Kathryn A.~Hargreaves,} and
6935 % \bibauthor{Karl Berry}.
6936 % \bibtitle{\TeX{} for the Impatient}.
6937 % 2020,
6938 % \biburl{https://tug.ctan.org/info/impatient/book.pdf}.
6939 %
6940 % \bibitem{package:amsmath}
6941 % \bibauthor{American Mathematical Society} and the
6942 % \bibauthor{\LaTeXIII\ Project Team}.
6943 % \bibtitle{Package~\packagename{amsmath}}.
6944 % 2020,
6945 % \biburl{https://ctan.org/pkg/amsmath}.
6946 %
6947 % \bibitem{package:cite}
6948 % \bibauthor{Arseneau, Donald}.
6949 % \bibtitle{Package~\packagename{cite}}.
6950 % 2015,
6951 % \biburl{https://ctan.org/pkg/cite}.
6952 %
6953 % \bibitem{chicago-manual-of-style:2017}
6954 % \bibtitle{The Chicago Manual of Style},
6955 % 17\textsuperior{th}~ed.\widespace
6956 % The University of Chicago Press, Chicago\kernedslash IL,
6957 % 2017.
6958 %
6959 % \bibitem{package:enumitem}
6960 % \bibauthor{Bezos, Javier}.
6961 % \bibtitle{Package~\packagename{enumitem}}.
6962 % 2019,
6963 % \biburl{https://ctan.org/pkg/enumitem}.
6964 %
6965 % \bibitem{package:babel}
6966 % \bibauthor{Bezos, Javier}.
6967 % \bibtitle{Package~\packagename{babel}}.
6968 % 2021,
6969 % \biburl{https://ctan.org/pkg/babel}.
6970 % The original author of package~\packagename{babel} was \bibauthor{J. L. Braams}.
6971 %
6972 % \bibitem{package:etex}
6973 % \bibauthor{Breitenlohner, Peter} and
6974 % the \bibauthor{\(\mathcal{N\kern-.1em\raisebox{-.2em}{T}\kern-.1emS}\)~Team}.
6975 % \bibtitle{\eTeX}.
6976 % 1998,
6977 % \biburl{https://mirrors.ctan.org/systems/doc/etex/etex_man.pdf}.
6978 %
6979 % \bibitem{package:mathastext}
6980 % \bibauthor{Burnol, Jean-François}.
6981 % \bibtitle{Package~\packagename{mathastext}}.
6982 % 2023,
6983 % \biburl{https://ctan.org/pkg/mathastext}.
6984 %
6985 % \bibitem{carlisle:1996}
6986 % \bibauthor{Carlisle, David}.
6987 % \bibtitle{Russian Paragraph Shapes}.
6988 % Baskerville, 6(1), 13\figuredash15,
6989 % 1996,
6990 % \biburl{http://uk-tug-archive.tug.org/wp-installed-content/uploads/2008/12/61.pdf}.
6991 %
6992 % \bibitem{carlisle:2013}
6993 % \bibauthor{Carlisle, David}.
6994 % \bibtitle{What do different \cs{fontdimen<num>} mean}.
6995 % 2013\figuredash*1\figuredash*2,
6996 % \biburl{https://tex.stackexchange.com/questions/88991/what-do-different-fontdimennum-mean}.
6997 %
6998 % \bibitem{package:cleveref}
6999 % \bibauthor{Cubitt, Toby}.
7000 % \bibtitle{Package~\packagename{cleveref}}.
7001 % 2018,
7002 % \biburl{https://ctan.org/pkg/cleveref}.
7003 %
7004 % \bibitem{eijkhout:2007}
7005 % \bibauthor{Eijkhout, Victor}.
7006 % \bibtitle{\TeX\ By Topic, A Texnician's Reference}.
7007 % 2007,
7008 % \biburl{https://www.eijkhout.net/tex/tex-by-topic.html}.
7009 %
7010 % \bibitem{forssman-de-jong:2008}
7011 % \bibauthor{Forssman, Friedrich,} and \bibauthor{Ralf de Jong}.
7012 % \bibtitle{Detailtypographie}.
7013 % 4.~Aufl.\widespace
7014 % Verlag Hermann Schmitz, Mainz,
7015 % 2008.
7016 %
7017 % \bibitem{package:mathtools}
7018 % \bibauthor{H{\o}gholm, Morten},
7019 % \bibauthor{Lars Madsen,} and
7020 % the \bibauthor{\LaTeXIII\ Project Team}.
7021 % \bibtitle{Package~\packagename{mathtools}}.
7022 % 2020,
7023 % \biburl{https://ctan.org/pkg/mathtools}.
7024 %
7025 % \bibitem{khirevich:2013}
7026 % \bibauthor{Khirevich, Siarhei}.
7027 % \bibtitle{Tips on Writing a Thesis in \LaTeX}.
7028 % 2013,
7029 % \biburl{https://www.khirevich.com/latex/microtype}.
7030 %
7031 % \bibitem{package:pdfcomment}
7032 % \bibauthor{Kleber, Josef}.
7033 % \bibtitle{Package~\packagename{pdfcomment}}.
7034 % 2018,
7035 % \biburl{https://ctan.org/pkg/pdfcomment}.
7036 %
7037 % \bibitem{knuth:1986}
7038 % \bibauthor{Knuth, Donald Ervin}.
7039 % \bibtitle{The \TeX{}book}.
7040 % Addison Wesley, Reading\kernedslash MA,
7041 % 1986.
7042 %
7043 % \bibitem{package:l3experimental}
7044 % \bibauthor{The \LaTeX\ Project}.
7045 % \bibtitle{Package~\packagename{l3experimental}}.
7046 % 2024,
7047 % \biburl{https://ctan.org/pkg/l3experimental}.
7048 %
7049 % \bibitem{package:layout}
7050 % \bibauthor{McPherson, Kent}.
7051 % \bibtitle{Package~\packagename{layout}}.
7052 % 2014,
7053 % \biburl{https://ctan.org/pkg/layout}.
7054 % The package was converted to \LaTeXe\ by \bibauthor{J. L. Braams}
7055 % and modified by \bibauthor{H. Umeki}.
7056 %
7057 % \bibitem{middendorp:2014}
7058 % \bibauthor{Middendorp, Jan}.
7059 % \bibtitle{Shaping Text}.
7060 % \acronym{BIS}~publishers, Amsterdam,
7061 % 2014.
7062 %
7063 % \bibitem{mittelbach:2018c}
7064 % \bibauthor{Mittelbach, Frank}.
7065 % \bibtitle{Managing forlorn paragraph lines (a.\,k.\,a.~widows and orphans) in \LaTeX}.
7066 % TUGboat, 39(3), 246\figuredash251, 2018,
7067 % \biburl{https://tug.org/TUGboat/tb39-3/tb123mitt-widows.pdf}.
7068 %
7069 % \bibitem{package:widows-and-orphans}
7070 % \bibauthor{Mittelbach, Frank}.
7071 % \bibtitle{Package~\packagename{widows-and-orphans}}.
7072 % 2020,
7073 % \biburl{https://ctan.org/pkg/widows-and-orphans}.
7074 %
7075 % \bibitem{package:tasks}
7076 % \bibauthor{Niederberger, Clemens}.
7077 % \bibtitle{Package~\packagename{tasks}}.
7078 % 2022,
7079 % \biburl{https://github.com/cgnieder/tasks}.
7080 %
7081 % \bibitem{package:hyperref}
7082 % \bibauthor{Rahtz, Sebastian,} and \bibauthor{Frank Mittelbach}.
7083 % \bibtitle{Package~\packagename{hyperref}}.
7084 % 2020,
7085 % \biburl{https://ctan.org/pkg/hyperref}.
7086 % The package is maintained by the \LaTeXIII~Project Team.
7087 %
7088 % \bibitem{package:microtype}
7089 % \bibauthor{Schlicht, Robert}.
7090 % \bibtitle{Package~\packagename{microtype}}.
7091 % 2020,
7092 % \biburl{https://ctan.org/pkg/microtype}.
7093 %
7094 % \bibitem{package:ragged2e}
7095 % \bibauthor{Schröder, Martin}.
7096 % \bibtitle{Package~\packagename{ragged2e}}.
7097 % 2019,
7098 % \biburl{https://ctan.org/pkg/ragged2e}.
7099 %
7100 % \bibitem{solomon:1990}
7101 % \bibauthor{Solomon, David}.
7102 % \bibtitle{Output Routines: Examples and Techniques. Part~I: Introduction and Examples}.
7103 % TUGboat, 11(1), 69\figuredash85, 1990,
7104 % \biburl{https://www.tug.org/TUGboat/Articles/tb11-1/tb27salomon.pdf}.
7105 %
7106 % \bibitem{strizver:2014}
7107 % \bibauthor{Strizver, Ilene}.
7108 % \bibtitle{Type rules!: the designer's guide to professional typography},
7109 % 4\textsuperior{th}~ed.\widespace
7110 % John Wiley~\textit{\&} Sons, Hoboken\kernedslash NJ,
7111 % 2014.
7112 %
7113 % \bibitem{package:setspace}
7114 % \bibauthor{Tobin, Geoffrey,} and \bibauthor{Robin Fairbairns}.
7115 % \bibtitle{Package~\packagename{setspace}}.
7116 % 2011,
7117 % \biburl{https://ctan.org/pkg/setspace}.
7118 %
7119 % \bibitem{package:geometry}
7120 % \bibauthor{Umeki, Hideo}.
7121 % \bibtitle{Package~\packagename{geometry}}.
7122 % 2020,
7123 % \biburl{https://ctan.org/pkg/geometry}.
7124 %
7125 % \bibitem{wermuth:2016}
7126 % \bibauthor{Wermuth, Udo}.
7127 % \bibtitle{Tracing paragraphs}.
7128 % TUGboat, 37(3), 358\figuredash373, 2016,
7129 % \biburl{https://tug.org/TUGboat/tb37-3/tb117wermuth.pdf}.
7130 %
7131 % \bibitem{wermuth:2017a}
7132 % \bibauthor{Wermuth, Udo}.
7133 % \bibtitle{The optimal value for \cs{emergencystretch}}.
7134 % TUGboat, 38(1), 65\figuredash86, 2017,
7135 % \biburl{https://tug.org/TUGboat/tb38-1/tb118wermuth.pdf}.
7136 %
7137 % \bibitem{wermuth:2017c}
7138 % \bibauthor{Wermuth, Udo}.
7139 % \bibtitle{A note on \cs{linepenalty}}.
7140 % TUGboat, 38(3), 400\figuredash414, 2017,
7141 % \biburl{https://tug.org/TUGboat/tb38-3/tb120wermuth.pdf}.
7142 %
7143 % \bibitem{wermuth:2018}
7144 % \bibauthor{Wermuth, Udo}.
7145 % \bibtitle{Experiments with \cs{parfillskip}}.
7146 % TUGboat, 39(3), 276\figuredash303, 2018,
7147 % \biburl{https://tug.org/TUGboat/tb39-3/tb123wermuth-parfillskip.pdf}.
7148 %
7149 % \bibitem{wermuth:2020}
7150 % \bibauthor{Wermuth, Udo}.
7151 % \bibtitle{An attempt at ragged-right typesetting}.
7152 % TUGboat, 41(1), 73\figuredash94, 2020,
7153 % \biburl{https://tug.org/TUGboat/tb41-1/tb127wermuth-ragged.pdf}.
7154 %
7155 % \bibitem{wermuth:2022-8-2}
7156 % \bibauthor{Wermuth, Udo}.
7157 % Personal communication.
7158 % August~2, 2022.
7159 %
7160 % \bibitem{wermuth:2023}
7161 % \bibauthor{Wermuth, Udo}.
7162 % \bibtitle{Vertical alignments in plain \TeX}.
7163 % TUGboat, 44(3), 427\figuredash440, 2023,
7164 % \biburl{https://tug.org/TUGboat/tb44-3/tb138wermuth-valign.pdf}.
7165 %
7166 % \bibitem{package:hyphenat}
7167 % \bibauthor{Wilson, Peter}.
7168 % \bibtitle{Package~\packagename{hyphenat}}.
7169 % 2004,
7170 % \biburl{https://ctan.org/pkg/hyphenat}.
7171 % The package is maintained by \bibauthor{W. Robertson}.
7172 %
7173 % \bibitem{wilson:2007}
7174 % \bibauthor{Wilson, Peter}.
7175 % \bibtitle{Glisterings}.
7176 % TUGboat, 28(2), 229\figuredash232, 2007,
7177 % \biburl{https://tug.org/TUGboat/tb28-2/tb89glister.pdf}.
7178 %
7179 % \bibitem{package:needspace}
7180 % \bibauthor{Wilson, Peter}.
7181 % \bibtitle{Package~\packagename{needspace}}.
7182 % 2010,
7183 % \biburl{https://ctan.org/pkg/needspace}.
7184 % The package is maintained by \bibauthor{W. Robertson}.
7185 % \end{mybibliography}
7186 %
7187 %
7188 % \sectionfinish
7189 % \clearpage
7190 % \begingroup
7191 % \setcounter{IndexColumns}{2}
7192 % \setlength{\columnsep}{30pt}
7193 % \phantomsection
7194 % \label{sec:index}
7195 % \addtocontents{toc}{\medskip}
7196 % \addcontentsline{toc}{section}{\protect\numberline{}Index}
7197 % \raggedcolumns
7198 % \PrintIndex
7199 % \phantomsection
7200 % \label{secend:index}
7201 % \endgroup
7202 % }
7203 %
7204 %
7205 % \sectionfinish
7206 % \toccontinuesonnextpage
7207 % \clearpage
7208 % \section{Package Code}\label{sec:package-code}
7209 % \addtocontents{toc}{\protect\begin{list}{}{\leftmargin=\subsectiontocindent\parsep=0pt}}
7210 % \addtocontents{toc}{\protect\item}
7211 % \addtocontents{toc}{\RaggedRight}
7212 % \addtocontents{toc}{\small}
7213 % \addtocontents{toc}{\tocsquashedsubsections}
7214 % \addtocontents{toc}{\protect\begin{multicols}{2}}
7215 % \addtocontents{toc}{\protect\raggedcolumns}
7216 % \index{package code|(userman}
7217 % \index{code reference|(userman}
7218 %
7219 % This is the \doublequotes{Reference Manual}~section of the documentation
7220 % where we describe the package's code
7221 % and explain its implementation details.
7222 %
7223 %
7224 % \begin{macrocode}
7225 %<*package>
7226 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
7227 \ProvidesPackage{typog}
7228 [2025/10/27 v0.5 TypoGraphic extensions]
7229
7230 \RequirePackage{etoolbox}
7231 \RequirePackage{everyhook}
7232 \RequirePackage{xkeyval}
7233
7234 % \end{macrocode}
7235 %
7236 % \bigskip
7237 %
7238 % \subsection*{Declarations of Lengths, Skips, etc.}
7239 %
7240 % \begin{macro}{\typog@TYPOG}
7241 % Define a macro that unequivocally identifies this very package.
7242 %
7243 % \begin{macrocode}
7244 \newcommand*{\typog@TYPOG}{}
7245 % \end{macrocode}
7246 % \end{macro}
7247 %
7248 % \begin{macro}{\typoglogo}
7249 % We have our own, low-key logo.
7250 %
7251 % \changes{v0.5}{2025-05-26}{Make macro independent of typog setup.}
7252 % \begin{macrocode}
7253 \newcommand*{\typoglogo}{\textsf{T\kern-.12em\textsl{y}poG}}
7254 % \end{macrocode}
7255 % \end{macro}
7256 %
7257 % \begin{macro}{\iftypog@debug}
7258 % Our switch for debug information.
7259 %
7260 % \begin{macrocode}
7261 \newif\iftypog@debug
7262 % \end{macrocode}
7263 % \end{macro}
7264 %
7265 % \begin{macro}{\typog@typeout}
7266 % Our information printer.
7267 % Just adds a prefix so that we can tease apart the \filesystem{log} later.
7268 %
7269 % \begin{macrocode}
7270 \newcommand*{\typog@typeout}[1]{\typeout{typog: #1}}
7271
7272 % \end{macrocode}
7273 % \end{macro}
7274 %
7275 % \begin{macro}{\typog@typeout}
7276 % Our debug information printer.
7277 %
7278 % \begin{macrocode}
7279 \newcommand*{\typog@debug@typeout}[1]
7280 {\iftypog@debug\typog@typeout{#1}\fi}
7281
7282 % \end{macrocode}
7283 % \end{macro}
7284 %
7285 % \begin{tcounter}{typog@@iteration}
7286 % We want our own counter (currently for keeping track of iterations) that does not get
7287 % trampled underfoot too easily.
7288 %
7289 % \begin{macrocode}
7290 \newcounter{typog@@iteration}
7291
7292 % \end{macrocode}
7293 % \end{tcounter}
7294 %
7295 % \begin{macro}{\typog@trim@spaces}
7296 % Pull \cs{tl\_trim\_spaces} into the \singlequotes{classic} namespace.
7297 %
7298 % \begin{macrocode}
7299 \ExplSyntaxOn
7300 \let\typog@trim@spaces=\tl_trim_spaces:o
7301 \ExplSyntaxOff
7302
7303 % \end{macrocode}
7304 % \end{macro}
7305 %
7306 % \begin{macro}{\typog@register@pdfsubstitute}
7307 % \changes{v0.4a}{2024-08-11}
7308 % {Using \cs{pdf\-stringdef\-Disable\-Commands} breaks package~\packagename{pdf\-comment}.
7309 % So we just refrain from using the macro if \packagename{pdf\-comment} was loaded.}
7310 % We often need to register (simple) substitute commands
7311 % suitable for \acronym{PDF}~bookmarks.
7312 % This is a convenient abbreviation for that task.
7313 %
7314 % \begin{macrocode}
7315 \newcommand{\typog@register@pdfsubstitute}[1]{%
7316 \AtBeginDocument{%
7317 \ifdefined\pdfstringdefDisableCommands
7318 \@ifpackageloaded{pdfcomment}
7319 {\PackageWarningNoLine{typog}
7320 {package pdfcomment loaded --\space
7321 typog will not touch PDF interface}}
7322 {\pdfstringdefDisableCommands{#1}}%
7323 \fi}}
7324
7325 % \end{macrocode}
7326 % \end{macro}
7327 %
7328 % Some functionality depends on package~\packagename{microtype}.
7329 % To complicate matters for certain setup operations, e.\,g., \cs{SetExpansion},
7330 % \packagename{microtype} must be loaded \emph{before} package~\packagename{typog},
7331 % a fact that we encode in \cs{iftypog@microtype@preloaded}.
7332 %
7333 % \begin{macro}{\iftypog@microtype@preloaded}
7334 % \begin{macrocode}
7335 \newif\iftypog@microtype@preloaded
7336
7337 % \end{macrocode}
7338 % \end{macro}
7339 %
7340 % \begin{macro}{\typog@require@preloaded@microtype}
7341 % It is easy to determine whether \packagename{microtype} has been sourced.
7342 % We raise to the occasion and define a pair of check macros
7343 % which simplify the test for the correct \packagename{microtype} load~state.
7344 %
7345 % \begin{macrocode}
7346 \ifdefined\MT@MT
7347 \typog@typeout{package microtype preloaded}%
7348 \typog@microtype@preloadedtrue
7349 \def\typog@require@preloaded@microtype{\relax}
7350 \else
7351 \typog@microtype@preloadedfalse
7352 \def\typog@require@preloaded@microtype
7353 {\PackageError{typog}%
7354 {package microtype not (pre-)loaded}%
7355 {package microtype must be loaded before package typog}}
7356 \fi
7357
7358 % \end{macrocode}
7359 % \end{macro}
7360 %
7361 % \begin{macro}{\iftypog@microtype@loaded}
7362 % \begin{macrocode}
7363 \newif\iftypog@microtype@loaded
7364
7365 % \end{macrocode}
7366 % \end{macro}
7367 %
7368 % \begin{macro}{\typog@require@microtype}
7369 % This code duplicates \cs{typog@require@preloaded@microtype};
7370 % the only difference is that we call the test \emph{after} the preamble was processed.
7371 %
7372 % \begin{macrocode}
7373 \AtBeginDocument{
7374 \ifdefined\MT@MT
7375 \typog@typeout{package microtype loaded}%
7376 \typog@microtype@loadedtrue
7377 \def\typog@require@microtype{\relax}
7378 \else
7379 \typog@microtype@loadedfalse
7380 \def\typog@require@microtype
7381 {\PackageError{typog}%
7382 {package microtype not loaded}%
7383 {require package microtype before package typog}}%
7384 \fi
7385 }
7386
7387 % \end{macrocode}
7388 % \end{macro}
7389 %
7390 % Our own state \dots
7391 %
7392 % \begin{macro}{\typog@config@mathitaliccorrection}
7393 % \begin{macrocode}
7394 \newmuskip\typog@config@mathitaliccorrection
7395
7396 % \end{macrocode}
7397 % \end{macro}
7398 %
7399 % Space around em-dash.
7400 %
7401 % \begin{ldimen}{\typog@config@emdashspace}
7402 % \begin{macrocode}
7403 \newlength{\typog@config@emdashspace}
7404 % \end{macrocode}
7405 % \end{ldimen}
7406 %
7407 % Space around en-dash.
7408 %
7409 % \begin{ldimen}{\typog@config@endashspace}
7410 % \begin{macrocode}
7411 \newlength{\typog@config@endashspace}
7412 % \end{macrocode}
7413 % \end{ldimen}
7414 %
7415 % Actual \cs{labelitem}\meta{N} corrections.
7416 %
7417 % \begin{ldimen}{\typog@adjust@labelitemi}
7418 % \begin{macrocode}
7419 \newdimen{\typog@adjust@labelitemi}
7420 % \end{macrocode}
7421 % \end{ldimen}
7422 %
7423 % \begin{ldimen}{\typog@adjust@labelitemii}
7424 % \begin{macrocode}
7425 \newdimen{\typog@adjust@labelitemii}
7426 % \end{macrocode}
7427 % \end{ldimen}
7428 %
7429 % \begin{ldimen}{\typog@adjust@labelitemiii}
7430 % \begin{macrocode}
7431 \newdimen{\typog@adjust@labelitemiii}
7432 % \end{macrocode}
7433 % \end{ldimen}
7434 %
7435 % \begin{ldimen}{\typog@adjust@labelitemiv}
7436 % \begin{macrocode}
7437 \newdimen{\typog@adjust@labelitemiv}
7438 % \end{macrocode}
7439 % \end{ldimen}
7440 %
7441 % Configuration constants for \cs{labelitem}\meta{N} corrections.
7442 %
7443 % \begin{ldimen}{\typog@adjust@lowercase@labelitemi}
7444 % \begin{macrocode}
7445 \newdimen{\typog@adjust@lowercase@labelitemi}
7446 % \end{macrocode}
7447 % \end{ldimen}
7448 %
7449 % \begin{ldimen}{\typog@adjust@lowercase@labelitemii}
7450 % \begin{macrocode}
7451 \newdimen{\typog@adjust@lowercase@labelitemii}
7452 % \end{macrocode}
7453 % \end{ldimen}
7454 %
7455 % \begin{ldimen}{\typog@adjust@lowercase@labelitemiii}
7456 % \begin{macrocode}
7457 \newdimen{\typog@adjust@lowercase@labelitemiii}
7458 % \end{macrocode}
7459 % \end{ldimen}
7460 %
7461 % \begin{ldimen}{\typog@adjust@lowercase@labelitemiv}
7462 % \begin{macrocode}
7463 \newdimen{\typog@adjust@lowercase@labelitemiv}
7464 % \end{macrocode}
7465 % \end{ldimen}
7466 %
7467 % \begin{ldimen}{\typog@adjust@uppercase@labelitemi}
7468 % \begin{macrocode}
7469 \newdimen{\typog@adjust@uppercase@labelitemi}
7470 % \end{macrocode}
7471 % \end{ldimen}
7472 %
7473 % \begin{ldimen}{\typog@adjust@uppercase@labelitemii}
7474 % \begin{macrocode}
7475 \newdimen{\typog@adjust@uppercase@labelitemii}
7476 % \end{macrocode}
7477 % \end{ldimen}
7478 %
7479 % \begin{ldimen}{\typog@adjust@uppercase@labelitemiii}
7480 % \begin{macrocode}
7481 \newdimen{\typog@adjust@uppercase@labelitemiii}
7482 % \end{macrocode}
7483 % \end{ldimen}
7484 %
7485 % \begin{ldimen}{\typog@adjust@uppercase@labelitemiv}
7486 % \begin{macrocode}
7487 \newdimen{\typog@adjust@uppercase@labelitemiv}
7488
7489 % \end{macrocode}
7490 % \end{ldimen}
7491 %
7492 % Other lengths \dots
7493 %
7494 % \begin{macro}{\typog@config@textitaliccorrection}
7495 % \begin{macrocode}
7496 \newlength{\typog@config@textitaliccorrection}
7497 % \end{macrocode}
7498 % \end{macro}
7499 %
7500 % \begin{macro}{\typog@config@ligaturekern}
7501 % \begin{macrocode}
7502 \newlength{\typog@config@ligaturekern}
7503 % \end{macrocode}
7504 % \end{macro}
7505 %
7506 % \begin{macro}{\typog@config@lowerslash}
7507 % \begin{macrocode}
7508 \newlength{\typog@config@lowerslash}
7509 % \end{macrocode}
7510 % \end{macro}
7511 %
7512 % \begin{macro}{\typog@config@raisecapitaldash}
7513 % \begin{macrocode}
7514 \newlength{\typog@config@raisecapitaldash}
7515 % \end{macrocode}
7516 % \end{macro}
7517 %
7518 % \begin{macro}{\typog@config@raisecapitalguillemets}
7519 % \begin{macrocode}
7520 \newlength{\typog@config@raisecapitalguillemets}
7521 % \end{macrocode}
7522 % \end{macro}
7523 %
7524 % \begin{macro}{\typog@config@raisecapitalhyphen}
7525 % \begin{macrocode}
7526 \newlength{\typog@config@raisecapitalhyphen}
7527 % \end{macrocode}
7528 % \end{macro}
7529 %
7530 % \begin{macro}{\typog@config@raisecapitaltimes}
7531 % \begin{macrocode}
7532 \newlength{\typog@config@raisecapitaltimes}
7533 % \end{macrocode}
7534 % \end{macro}
7535 %
7536 % \begin{macro}{\typog@config@raiseguillemets}
7537 % \begin{macrocode}
7538 \newlength{\typog@config@raiseguillemets}
7539 % \end{macrocode}
7540 % \end{macro}
7541 %
7542 % \begin{macro}{\typog@config@raisefiguredash}
7543 % \begin{macrocode}
7544 \newlength{\typog@config@raisefiguredash}
7545 % \end{macrocode}
7546 % \end{macro}
7547 %
7548 % \begin{macro}{\typog@config@slashkern}
7549 % \begin{macrocode}
7550 \newlength{\typog@config@slashkern}
7551 % \end{macrocode}
7552 % \end{macro}
7553 %
7554 % \begin{macro}{\typog@config@breakpenalty}
7555 % \begin{macrocode}
7556 \newcommand*{\typog@config@breakpenalty}{\exhyphenpenalty}
7557 % \end{macrocode}
7558 % \end{macro}
7559 %
7560 % \begin{macro}{\typog@dim@unit}
7561 % We would like to express the argument values
7562 % for example of \cs{kernedhyphen*} and \cs{kernedhyphen}
7563 % as multiples of a thousandth of an~em.
7564 % Therefore, we define a dimen as \doublequotes{base unit} which simplifies matters greatly.
7565 %
7566 % \begin{macrocode}
7567 \newlength{\typog@dim@unit}
7568 \setlength{\typog@dim@unit}{.001em}
7569 % \end{macrocode}
7570 % \end{macro}
7571 %
7572 % \begin{macro}{\typog@config@trackingttspacing}
7573 % \begin{macrocode}
7574 \newcommand*{\typog@config@trackingttspacing}{300, 90, 60}
7575 % \end{macrocode}
7576 % \end{macro}
7577 %
7578 % \begin{macro}{\typog@default@shrink@i}
7579 % The default configuration for shrink values.
7580 %
7581 % \begin{macrocode}
7582 \newcommand*{\typog@default@shrink@i}{5}
7583 % \end{macrocode}
7584 % \end{macro}
7585 %
7586 % \begin{macro}{\typog@default@shrink@ii}
7587 % \begin{macrocode}
7588 \newcommand*{\typog@default@shrink@ii}{10}
7589 % \end{macrocode}
7590 % \end{macro}
7591 %
7592 % \begin{macro}{\typog@default@shrink@iii}
7593 % \begin{macrocode}
7594 \newcommand*{\typog@default@shrink@iii}{20}
7595 % \end{macrocode}
7596 % \end{macro}
7597 %
7598 % \begin{macro}{\typog@shrink@i}
7599 % Configurable shrink values.
7600 % Initialized from the \code{typog@default@shrink@} set.
7601 %
7602 % \begin{macrocode}
7603 \newcommand*{\typog@shrink@i}{}
7604 % \end{macrocode}
7605 % \end{macro}
7606 %
7607 % \begin{macro}{\typog@shrink@ii}
7608 % \begin{macrocode}
7609 \newcommand*{\typog@shrink@ii}{}
7610 % \end{macrocode}
7611 % \end{macro}
7612 %
7613 % \begin{macro}{\typog@shrink@iii}
7614 % \begin{macrocode}
7615 \newcommand*{\typog@shrink@iii}{}
7616 % \end{macrocode}
7617 % \end{macro}
7618 %
7619 % \begin{macro}{\typog@default@stretch@i}
7620 % The default configuration for stretch values.
7621 %
7622 % \begin{macrocode}
7623 \newcommand*{\typog@default@stretch@i}{5}
7624 % \end{macrocode}
7625 % \end{macro}
7626 %
7627 % \begin{macro}{\typog@default@stretch@ii}
7628 % \begin{macrocode}
7629 \newcommand*{\typog@default@stretch@ii}{10}
7630 % \end{macrocode}
7631 % \end{macro}
7632 %
7633 % \begin{macro}{\typog@default@stretch@iii}
7634 % \begin{macrocode}
7635 \newcommand*{\typog@default@stretch@iii}{20}
7636 % \end{macrocode}
7637 % \end{macro}
7638 %
7639 % \begin{macro}{\typog@stretch@i}
7640 % Configurable stretch values.
7641 % Initialized from the \code{typog@default@stretch} set.
7642 %
7643 % \begin{macrocode}
7644 \newcommand*{\typog@stretch@i}{}
7645 % \end{macrocode}
7646 % \end{macro}
7647 %
7648 % \begin{macro}{\typog@stretch@ii}
7649 % \begin{macrocode}
7650 \newcommand*{\typog@stretch@ii}{}
7651 % \end{macrocode}
7652 % \end{macro}
7653 %
7654 % \begin{macro}{\typog@stretch@iii}
7655 % \begin{macrocode}
7656 \newcommand*{\typog@stretch@iii}{}
7657 % \end{macrocode}
7658 % \end{macro}
7659 %
7660 % \iffalse
7661
7662 \def\typog@one@of@three#1,#2,#3\relax{\typog@trim@spaces{#1}}
7663 \def\typog@two@of@three#1,#2,#3\relax{\typog@trim@spaces{#2}}
7664 \def\typog@three@of@three#1,#2,#3\relax{\typog@trim@spaces{#3}}
7665
7666 \newcommand*{\typog@triple@get@i}[1]{\expandafter\typog@one@of@three #1\relax}
7667 \newcommand*{\typog@triple@get@ii}[1]{\expandafter\typog@two@of@three #1\relax}
7668 \newcommand*{\typog@triple@get@iii}[1]{\expandafter\typog@three@of@three #1\relax}
7669
7670 \newcommand*{\typog@set@shrink@limits}
7671 {\edef\typog@@star{*}%
7672 \edef\typog@@limit{\typog@triple@get@i{\typog@config@shrinklimits}}%
7673 \unless\ifx\typog@@limit\typog@@star\edef\typog@shrink@i{\number\typog@@limit}\fi
7674 \edef\typog@@limit{\typog@triple@get@ii{\typog@config@shrinklimits}}%
7675 \unless\ifx\typog@@limit\typog@@star\edef\typog@shrink@ii{\number\typog@@limit}\fi
7676 \edef\typog@@limit{\typog@triple@get@iii{\typog@config@shrinklimits}}%
7677 \unless\ifx\typog@@limit\typog@@star\edef\typog@shrink@iii{\number\typog@@limit}\fi}
7678
7679 \newcommand*{\typog@set@stretch@limits}
7680 {\edef\typog@@star{*}%
7681 \edef\typog@@limit{\typog@triple@get@i{\typog@config@stretchlimits}}%
7682 \unless\ifx\typog@@limit\typog@@star\edef\typog@stretch@i{\number\typog@@limit}\fi
7683 \edef\typog@@limit{\typog@triple@get@ii{\typog@config@stretchlimits}}%
7684 \unless\ifx\typog@@limit\typog@@star\edef\typog@stretch@ii{\number\typog@@limit}\fi
7685 \edef\typog@@limit{\typog@triple@get@iii{\typog@config@stretchlimits}}%
7686 \unless\ifx\typog@@limit\typog@@star\edef\typog@stretch@iii{\number\typog@@limit}\fi}
7687
7688 \DeclareOptionX<typog>{breakpenalty}%
7689 {\renewcommand*{\typog@config@breakpenalty}{#1}}
7690 \DeclareOptionX<typog>{debug}{\typog@debugtrue}
7691 \DeclareOptionX<typog>{emdashspace}[.05555em]%
7692 {\setlength{\typog@config@emdashspace}{#1}}
7693 \DeclareOptionX<typog>{endashspace}[.2em plus.1em minus.0667em]%
7694 {\setlength{\typog@config@endashspace}{#1}}
7695 % \fi
7696 %
7697 % \changes{v0.5}{2025-06-15}{\backwardincompatiblechange{}
7698 % Rename package option \code{math\-italics\-correction} to \code{math\-italic\-correction}.}
7699 %
7700 % \iffalse
7701 \DeclareOptionX<typog>{mathitaliccorrection}[.4mu]%
7702 {\typog@config@mathitaliccorrection=#1\relax}%
7703 \DeclareOptionX<typog>{nodebug}{\typog@debugfalse}
7704 % \fi
7705 %
7706 % \changes{v0.5}{2025-06-15}{\backwardincompatiblechange{}
7707 % Rename package option \code{text\-italics\-correction} to \code{text\-italic\-correction}.}
7708 %
7709 % \iffalse
7710 \DeclareOptionX<typog>{textitaliccorrection}[.02em]%
7711 {\setlength{\typog@config@textitaliccorrection}{#1}}
7712 \DeclareOptionX<typog>{ligaturekern}[.033333em]%
7713 {\setlength{\typog@config@ligaturekern}{#1}}
7714 % \fi
7715 %
7716 % \changes{v0.5}{2024-09-22}{Rewrite parser for package option~\code{lowercase\-labelitem\-adjustments} to accept a star as a placeholder.}
7717 %
7718 % \iffalse
7719 \DeclareOptionX<typog>{lowercaselabelitemadjustments}%
7720 {\typog@debug@typeout{lowercaselabelitemadjustments={#1}}%
7721 \def\typog@@do##1{\addtocounter{typog@@iteration}{1}%
7722 \ifstrequal{##1}{*}
7723 {\relax}
7724 {\global\setlength{\csname typog@adjust@lowercase@labelitem\romannumeral\thetypog@@iteration\endcsname}{##1}}}%
7725 \setcounter{typog@@iteration}{0}%
7726 \forcsvlist{\typog@@do}{#1}}
7727 \newcommand*{\typog@config@lowercaselabelitemadjustments}
7728 {\the\typog@adjust@lowercase@labelitemi,\space
7729 \the\typog@adjust@lowercase@labelitemii,\space
7730 \the\typog@adjust@lowercase@labelitemiii,\space
7731 \the\typog@adjust@lowercase@labelitemiv}
7732 \DeclareOptionX<typog>{raisecapitaldash}[\z@]%
7733 {\setlength{\typog@config@raisecapitaldash}{#1}}
7734 \DeclareOptionX<typog>{raisecapitalguillemets}[\z@]%
7735 {\setlength{\typog@config@raisecapitalguillemets}{#1}}
7736 \DeclareOptionX<typog>{raisecapitalhyphen}[\z@]%
7737 {\setlength{\typog@config@raisecapitalhyphen}{#1}}
7738 \DeclareOptionX<typog>{raisecapitaltimes}[\z@]%
7739 {\setlength{\typog@config@raisecapitaltimes}{#1}}
7740 \DeclareOptionX<typog>{raiseguillemets}[\z@]%
7741 {\setlength{\typog@config@raiseguillemets}{#1}}
7742 \DeclareOptionX<typog>{raisefiguredash}[\z@]%
7743 {\setlength{\typog@config@raisefiguredash}{#1}}
7744 \DeclareOptionX<typog>{raise*}[\z@]%
7745 {\setlength{\typog@config@raisecapitaldash}{#1}%
7746 \setlength{\typog@config@raisecapitalhyphen}{#1}%
7747 \setlength{\typog@config@raisecapitaltimes}{#1}%
7748 \setlength{\typog@config@raisefiguredash}{#1}}
7749 \DeclareOptionX<typog>{raiseinvertedmarks}%
7750 {\typog@debug@typeout{raiseinvertedmarks={#1}}
7751 \def\typog@@do##1{\addtocounter{typog@@iteration}{1}
7752 \ifstrequal{##1}{*}
7753 {\relax}
7754 {\global\setlength{\csname typog@config@raiseinvertedmarks@\romannumeral\thetypog@@iteration\endcsname}{##1}}}
7755 \setcounter{typog@@iteration}{0}
7756 \forcsvlist{\typog@@do}{#1}}
7757 \newcommand*{\typog@config@raiseinvertedmarks}
7758 {\the\typog@config@raiseinvertedmarks@i,\space
7759 \the\typog@config@raiseinvertedmarks@ii,\space
7760 \the\typog@config@raiseinvertedmarks@iii}
7761 \DeclareOptionX<typog>{shrinklimits}%
7762 [\typog@default@shrink@i, \typog@default@shrink@ii, \typog@default@shrink@iii]%
7763 {\typog@require@preloaded@microtype
7764 \ifx\@onlypreamble\@notprerr
7765 \PackageWarning{typog}{option `shrinklimits' can only be used in the preamble}%
7766 \else
7767 \edef\typog@config@shrinklimits{#1}%
7768 \typog@set@shrink@limits
7769 \fi}
7770 \DeclareOptionX<typog>{slashkern}[.05em]%
7771 {\setlength{\typog@config@slashkern}{#1}}
7772 \DeclareOptionX<typog>{lowerslash}[\z@]%
7773 {\setlength{\typog@config@lowerslash}{#1}}
7774 \DeclareOptionX<typog>{stretchlimits}%
7775 [\typog@default@stretch@i, \typog@default@stretch@ii, \typog@default@stretch@iii]%
7776 {\typog@require@preloaded@microtype
7777 \ifx\@onlypreamble\@notprerr
7778 \PackageWarning{typog}{option `stretchlimits' can only be used in the preamble}%
7779 \else
7780 \edef\typog@config@stretchlimits{#1}%
7781 \typog@set@stretch@limits
7782 \fi}
7783 \DeclareOptionX<typog>{trackingttspacing}[\typog@config@trackingttspacing]%
7784 {\typog@require@preloaded@microtype
7785 \ifx\@onlypreamble\@notprerr
7786 \PackageWarning{typog}{option `trackingttspacing' can only be used in the preamble}%
7787 \else
7788 \typog@debug@typeout{trackingttspacing=#1}%
7789 \SetTracking[outer spacing={#1}]{encoding=*, family=tt*}{0}%
7790 \fi}
7791 % \fi
7792 %
7793 % \changes{v0.5}{2024-09-22}{Rewrite parser for package option~\code{uppercase\-labelitem\-adjustments} to accept a star as a placeholder.}
7794 %
7795 % \iffalse
7796 \DeclareOptionX<typog>{uppercaselabelitemadjustments}%
7797 {\typog@debug@typeout{uppercaselabelitemadjustments={#1}}%
7798 \def\typog@@do##1{\addtocounter{typog@@iteration}{1}%
7799 \ifstrequal{##1}{*}
7800 {\relax}
7801 {\setlength{\csname typog@adjust@uppercase@labelitem\romannumeral\thetypog@@iteration\endcsname}{##1}}}%
7802 \setcounter{typog@@iteration}{0}%
7803 \forcsvlist{\typog@@do}{#1}}
7804 \newcommand*{\typog@config@uppercaselabelitemadjustments}
7805 {\the\typog@adjust@uppercase@labelitemi,\space
7806 \the\typog@adjust@uppercase@labelitemii,\space
7807 \the\typog@adjust@uppercase@labelitemiii,\space
7808 \the\typog@adjust@uppercase@labelitemiv}
7809
7810 \newcommand*{\typog@initialize@options}
7811 {\ExecuteOptionsX<typog>{
7812 emdashspace, endashspace,
7813 ligaturekern,
7814 mathitaliccorrection, textitaliccorrection,
7815 raisecapitaldash, raisecapitalhyphen, raisecapitaltimes,
7816 raiseguillemets, raisecapitalguillemets,
7817 raisefiguredash,
7818 slashkern, lowerslash}%
7819 \ifdefined\MT@MT
7820 \unless\ifx\@onlypreamble\@notprerr
7821 \ExecuteOptionsX<typog>{shrinklimits, stretchlimits}%
7822 \fi
7823 \fi}
7824
7825 \typog@initialize@options
7826 \ProcessOptionsX<typog>
7827
7828 % \fi
7829 %
7830 %
7831 % \subsection{Setup and Reconfiguration}
7832 %
7833 % \begin{environment}{typogsetup}
7834 % An empty argument list resets all initialized values to their defaults.
7835 %
7836 % \begin{macrocode}
7837 \NewDocumentEnvironment{typogsetup}{m}
7838 {\def\typog@@arg{#1}%
7839 \ifx\typog@@arg\empty
7840 \typog@initialize@options
7841 \else
7842 \setkeys{typog}{#1}%
7843 \fi
7844 \ignorespaces}
7845 {\ignorespacesafterend}
7846 % \end{macrocode}
7847 % \end{environment}
7848 %
7849 % \begin{macro}{\typogget}
7850 % Access the package's configuration (name-)space.
7851 %
7852 % \begin{macrocode}
7853 \NewDocumentCommand{\typogget}{m}
7854 {\csname typog@config@#1\endcsname}
7855
7856 % \end{macrocode}
7857 % \end{macro}
7858 %
7859 % \begin{macro}{\typoggetnth}
7860 % \changes{v0.4}{2024-05-15}{New macro.}
7861 % Access the \(n\)\textsuperscript{th} element of a comma-separated, list-like configuration
7862 % item's value.
7863 %
7864 % \begin{macrocode}
7865 \ExplSyntaxOn
7866 \cs_generate_variant:Nn \seq_set_split:Nnn {Nne}
7867 \cs_new:Npn \typog_get_nth_csname:cnn #1#2#3
7868 {
7869 \seq_set_split:Nne \l_tmpa_seq {,} {\cs:w typog@config@#2 \cs_end:}
7870 \cs_gset:cpn {#1} {\seq_item:Nn \l_tmpa_seq {#3}}
7871 }
7872 \cs_new:Npn \typog_get_nth_dimen:nnn #1#2#3
7873 {
7874 \seq_set_split:Nne \l_tmpa_seq {,} {\cs:w typog@config@#2 \cs_end:}
7875 \dim_set:Nn {#1} {\seq_item:Nn \l_tmpa_seq {#3}}
7876 }
7877 \NewDocumentCommand{\typoggetnth}{m m m}{
7878 \token_if_dim_register:NTF {#1}
7879 {
7880 \typog_get_nth_dimen:nnn {#1} {#2} {#3}
7881 }
7882 {
7883 \typog_get_nth_csname:cnn {#1} {#2} {#3}
7884 }
7885 }
7886 \ExplSyntaxOff
7887
7888 % \end{macrocode}
7889 % \end{macro}
7890 %
7891 %
7892 % \subsection{Information}
7893 %
7894 % \begin{macro}{\typog@round@dim@to@tenths}
7895 % \begin{macrocode}
7896 \ExplSyntaxOn
7897 \newcommand*{\typog@round@dim@to@tenths}[1]
7898 {\fp_to_decimal:n {round(10 * \dim_to_fp:n{#1} / 1\p@) / 10}}
7899 \ExplSyntaxOff
7900
7901 % \end{macrocode}
7902 % \end{macro}
7903 %
7904 % \begin{macro}{\typog@formatsizeinfo}
7905 % Arguments 1 and~2 are the font size and the line spacing.
7906 % The third parameter adds (decorative) units to both numbers.
7907 %
7908 % \begin{macrocode}
7909 \newcommand*{\typog@formatsizeinfo}[3]
7910 {#1#3\kernedslash #2#3}
7911
7912 % \end{macrocode}
7913 % \end{macro}
7914 %
7915 % \begin{macro}{\fontsizeinfo}
7916 % All macros defined inside of \cs{fontsizeinfo} must be global
7917 % because the call can occur inside of a group.
7918 %
7919 % The two \cs{edef}s at the beginning capture the desired values
7920 % at the point where the macro \emph{is called}.
7921 % The user-macro is tricky for we need
7922 % a global macro with a constructed name
7923 % and an associated starred version.
7924 %
7925 % \begin{implementationnote}
7926 % \cs{@ifstar} caused too many problems which \cs{@ifnextchar} in combination with
7927 % \cs{@gobble} avoid.
7928 % \end{implementationnote}
7929 %
7930 % \begin{macrocode}
7931 \NewDocumentCommand{\fontsizeinfo}{s m}
7932 {\global\expandafter\edef\csname typog@fontsize@#2\endcsname
7933 {\typog@round@dim@to@tenths{\fontdimen6\font}}%
7934 \global\expandafter\edef\csname typog@linespacing@#2\endcsname
7935 {\typog@round@dim@to@tenths{\baselineskip}}%
7936 \protected\expandafter\gdef\csname #2\endcsname
7937 {\@ifnextchar*{\typog@formatsizeinfo
7938 {\csname typog@fontsize@#2\endcsname}%
7939 {\csname typog@linespacing@#2\endcsname}%
7940 {}% no unit
7941 \ignorespaces % eat spaces after star
7942 \@gobble} % consume the star itself
7943 {\typog@formatsizeinfo
7944 {\csname typog@fontsize@#2\endcsname}%
7945 {\csname typog@linespacing@#2\endcsname}%
7946 {\,pt}% decorative unit `pt'
7947 }}}
7948
7949 % \end{macrocode}
7950 % \end{macro}
7951 %
7952 % \begin{macro}{\typog@default@inspect@id@prefix}
7953 % Id-prefix for those |typoinspect|~environments
7954 % that were not identified by the user.
7955 %
7956 % \begin{macrocode}
7957 \newcommand*{\typog@default@inspect@id@prefix}{a-}
7958 % \end{macrocode}
7959 % \end{macro}
7960 %
7961 % \begin{macro}{typog@inspect@count}
7962 % Counter to supply unique number and in turn \meta{id}
7963 % for those |typoinspect|~environments
7964 % that were not identified by the user.
7965 %
7966 % \begin{macrocode}
7967 \newcounter{typog@inspect@count}
7968
7969 % \end{macrocode}
7970 % \end{macro}
7971 %
7972 % \begin{environment}{typoginspect}
7973 % \begin{macrocode}
7974 \define@key[typog]{typoginspect}{tracingboxes}[\maxdimen]%
7975 {\def\typog@@typoginspect@tracingboxes{#1}}
7976 \NewDocumentEnvironment{typoginspect}{O{} m}
7977 {\def\typog@@typoginspect@tracingboxes{\m@ne}%
7978 \setkeys[typog]{typoginspect}{#1}%
7979 % \end{macrocode}
7980 %
7981 % If the user does not supply an \meta{id},
7982 % we fall back to our own counter
7983 % and construct a hopefully unique \meta{id} from that.
7984 %
7985 % \begin{macrocode}
7986 \edef\typog@@arg{#2}%
7987 \ifx\typog@@arg\empty
7988 \stepcounter{typog@inspect@count}%
7989 \edef\typog@@id{\typog@default@inspect@id@prefix
7990 \arabic{typog@inspect@count}}%
7991 \else
7992 \edef\typog@@id{\typog@trim@spaces{\typog@@arg}}%
7993 \fi
7994 \typeout{<typog-inspect\space
7995 id="\typog@@id"\space
7996 job="\jobname"\space
7997 line="\the\inputlineno"\space
7998 page="\the\value{page}">}%
7999 % \end{macrocode}
8000 %
8001 % Set both badness thresholds to absurdly low values as to activate \TeX's reports.
8002 %
8003 % \begin{macrocode}
8004 \hbadness=\m@ne
8005 \vbadness=\m@ne
8006 % \end{macrocode}
8007 %
8008 % Carefully select the tracing functionality we want (to improve our typography).
8009 % Too much trace data distracts
8010 % and the user always can turn on more tracing at the beginning of the environment.
8011 %
8012 % \begin{macrocode}
8013 \tracingnone
8014 \tracingpages=\@ne
8015 \tracingparagraphs=\@ne
8016 \showboxbreadth=\typog@@typoginspect@tracingboxes
8017 \showboxdepth=\typog@@typoginspect@tracingboxes}
8018 {\typeout{</typog-inspect>}%
8019 \ignorespacesafterend}
8020 % \end{macrocode}
8021 % \end{environment}
8022 %
8023 % \begin{environment}{typoginspectpar}
8024 % Companion environment to |typoginspect|
8025 % which adds a \cs{par} before the end of the group.
8026 %
8027 % \begin{macrocode}
8028 \NewDocumentEnvironment{typoginspectpar}{m}
8029 {\typoginspect{#1}}
8030 {\par\endtypoginspect}
8031
8032 % \end{macrocode}
8033 % \end{environment}
8034 %
8035 %
8036 % \subsection{Hyphenation}
8037 %
8038 % \begin{macro}{\typog@allowhyphenation}
8039 % Re-enable automatic hyphenation.
8040 %
8041 % The same or almost the same implementation can be found
8042 % in \packagename{babel} as macro~\cs{bbl@allowhyphens}
8043 % and \packagename{hyphenat} as macro~\cs{prw@zbreak}.
8044 %
8045 % \begin{macrocode}
8046 \newcommand*{\typog@allowhyphenation}
8047 {\ifvmode
8048 \relax
8049 \else
8050 \nobreak
8051 \hskip\z@skip
8052 \fi}
8053
8054 % \end{macrocode}
8055 % \end{macro}
8056 %
8057 % \begin{macro}{\allowhyphenation}
8058 % Define a user-visible alias unless the name is already used.
8059 %
8060 % \begin{macrocode}
8061 \unless\ifdefined\allowhyphenation
8062 \let\allowhyphenation=\typog@allowhyphenation
8063 \fi
8064
8065 % \end{macrocode}
8066 % \end{macro}
8067 %
8068 % \begin{macro}{\breakpoint}
8069 % The starred form inhibits hyphenation of the right-hand component.
8070 %
8071 % \begin{macrocode}
8072 \NewDocumentCommand{\breakpoint}{s}
8073 {\discretionary{}{}{}%
8074 \IfBooleanTF{#1}%
8075 {\ignorespaces}%
8076 {\typog@allowhyphenation}}
8077
8078 % \end{macrocode}
8079 %
8080 % \acronym{PDF}-substitute definition
8081 %
8082 % \begin{macrocode}
8083 \typog@register@pdfsubstitute{
8084 \def\breakpoint#1{\if*\detokenize{#1}\ignorespaces\fi}%
8085 }
8086
8087 % \end{macrocode}
8088 % \end{macro}
8089 %
8090 % \begin{environment}{hyphenmin}
8091 % \changes{v0.3}{2024-05-04}{New environment.}
8092 % No trickery here.\spacedemdash We use the mandatory argument for the value of
8093 % \cs{lefthyphenmin} if the optional argument has been omitted.
8094 %
8095 % \begin{macrocode}
8096 \NewDocumentEnvironment{hyphenmin}{o m}
8097 {\lefthyphenmin=\IfNoValueTF{#1}{#2}{#1}%
8098 \righthyphenmin=#2}
8099 {}
8100
8101 % \end{macrocode}
8102 % \end{environment}
8103 %
8104 %
8105 % \subsection{Disable/Break Ligatures}
8106 %
8107 % \begin{macro}{\typog@hyphen}
8108 % We define our own hyphen so the user can override the definition in a pinch.
8109 %
8110 % \begin{macrocode}
8111 \newcommand*{\typog@hyphen}{\char`-}
8112
8113 % \end{macrocode}
8114 % \end{macro}
8115 %
8116 % \begin{macro}{\nolig}
8117 % \begin{macrocode}
8118 \NewDocumentCommand{\nolig}{s o}
8119 {\dimen0=\IfNoValueTF{#2}
8120 {\typog@config@ligaturekern}
8121 {#2\typog@dim@unit}%
8122 \IfBooleanTF{#1}%
8123 {\kern\dimen0\ignorespaces}%
8124 {\discretionary{\typog@hyphen}{}{\kern\dimen0}%
8125 \typog@allowhyphenation
8126 \IfNoValueF{#2}{\ignorespaces}}}
8127
8128 % \end{macrocode}
8129 %
8130 % The \acronym{PDF}-ready version of \cs{nolig} cannot be implemented with \cs{futurelet}.
8131 % Doh!
8132 %
8133 % \begin{macrocode}
8134 \typog@register@pdfsubstitute{
8135 \RenewExpandableDocumentCommand{\nolig}{s o m}{%
8136 \ifx\typog@TYPOG#3\typog@TYPOG
8137 \relax
8138 \else
8139 \ifx\relax#3\relax
8140 \relax
8141 \else
8142 \typog@missing@argument
8143 \fi
8144 \fi}
8145 }
8146
8147 % \end{macrocode}
8148 % \end{macro}
8149 %
8150 %
8151 % \subsection{Manual Italic Correction}
8152 %
8153 % \begin{macro}{\typog@itcorr@text@unconditional}
8154 % Fallback italic correction for text mode.
8155 %
8156 % \begin{macrocode}
8157 \newcommand*{\typog@itcorr@text@unconditional}[1]
8158 {\kern#1\typog@config@textitaliccorrection}
8159 % \end{macrocode}
8160 % \end{macro}
8161 %
8162 % \begin{macro}{\typog@itcorr@text}
8163 % Conditional italic correction depending on
8164 % the current font's own italic correction,
8165 % i.\,e., \cs{fontdimen1}.
8166 %
8167 % \begin{macrocode}
8168 \newcommand*{\typog@itcorr@text}[1]
8169 {\def\typog@@strength{#1}%
8170 \dimen0=\fontdimen1\font
8171 \ifdim\dimen0=\z@
8172 \typog@itcorr@text@unconditional{\typog@@strength}%
8173 \else
8174 \kern\typog@@strength\dimen0
8175 \fi}
8176 % \end{macrocode}
8177 % \end{macro}
8178 %
8179 % \begin{macro}{\typog@itcorr@math}
8180 % Italic correction for math mode.
8181 %
8182 % \begin{macrocode}
8183 \newcommand*{\typog@itcorr@math}[1]
8184 {\mkern#1\typog@config@mathitaliccorrection}
8185 % \end{macrocode}
8186 % \end{macro}
8187 %
8188 % \begin{macro}{\itcorr}
8189 % If the font has no italic correction we fall back to out own length.
8190 % In text mode, the starred version always uses the fallback.
8191 % The star is a no-op in math mode.
8192 %
8193 % \begin{macrocode}
8194 \NewDocumentCommand{\itcorr}{s m}
8195 {\ifmmode
8196 \typog@itcorr@math{#2}%
8197 \else
8198 \IfBooleanTF{#1}%
8199 {\typog@itcorr@text{#2}}%
8200 {\typog@itcorr@text@unconditional{#2}}%
8201 \fi}
8202 % \end{macrocode}
8203 %
8204 % \acronym{PDF}-substitute definition
8205 %
8206 % \begin{macrocode}
8207 \typog@register@pdfsubstitute{
8208 \RenewExpandableDocumentCommand{\itcorr}{s m}{}
8209 }
8210
8211 % \end{macrocode}
8212 % \end{macro}
8213 %
8214 %
8215 % \subsection{Apply Extra Kerning}
8216 %
8217 % \subsubsection*{Slash}
8218 %
8219 % \begin{macro}{\typog@forwardslash}
8220 % We define our own forward-slash so the user can override the definition in a pinch.
8221 %
8222 % \begin{macrocode}
8223 \newcommand*{\typog@forwardslash}{\char`/}
8224 % \end{macrocode}
8225 % \end{macro}
8226 %
8227 % \begin{macro}{\kernedslash}
8228 % \changes{v0.5}{2024-09-15}{Allow for lowering (or raising) \cs{kernedslash} with package
8229 % option~\code{lowerslash}.}
8230 % Macro~\cs{kernedslash} introduces a hyphenation possibility right after the dash,
8231 % whereas the starred version does not.
8232 %
8233 % By the way, \cs{slash} expands to `|/|\cs{penalty}\cs{exhyphenpenalty}'.
8234 %
8235 % \begin{macrocode}
8236 \NewDocumentCommand{\kernedslash}{s}
8237 {\hspace*{\typog@config@slashkern}%
8238 \raisebox{-\typog@config@lowerslash}{\typog@forwardslash}%
8239 \IfBooleanTF{#1}%
8240 {\hspace*{\typog@config@slashkern}\ignorespaces}%
8241 {\typog@breakpoint
8242 \typog@allowhyphenation
8243 \hspace*{\typog@config@slashkern}}}
8244 % \end{macrocode}
8245 %
8246 % \acronym{PDF}-substitute definition
8247 %
8248 % \begin{macrocode}
8249 \typog@register@pdfsubstitute{
8250 \def\kernedslash#1{\if*\detokenize{#1}/\ignorespaces\else/#1\fi}%
8251 }
8252
8253 % \end{macrocode}
8254 % \end{macro}
8255 %
8256 %
8257 % \subsubsection*{Hyphen}
8258 %
8259 % \begin{macro}{\kernedhyphen}
8260 % \begin{macrocode}
8261 \NewDocumentCommand{\kernedhyphen}{s O{0} m m}
8262 {\ifmmode
8263 \mspace{\muexpr(#3 mu) * 18 / 1000}%
8264 \raisebox{#2\typog@dim@unit}{$\m@th\mathord{-}$}%
8265 \mspace{\muexpr(#4 mu) * 18 / 1000}%
8266 \else
8267 \def\typog@@auto{*}%
8268 \def\typog@@optarg{#2}%
8269 \hspace*{#3\typog@dim@unit}%
8270 \raisebox{\ifx\typog@@optarg\typog@@auto
8271 \typog@config@raisecapitalhyphen
8272 \else
8273 \typog@@optarg\typog@dim@unit
8274 \fi}{\typog@hyphen}%
8275 \hspace{#4\typog@dim@unit}%
8276 \IfBooleanT{#1}{\nobreak}%
8277 \fi}
8278 % \end{macrocode}
8279 %
8280 % \acronym{PDF}-substitute definition
8281 %
8282 % \begin{macrocode}
8283 \typog@register@pdfsubstitute{
8284 \RenewExpandableDocumentCommand{\kernedhyphen}{s o m m}{-}
8285 }
8286 % \end{macrocode}
8287 % \end{macro}
8288 %
8289 % One-argument shorthands.
8290 %
8291 % \begin{macro}{\leftkernedhyphen}
8292 % Apply kerning on the left-hand side of the hyphen only.
8293 %
8294 % \begin{macrocode}
8295 \NewDocumentCommand{\leftkernedhyphen}{s O{0} m}
8296 {\IfBooleanTF{#1}%
8297 {\kernedhyphen*[#2]{#3}{0}\ignorespaces}%
8298 {\kernedhyphen[#2]{#3}{0}}}
8299 % \end{macrocode}
8300 % \end{macro}
8301 %
8302 % \acronym{PDF}-substitute definition
8303 %
8304 % \begin{macrocode}
8305 \typog@register@pdfsubstitute{
8306 \RenewExpandableDocumentCommand{\leftkernedhyphen}{s o m}{-}
8307 }
8308
8309 % \end{macrocode}
8310 %
8311 % \begin{macro}{\rightkernedhyphen}
8312 % Apply kerning on the right-hand side of the hyphen only.
8313 %
8314 % \begin{macrocode}
8315 \NewDocumentCommand{\rightkernedhyphen}{s O{0} m}
8316 {\IfBooleanTF{#1}%
8317 {\kernedhyphen*[#2]{0}{#3}\ignorespaces}%
8318 {\kernedhyphen[#2]{0}{#3}}}
8319 % \end{macrocode}
8320 % \end{macro}
8321 %
8322 % \acronym{PDF}-substitute definition
8323 %
8324 % \begin{macrocode}
8325 \typog@register@pdfsubstitute{
8326 \RenewExpandableDocumentCommand{\rightkernedhyphen}{s o m}{-}
8327 }
8328
8329 % \end{macrocode}
8330 %
8331 %
8332 % \subsubsection*{En-Dash and Em-Dash}
8333 %
8334 % \begin{macro}{\typog@wrap@endash}
8335 % Wrapper for the en-dash. The first and second arguments are used to control the
8336 % line breaking; the third argument is the actual en-dash macro.
8337 %
8338 % \begin{macrocode}
8339 \newcommand*{\typog@wrap@endash}[3]
8340 {#1\hspace{\typog@config@endashspace}%
8341 #3%
8342 #2\hspace{\typog@config@endashspace}}
8343 % \end{macrocode}
8344 % \end{macro}
8345 %
8346 % \begin{macro}{\typog@wrap@emdash}
8347 % Wrapper for the em-dash. The first and second arguments are used to control the
8348 % line breaking; the third argument is the actual em-dash macro.
8349 %
8350 % \begin{macrocode}
8351 \newcommand*{\typog@wrap@emdash}[3]
8352 {#1\hspace{\typog@config@emdashspace}%
8353 #3%
8354 #2\hspace{\typog@config@emdashspace}}
8355
8356 % \end{macrocode}
8357 % \end{macro}
8358 %
8359 % \begin{macro}{\leftspacedendash}
8360 % \changes{v0.5}{2025-05-19}{New macro.}
8361 % User-land macro for the left (aka opening or introducing) spaced en-dash.
8362 % The unstarred variant introduces a breakpoint \emph{before} the en-dash.
8363 %
8364 % \begin{macrocode}
8365 \NewDocumentCommand{\leftspacedendash}{s o}
8366 {\IfBooleanTF{#1}
8367 {\IfNoValueTF{#2}
8368 {\typog@wrap@endash{\nobreak}{\nobreak}
8369 {\textendash}}
8370 {\typog@wrap@endash{\nobreak}{\nobreak}
8371 {\raisebox{#2}{\textendash}}}}
8372 {\IfNoValueTF{#2}
8373 {\typog@wrap@endash{\relax}{\nobreak}
8374 {\textendash}}
8375 {\typog@wrap@endash{\nobreak}{\nobreak}
8376 {\raisebox{#2}{\textendash}}}}%
8377 \ignorespaces}
8378 \let\leftspaceddash=\leftspacedendash
8379 % \end{macrocode}
8380 %
8381 % \acronym{PDF}-substitute definition
8382 %
8383 % \begin{macrocode}
8384 \typog@register@pdfsubstitute{
8385 \RenewExpandableDocumentCommand{\leftspacedendash}{s o m}{%
8386 \ifx\typog@TYPOG#3\typog@TYPOG
8387 \textendash
8388 \else
8389 \ifx\relax#3\relax
8390 \textendash
8391 \else
8392 \typog@missing@argument
8393 \fi
8394 \fi}
8395 \let\leftspaceddash=\leftspacedendash
8396 }
8397
8398 % \end{macrocode}
8399 % \end{macro}
8400 %
8401 % \begin{macro}{\rightspacedendash}
8402 % \changes{v0.5}{2025-05-19}{New macro.}
8403 % User-land macro for the right (aka closing) spaced en-dash.
8404 % The unstarred variant introduces a breakpoint \emph{after} the en-dash.
8405 %
8406 % \begin{macrocode}
8407 \NewDocumentCommand{\rightspacedendash}{s o}
8408 {\IfBooleanTF{#1}
8409 {\IfNoValueTF{#2}
8410 {\typog@wrap@endash{\nobreak}{\nobreak}
8411 {\textendash}}
8412 {\typog@wrap@endash{\nobreak}{\nobreak}
8413 {\raisebox{#2}{\textendash}}}}
8414 {\IfNoValueTF{#2}
8415 {\typog@wrap@endash{\nobreak}{\relax}
8416 {\textendash}}
8417 {\typog@wrap@endash{\nobreak}{\nobreak}
8418 {\raisebox{#2}{\textendash}}}}%
8419 \ignorespaces}
8420 \let\rightspaceddash=\rightspacedendash
8421 \let\spacedendash=\rightspacedendash
8422 \let\spaceddash=\rightspacedendash
8423 % \end{macrocode}
8424 %
8425 % \acronym{PDF}-substitute definition
8426 %
8427 % \begin{macrocode}
8428 \typog@register@pdfsubstitute{
8429 \RenewExpandableDocumentCommand{\rightspacedendash}{s o m}{%
8430 \ifx\typog@TYPOG#3\typog@TYPOG
8431 \space\textendash\space
8432 \else
8433 \ifx\relax#3\relax
8434 \space\textendash\space
8435 \else
8436 \typog@missing@argument
8437 \fi
8438 \fi
8439 \ignorespaces}
8440 \let\rightspaceddash=\rightspacedendash
8441 \let\spacedendash=\rightspacedendash
8442 \let\spaceddash=\rightspacedendash
8443 }
8444
8445 % \end{macrocode}
8446 % \end{macro}
8447 %
8448 % \begin{macro}{\swapendashskip}
8449 % \changes{v0.5}{2025-05-29}{New macro.}
8450 % \begin{macrocode}
8451 \NewDocumentCommand{\swapendashskip}{m}
8452 {\skip0=\lastskip
8453 \unskip
8454 #1%
8455 \hskip\skip0}
8456
8457 % \end{macrocode}
8458 % \end{macro}
8459 %
8460 % \begin{macro}{\leftspacedendash}
8461 % \changes{v0.5}{2025-05-27}{New macro.}
8462 % User-land macro for the spaced em-dash.
8463 %
8464 % The two \cs{mbox}es turn off automatic hyphenation of the adjacent words.
8465 % This ensures \singlequotes{compatibility} with the en-dash~\sample{-\nolig*-}.
8466 %
8467 % \begin{macrocode}
8468 \NewDocumentCommand{\leftspacedemdash}{s o}
8469 {\mbox{}%
8470 \IfBooleanTF{#1}
8471 {\IfNoValueTF{#2}
8472 {\typog@wrap@emdash{\nobreak}{\nobreak}
8473 {\textemdash}}
8474 {\typog@wrap@emdash{\nobreak}{\nobreak}
8475 {\raisebox{#2}{\textemdash}}}}
8476 {\IfNoValueTF{#2}
8477 {\typog@wrap@emdash{\relax}{\nobreak}
8478 {\textemdash}}
8479 {\typog@wrap@emdash{\nobreak}{\nobreak}
8480 {\raisebox{#2}{\textemdash}}}}%
8481 \mbox{}%
8482 \ignorespaces}
8483 % \end{macrocode}
8484 %
8485 % \acronym{PDF}-substitute definition
8486 %
8487 % \begin{macrocode}
8488 \typog@register@pdfsubstitute{
8489 \RenewExpandableDocumentCommand{\leftspacedemdash}{s o m}{%
8490 \ifx\typog@TYPOG#3\typog@TYPOG
8491 \textemdash
8492 \else
8493 \ifx\relax#3\relax
8494 \textemdash
8495 \else
8496 \typog@missing@argument
8497 \fi
8498 \fi}
8499 }
8500
8501 % \end{macrocode}
8502 % \end{macro}
8503 %
8504 % \begin{macro}{\rightspacedemdash}
8505 % \changes{v0.5}{2025-05-27}{New macro.}
8506 % User-land macro for the right (aka closing) spaced em-dash.
8507 % The unstarred variant introduces a breakpoint \emph{after} the em-dash.
8508 %
8509 % The two \cs{mbox}es turn off automatic hyphenation of the adjacent words.
8510 % This ensures \singlequotes{compatibility} with the em-dash~\sample{-\nolig*-\nolig*-}.
8511 %
8512 % \begin{macrocode}
8513 \NewDocumentCommand{\rightspacedemdash}{s o}
8514 {\mbox{}%
8515 \IfBooleanTF{#1}
8516 {\IfNoValueTF{#2}
8517 {\typog@wrap@emdash{\nobreak}{\nobreak}
8518 {\textemdash}}
8519 {\typog@wrap@emdash{\nobreak}{\nobreak}
8520 {\raisebox{#2}{\textemdash}}}}
8521 {\IfNoValueTF{#2}
8522 {\typog@wrap@emdash{\nobreak}{\relax}
8523 {\textemdash}}
8524 {\typog@wrap@emdash{\nobreak}{\nobreak}
8525 {\raisebox{#2}{\textemdash}}}}%
8526 \mbox{}%
8527 \ignorespaces}
8528 \let\spacedemdash=\rightspacedemdash
8529 % \end{macrocode}
8530 %
8531 % \acronym{PDF}-substitute definition
8532 %
8533 % \begin{macrocode}
8534 \typog@register@pdfsubstitute{
8535 \RenewExpandableDocumentCommand{\rightspacedemdash}{s o m}{%
8536 \ifx\typog@TYPOG#3\typog@TYPOG
8537 \textemdash
8538 \else
8539 \ifx\relax#3\relax
8540 \textemdash
8541 \else
8542 \typog@missing@argument
8543 \fi
8544 \fi
8545 \ignorespaces}
8546 \let\spacedemdash=\rightspacedemdash
8547 }
8548
8549 % \end{macrocode}
8550 % \end{macro}
8551 %
8552 % \subsection{Raise Selected Characters}
8553 %
8554 % \begin{macro}{\typog@breakpoint}
8555 % We want our own penalty for a line break at a particular point.
8556 % The predefined \cs{allowbreak} is too eager.
8557 % A package-private, user-configurable penalty fits best.
8558 %
8559 % \begin{macrocode}
8560 \newcommand*{\typog@breakpoint}
8561 {\penalty\typog@config@breakpenalty}
8562 % \end{macrocode}
8563 % \end{macro}
8564 %
8565 %
8566 % \begin{macro}{\capitalhyphen}
8567 % Macro~\cs{capitalhyphen} introduces a hyphenation possibility right after the dash,
8568 % whereas the starred version does not.
8569 %
8570 % \begin{macrocode}
8571 \NewDocumentCommand{\capitalhyphen}{s}
8572 {\raisebox{\typog@config@raisecapitalhyphen}{\typog@hyphen}%
8573 \IfBooleanTF{#1}%
8574 {\ignorespaces}%
8575 {\typog@breakpoint\typog@allowhyphenation}}
8576 % \end{macrocode}
8577 %
8578 % The non-hyperref version's code is straightforward.
8579 % The \cs{pdfstringdefDisableCommands}~version must be expandable
8580 % and must match the other version's signature.
8581 % Yikes!
8582 % We exploit the fact that conditions are expandable.
8583 % However, we cannot use \cs{typog@hyphen} in the expansion as \cs{char} gets in the way.
8584 % So, we fall back to the least~common denominator and use a bare dash.
8585 %
8586 % \begin{macrocode}
8587 \typog@register@pdfsubstitute{
8588 \def\capitalhyphen#1{%
8589 \if*\detokenize{#1}%
8590 -\ignorespaces
8591 \else
8592 -#1%
8593 \fi}
8594 }
8595
8596 % \end{macrocode}
8597 % \end{macro}
8598 %
8599 %
8600 % \begin{macro}{\capitalendash}
8601 % Macro~\cs{capitalendash} introduces a hyphenation possibility right after the dash;
8602 % its starred version does not.
8603 %
8604 % \begin{macrocode}
8605 \NewDocumentCommand{\capitalendash}{s}
8606 {\raisebox{\typog@config@raisecapitaldash}{\textendash}%
8607 \IfBooleanTF{#1}%
8608 {\ignorespaces}%
8609 {\typog@breakpoint\typog@allowhyphenation}}
8610 \let\capitaldash=\capitalendash
8611 % \end{macrocode}
8612 %
8613 % \acronym{PDF}-substitute definition
8614 %
8615 % \begin{macrocode}
8616 \typog@register@pdfsubstitute{
8617 \def\capitalendash#1{%
8618 \if*\detokenize{#1}%
8619 \textendash\ignorespaces
8620 \else
8621 \textendash#1%
8622 \fi}
8623 \let\capitaldash=\capitalendash
8624 }
8625
8626 % \end{macrocode}
8627 % \end{macro}
8628 %
8629 %
8630 % \begin{macro}{\capitalemdash}
8631 % Macro~\cs{capitalemdash} introduces a hyphenation possibility right after the dash;
8632 % its starred version does not.
8633 %
8634 % \begin{macrocode}
8635 \NewDocumentCommand{\capitalemdash}{s}
8636 {\raisebox{\typog@config@raisecapitaldash}{\textemdash}%
8637 \IfBooleanTF{#1}%
8638 {\ignorespaces}%
8639 {\typog@breakpoint\typog@allowhyphenation}}
8640 % \end{macrocode}
8641 %
8642 % \acronym{PDF}-substitute definition
8643 %
8644 % \begin{macrocode}
8645 \typog@register@pdfsubstitute{
8646 \def\capitalemdash#1{%
8647 \if*\detokenize{#1}%
8648 \textemdash\ignorespaces
8649 \else
8650 \textemdash#1%
8651 \fi}
8652 }
8653
8654 % \end{macrocode}
8655 % \end{macro}
8656 %
8657 % \begin{macro}{\leftspacedcapitalendash}
8658 % \changes{v0.5}{2025-05-21}{New macro.}
8659 % Thanks to our wrapper macro the definition of \cs{leftspacedcapitalendash} is easy to write.
8660 % \begin{macrocode}
8661 \NewDocumentCommand{\leftspacedcapitalendash}{s}
8662 {\IfBooleanTF{#1}%
8663 {\typog@wrap@endash{\nobreak}{\nobreak}{\capitalendash*}}
8664 {\typog@wrap@endash{\relax}{\nobreak}{\capitalendash}}%
8665 \ignorespaces}
8666 \let\leftspacedcapitaldash=\leftspacedcapitalendash
8667 % \end{macrocode}
8668 %
8669 % \acronym{PDF}-substitute definition
8670 %
8671 % \begin{macrocode}
8672 \typog@register@pdfsubstitute{
8673 \def\leftspacedcapitalendash#1{%
8674 \if*\detokenize{#1}%
8675 \textendash\ignorespaces
8676 \else
8677 \textendash#1%
8678 \fi}
8679 \let\leftspacedcapitaldash=\leftspacedcapitalendash
8680 }
8681
8682 % \end{macrocode}
8683 % \end{macro}
8684 %
8685 % \begin{macro}{\rightspacedcapitalendash}
8686 % \changes{v0.5}{2025-05-21}{New macro.}
8687 % Thanks to our wrapper macro the definition of \cs{rightspacedcapitalendash} is easy to write.
8688 % \begin{macrocode}
8689 \NewDocumentCommand{\rightspacedcapitalendash}{s}
8690 {\IfBooleanTF{#1}%
8691 {\typog@wrap@endash{\nobreak}{\nobreak}{\capitalendash*}}
8692 {\typog@wrap@endash{\nobreak}{\relax}{\capitalendash}}%
8693 \ignorespaces}
8694 \let\rightspacedcapitaldash=\rightspacedcapitalendash
8695 \let\spacedcapitalendash=\rightspacedcapitalendash
8696 \let\spacedcapitaldash=\rightspacedcapitalendash
8697 % \end{macrocode}
8698 %
8699 % \acronym{PDF}-substitute definition
8700 %
8701 % \begin{macrocode}
8702 \typog@register@pdfsubstitute{
8703 \def\rightspacedcapitalendash#1{%
8704 \if*\detokenize{#1}%
8705 \textendash\ignorespaces
8706 \else
8707 \textendash#1%
8708 \fi}
8709 \let\rightspacedcapitaldash=\rightspacedcapitalendash
8710 \let\spacedcapitalendash=\rightspacedcapitalendash
8711 \let\spacedcapitaldash=\rightspacedcapitalendash
8712 }
8713
8714 % \end{macrocode}
8715 % \end{macro}
8716 %
8717 % \begin{macro}{\leftspacedcapitalemdash}
8718 % \changes{v0.5}{2025-05-27}{New macro.}
8719 % Thanks to our wrapper macro the definition of \cs{leftspacedcapitalemdash} is easy to write.
8720 % \begin{macrocode}
8721 \NewDocumentCommand{\leftspacedcapitalemdash}{s}
8722 {\IfBooleanTF{#1}%
8723 {\typog@wrap@emdash{\nobreak}{\nobreak}{\capitalemdash*}}
8724 {\typog@wrap@emdash{\relax}{\nobreak}{\capitalemdash}}%
8725 \ignorespaces}
8726 % \end{macrocode}
8727 %
8728 % \acronym{PDF}-substitute definition
8729 %
8730 % \begin{macrocode}
8731 \typog@register@pdfsubstitute{
8732 \def\leftspacedcapitalemdash#1{%
8733 \if*\detokenize{#1}%
8734 \textemdash\ignorespaces
8735 \else
8736 \textemdash#1%
8737 \fi}
8738 }
8739
8740 % \end{macrocode}
8741 % \end{macro}
8742 %
8743 % \begin{macro}{\rightspacedcapitalemdash}
8744 % \changes{v0.5}{2025-05-27}{New macro.}
8745 % Thanks to our wrapper macro the definition of \cs{rightspacedcapitalemdash} is easy to write.
8746 % \begin{macrocode}
8747 \NewDocumentCommand{\rightspacedcapitalemdash}{s}
8748 {\IfBooleanTF{#1}%
8749 {\typog@wrap@emdash{\nobreak}{\nobreak}{\capitalemdash*}}
8750 {\typog@wrap@emdash{\nobreak}{\relax}{\capitalemdash}}%
8751 \ignorespaces}
8752 \let\spacedcapitalemdash=\rightspacedcapitalemdash
8753 % \end{macrocode}
8754 %
8755 % \acronym{PDF}-substitute definition
8756 %
8757 % \begin{macrocode}
8758 \typog@register@pdfsubstitute{
8759 \def\rightspacedcapitalemdash#1{%
8760 \if*\detokenize{#1}%
8761 \textemdash\ignorespaces
8762 \else
8763 \textemdash#1%
8764 \fi}
8765 \let\spacedcapitalemdash=\rightspacedcapitalemdash
8766 }
8767
8768 % \end{macrocode}
8769 % \end{macro}
8770 %
8771 % \begin{macro}{\figuredash}
8772 % Macro~\cs{figuredash} introduces a hyphenation possibility right after the dash;
8773 % its starred version does not.
8774 %
8775 % \begin{macrocode}
8776 \NewDocumentCommand{\figuredash}{s}
8777 {\raisebox{\typog@config@raisefiguredash}{\textendash}%
8778 \IfBooleanTF{#1}%
8779 {\ignorespaces}%
8780 {\typog@breakpoint\typog@allowhyphenation}}
8781 % \end{macrocode}
8782 %
8783 % \acronym{PDF}-substitute definition
8784 %
8785 % \begin{macrocode}
8786 \typog@register@pdfsubstitute{\let\figuredash=\capitaldash}
8787
8788 % \end{macrocode}
8789 % \end{macro}
8790 %
8791 %
8792 % \begin{macro}{\capitaltimes}
8793 % \begin{macrocode}
8794 \NewDocumentCommand{\capitaltimes}{}
8795 {\ifmmode
8796 \mathbin{\raisebox{\typog@config@raisecapitaltimes}
8797 {$\m@th\times$}}%
8798 \else
8799 \raisebox{\typog@config@raisecapitaltimes}{\texttimes}%
8800 \fi}
8801 % \end{macrocode}
8802 %
8803 % \acronym{PDF}-substitute definition
8804 %
8805 % \begin{macrocode}
8806 \typog@register@pdfsubstitute{
8807 \RenewExpandableDocumentCommand{\capitaltimes}{}{\texttimes}
8808 }
8809
8810 % \end{macrocode}
8811 % \end{macro}
8812 %
8813 %
8814 % \begin{macro}{\singleguillemetleft}
8815 % \begin{macrocode}
8816 \NewDocumentCommand{\singleguillemetleft}{}
8817 {\typog@allowhyphenation
8818 \raisebox{\typog@config@raiseguillemets}{\guilsinglleft}}
8819 % \end{macrocode}
8820 %
8821 % \acronym{PDF}-substitute definition
8822 %
8823 % \begin{macrocode}
8824 \typog@register@pdfsubstitute{
8825 \let\singleguillemetleft\guilsinglleft
8826 }
8827 % \end{macrocode}
8828 % \end{macro}
8829 %
8830 % \begin{macro}{\singleguillemetright}
8831 % \begin{macrocode}
8832 \NewDocumentCommand{\singleguillemetright}{}
8833 {\raisebox{\typog@config@raiseguillemets}{\guilsinglright}%
8834 \typog@allowhyphenation}
8835 % \end{macrocode}
8836 %
8837 % \acronym{PDF}-substitute definition
8838 %
8839 % \begin{macrocode}
8840 \typog@register@pdfsubstitute{
8841 \let\singleguillemetright\guilsinglright
8842 }
8843 % \end{macrocode}
8844 % \end{macro}
8845 %
8846 % \begin{macro}{\doubleguillemetleft}
8847 % \begin{macrocode}
8848 \NewDocumentCommand{\doubleguillemetleft}{}
8849 {\typog@allowhyphenation
8850 \raisebox{\typog@config@raiseguillemets}{\guillemotleft}}
8851 % \end{macrocode}
8852 %
8853 % \acronym{PDF}-substitute definition
8854 %
8855 % \begin{macrocode}
8856 \typog@register@pdfsubstitute{
8857 \let\doubleguillemetleft\guillemotleft
8858 }
8859 % \end{macrocode}
8860 % \end{macro}
8861 %
8862 % \begin{macro}{\doubleguillemetright}
8863 % \begin{macrocode}
8864 \NewDocumentCommand{\doubleguillemetright}{}
8865 {\raisebox{\typog@config@raiseguillemets}{\guillemotright}%
8866 \typog@allowhyphenation}
8867 % \end{macrocode}
8868 %
8869 % \acronym{PDF}-substitute definition
8870 %
8871 % \begin{macrocode}
8872 \typog@register@pdfsubstitute{
8873 \let\doubleguillemetright\guillemotright
8874 }
8875 % \end{macrocode}
8876 % \end{macro}
8877 %
8878 % \begin{macro}{\Singleguillemetleft}
8879 % \begin{macrocode}
8880 \NewDocumentCommand{\Singleguillemetleft}{}
8881 {\typog@allowhyphenation
8882 \raisebox{\typog@config@raisecapitalguillemets}
8883 {\guilsinglleft}}
8884 % \end{macrocode}
8885 %
8886 % \acronym{PDF}-substitute definition
8887 %
8888 % \begin{macrocode}
8889 \typog@register@pdfsubstitute{
8890 \let\Singleguillemetleft\guilsinglleft
8891 }
8892 % \end{macrocode}
8893 % \end{macro}
8894 %
8895 % \begin{macro}{\Singleguillemetright}
8896 % \begin{macrocode}
8897 \NewDocumentCommand{\Singleguillemetright}{}
8898 {\raisebox{\typog@config@raisecapitalguillemets}
8899 {\guilsinglright}%
8900 \typog@allowhyphenation}
8901 % \end{macrocode}
8902 %
8903 % \acronym{PDF}-substitute definition
8904 %
8905 % \begin{macrocode}
8906 \typog@register@pdfsubstitute{
8907 \let\Singleguillemetright\guilsinglright
8908 }
8909 % \end{macrocode}
8910 % \end{macro}
8911 %
8912 % \begin{macro}{\Doubleguillemetleft}
8913 % \begin{macrocode}
8914 \NewDocumentCommand{\Doubleguillemetleft}{}
8915 {\typog@allowhyphenation
8916 \raisebox{\typog@config@raisecapitalguillemets}
8917 {\guillemotleft}}
8918 % \end{macrocode}
8919 %
8920 % \acronym{PDF}-substitute definition
8921 %
8922 % \begin{macrocode}
8923 \typog@register@pdfsubstitute{
8924 \let\Doubleguillemetleft\guillemotleft
8925 }
8926 % \end{macrocode}
8927 % \end{macro}
8928 %
8929 % \begin{macro}{\Doubleguillemetright}
8930 % \begin{macrocode}
8931 \NewDocumentCommand{\Doubleguillemetright}{}
8932 {\raisebox{\typog@config@raisecapitalguillemets}
8933 {\guillemotright}%
8934 \typog@allowhyphenation}
8935 % \end{macrocode}
8936 %
8937 % \acronym{PDF}-substitute definition
8938 %
8939 % \begin{macrocode}
8940 \typog@register@pdfsubstitute{
8941 \let\Doubleguillemetright\guillemotright
8942 }
8943
8944 % \end{macrocode}
8945 % \end{macro}
8946 %
8947 %
8948 % We need three lengths for three (pairs of) inverted exclamation marks and inverted question
8949 % marks.
8950 %
8951 % \begin{macro}{\typog@config@raiseinvertedmarks@i}
8952 % \begin{macrocode}
8953 \newlength{\typog@config@raiseinvertedmarks@i}
8954 % \end{macrocode}
8955 % \end{macro}
8956 %
8957 % \begin{macro}{\typog@config@raiseinvertedmarks@ii}
8958 % \begin{macrocode}
8959 \newlength{\typog@config@raiseinvertedmarks@ii}
8960 % \end{macrocode}
8961 % \end{macro}
8962 %
8963 % \begin{macro}{\typog@config@raiseinvertedmarks@iii}
8964 % \begin{macrocode}
8965 \newlength{\typog@config@raiseinvertedmarks@iii}
8966 % \end{macrocode}
8967 % \end{macro}
8968 %
8969 % And the three (pairs of) inverted exclamation marks and inverted question
8970 % marks themselves. Configurable.
8971 %
8972 % \begin{macro}{\typog@inverted@exclamationmark@i}
8973 % \begin{macrocode}
8974 \newcommand*{\typog@inverted@exclamationmark@i}
8975 {\textexclamdown}
8976 % \end{macrocode}
8977 % \end{macro}
8978 %
8979 % \begin{macro}{\typog@inverted@questionmark@i}
8980 % \begin{macrocode}
8981 \newcommand*{\typog@inverted@questionmark@i}
8982 {\textquestiondown}
8983 % \end{macrocode}
8984 % \end{macro}
8985 %
8986 % \begin{macro}{\typog@inverted@exclamationmark@ii}
8987 % \begin{macrocode}
8988 \newcommand*{\typog@inverted@exclamationmark@ii}
8989 {\textexclamdown}
8990 % \end{macrocode}
8991 % \end{macro}
8992 %
8993 % \begin{macro}{\typog@inverted@questionmark@ii}
8994 % \begin{macrocode}
8995 \newcommand*{\typog@inverted@questionmark@ii}
8996 {\textquestiondown}
8997 % \end{macrocode}
8998 % \end{macro}
8999 %
9000 % \begin{macro}{\typog@inverted@exclamationmark@iii}
9001 % \begin{macrocode}
9002 \newcommand*{\typog@inverted@exclamationmark@iii}
9003 {\textexclamdown}
9004 % \end{macrocode}
9005 % \end{macro}
9006 %
9007 % \begin{macro}{\typog@inverted@questionmark@iii}
9008 % \begin{macrocode}
9009 \newcommand*{\typog@inverted@questionmark@iii}
9010 {\textquestiondown}
9011 % \end{macrocode}
9012 % \end{macro}
9013 %
9014 % \begin{macro}{\typog@raise@inverted@mark}
9015 % The generic \singlequotes{raise}-macro handles all interesting cases. The first argument
9016 % selects the mark type and the second the associated raise-amount.
9017 %
9018 % If the raise-amount is exactly zero we shift-up the horizontal box with the mark to zero
9019 % its depth.
9020 %
9021 % \begin{macrocode}
9022 \newcommand*{\typog@raise@inverted@mark}[2]
9023 {\letcs{\@tempa}{typog@inverted@#1@\romannumeral#2}%
9024 \letcs{\@tempb}{typog@config@raiseinvertedmarks@\romannumeral#2}%
9025 \ifdim\@tempb=\z@
9026 \setbox0=\hbox{\@tempa}%
9027 \dimen0=\dp0
9028 \else
9029 \dimen0=\@tempb
9030 \fi
9031 \raisebox{\dimen0}{\@tempa}}
9032 % \end{macrocode}
9033 % \end{macro}
9034 %
9035 % The user-side macros are almost trivial now.
9036 %
9037 % \begin{macro}{\capitalinvertedexclamationmark}
9038 % \changes{v0.5}{2024-09-21}{New macro.}
9039 % \begin{macrocode}
9040 \NewDocumentCommand{\capitalinvertedexclamationmark}{m}
9041 {\typog@raise@inverted@mark{exclamationmark}{#1}%
9042 \typog@allowhyphenation}
9043 % \end{macrocode}
9044 %
9045 % \acronym{PDF}-substitute definition
9046 %
9047 % \begin{macrocode}
9048 \typog@register@pdfsubstitute{
9049 \def\capitalinvertedexclamationmark#1{%
9050 \csname typog@inverted@exclamationmark@\romannumeral#1\endcsname
9051 }
9052 }
9053 % \end{macrocode}
9054 % \end{macro}
9055 %
9056 % \begin{macro}{\capitalinvertedquestionmark}
9057 % \changes{v0.5}{2024-09-21}{New macro.}
9058 % \begin{macrocode}
9059 \NewDocumentCommand{\capitalinvertedquestionmark}{m}
9060 {\typog@raise@inverted@mark{questionmark}{#1}%
9061 \typog@allowhyphenation}
9062 % \end{macrocode}
9063 %
9064 % \acronym{PDF}-substitute definition
9065 %
9066 % \begin{macrocode}
9067 \typog@register@pdfsubstitute{
9068 \def\capitalinvertedquestionmark#1{%
9069 \csname typog@inverted@questionmark@\romannumeral#1\endcsname
9070 }
9071 }
9072 % \end{macrocode}
9073 % \end{macro}
9074 %
9075 %
9076 % \subsection[Vert. Adjust Label Items]{Vertically Adjusted Label Items}
9077 %
9078 % \begin{macro}{\@typog@uppercase@adjust@labelitem}
9079 % Handle all possible requests for uppercase label item correction.
9080 % Patch |itemize|~environments.
9081 %
9082 % \begin{macrocode}
9083 \newcommand*{\@typog@uppercase@adjust@labelitem}[1]
9084 {\@typog@maybe@patch@itemize
9085 \ifstrequal{#1}{*}
9086 {\setlength{\typog@adjust@labelitemi}
9087 {\typog@adjust@uppercase@labelitemi}%
9088 \setlength{\typog@adjust@labelitemii}
9089 {\typog@adjust@uppercase@labelitemii}%
9090 \setlength{\typog@adjust@labelitemiii}
9091 {\typog@adjust@uppercase@labelitemiii}%
9092 \setlength{\typog@adjust@labelitemiv}
9093 {\typog@adjust@uppercase@labelitemiv}}
9094 {\ifcase #1% 0
9095 \relax % outside of any itemize environment
9096 \or % 1
9097 \setlength{\typog@adjust@labelitemi}
9098 {\typog@adjust@uppercase@labelitemi}%
9099 \or % 2
9100 \setlength{\typog@adjust@labelitemii}
9101 {\typog@adjust@uppercase@labelitemii}%
9102 \or % 3
9103 \setlength{\typog@adjust@labelitemiii}
9104 {\typog@adjust@uppercase@labelitemiii}%
9105 \or % 4
9106 \setlength{\typog@adjust@labelitemiv}
9107 {\typog@adjust@uppercase@labelitemiv}%
9108 \else
9109 \PackageError{typog}
9110 {Itemize level out of range}
9111 {Valid levels are 1, 2, 3, 4, and *}
9112 \fi}}
9113
9114 % \end{macrocode}
9115 % \end{macro}
9116 %
9117 % \begin{macro}{\@typog@lowercase@adjust@labelitem}
9118 % Handle all possible requests for lowercase label item correction.
9119 % Patch |itemize|~environments.
9120 %
9121 % \begin{macrocode}
9122 \newcommand*{\@typog@lowercase@adjust@labelitem}[1]
9123 {\@typog@maybe@patch@itemize
9124 \ifstrequal{#1}{*}
9125 {\setlength{\typog@adjust@labelitemi}
9126 {\typog@adjust@lowercase@labelitemi}%
9127 \setlength{\typog@adjust@labelitemii}
9128 {\typog@adjust@lowercase@labelitemii}%
9129 \setlength{\typog@adjust@labelitemiii}
9130 {\typog@adjust@lowercase@labelitemiii}%
9131 \setlength{\typog@adjust@labelitemiv}
9132 {\typog@adjust@lowercase@labelitemiv}}
9133 {\ifcase #1% 0
9134 \relax % outside of any itemize environment
9135 \or % 1
9136 \setlength{\typog@adjust@labelitemi}
9137 {\typog@adjust@lowercase@labelitemi}%
9138 \or % 2
9139 \setlength{\typog@adjust@labelitemii}
9140 {\typog@adjust@lowercase@labelitemii}%
9141 \or % 3
9142 \setlength{\typog@adjust@labelitemiii}
9143 {\typog@adjust@lowercase@labelitemiii}%
9144 \or % 4
9145 \setlength{\typog@adjust@labelitemiv}
9146 {\typog@adjust@lowercase@labelitemiv}%
9147 \else
9148 \PackageError{typog}
9149 {Itemize level out of range}
9150 {Valid levels are 1, 2, 3, 4, and *}
9151 \fi}}
9152
9153 % \end{macrocode}
9154 % \end{macro}
9155 %
9156 % \begin{macro}{\@typog@noadjust@labelitem}
9157 % Neutralize all label item corrections.
9158 % This function \emph{does not} request patching any |itemize|~environment!
9159 %
9160 % \begin{macrocode}
9161 \newcommand*{\@typog@noadjust@labelitem}[1]
9162 {\ifstrequal{#1}{*}
9163 {\setlength{\typog@adjust@labelitemi}{\z@}%
9164 \setlength{\typog@adjust@labelitemii}{\z@}%
9165 \setlength{\typog@adjust@labelitemiii}{\z@}%
9166 \setlength{\typog@adjust@labelitemiv}{\z@}}
9167 {\ifcase #1% 0
9168 \relax % outside of any itemize environment
9169 \or % 1
9170 \setlength{\typog@adjust@labelitemi}{\z@}%
9171 \or % 2
9172 \setlength{\typog@adjust@labelitemii}{\z@}%
9173 \or % 3
9174 \setlength{\typog@adjust@labelitemiii}{\z@}%
9175 \or % 4
9176 \setlength{\typog@adjust@labelitemiv}{\z@}%
9177 \else
9178 \PackageError{typog}
9179 {Itemize level out of range}
9180 {Valid levels are 1, 2, 3, 4, and *}
9181 \fi}}
9182
9183 % \end{macrocode}
9184 % \end{macro}
9185 %
9186 % \begin{macro}{\uppercaseadjustlabelitems}
9187 % \changes{v0.4}{2024-05-14}{New macro.}
9188 % User macro that handles lists and the treats the empty list specially. We wrap the code
9189 % into \cs{AfterPreamble} because it may be called in the document's preamble where we don't
9190 % know whether package~\packagename{enumitem} already has been loaded and we can patch its
9191 % variant of \code{itemize}.
9192 %
9193 % \begin{macrocode}
9194 \NewDocumentCommand{\uppercaseadjustlabelitems}{m}
9195 {\AfterPreamble{%
9196 \ifblank{#1}
9197 {\@typog@uppercase@adjust@labelitem{\@itemdepth}}
9198 {\forcsvlist{\@typog@uppercase@adjust@labelitem}{#1}}%
9199 \ignorespaces}}
9200
9201 % \end{macrocode}
9202 % \end{macro}
9203 %
9204 % \begin{macro}{\lowercaseadjustlabelitems}
9205 % \changes{v0.4}{2024-05-14}{New macro.}
9206 % User macro that handles lists and the treats the empty list specially.
9207 %
9208 % \begin{macrocode}
9209 \NewDocumentCommand{\lowercaseadjustlabelitems}{m}
9210 {\AfterPreamble{%
9211 \ifblank{#1}
9212 {\@typog@lowercase@adjust@labelitem{\@itemdepth}}
9213 {\forcsvlist{\@typog@lowercase@adjust@labelitem}{#1}}%
9214 \ignorespaces}}
9215
9216 % \end{macrocode}
9217 % \end{macro}
9218 %
9219 % \begin{macro}{\noadjustlabelitems}
9220 % \changes{v0.4}{2024-05-14}{New macro.}
9221 % User macro that handles lists and the treats the empty list specially.
9222 %
9223 % \begin{macrocode}
9224 \NewDocumentCommand{\noadjustlabelitems}{m}
9225 {\ifblank{#1}
9226 {\@typog@noadjust@labelitem{\@itemdepth}}
9227 {\forcsvlist{\@typog@noadjust@labelitem}{#1}}%
9228 \ignorespaces}
9229
9230 % \end{macrocode}
9231 % \end{macro}
9232 %
9233 % Now we get to the dirty part. All the above definitions do not get called until we hack the
9234 % existing |itemize|-environments, either the one of plain~\LaTeX{} or the one modified by
9235 % package~\packagename{enumitem}.
9236 %
9237 % Here comes the result of \code{latexdef -c article -s itemize}, which was used to derive the
9238 % patch code:
9239 %
9240 % \begin{verbatim}
9241 % \def\itemize{%
9242 % \ifnum \@itemdepth > \thr@@
9243 % \@toodeep
9244 % \else
9245 % \advance\@itemdepth\@ne
9246 % \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
9247 % \expandafter
9248 % \list
9249 % \csname\@itemitem\endcsname
9250 % {\def\makelabel##1{\hss\llap{##1}}}%
9251 % \fi}\end{verbatim}
9252 %
9253 % \begin{macro}{\@typog@itemize@patch}
9254 % This is the additional code we inject into plain \LaTeX's or
9255 % package~\packagename{enumitem}'s \cs{itemize}.
9256 %
9257 % \begin{macrocode}
9258 \newcommand*{\@typog@itemize@patch}
9259 % \end{macrocode}
9260 %
9261 % Save the original definition of \cs{@itemitem} for chain-calling it later on.
9262 %
9263 % \begin{macrocode}
9264 {\letcs{\@typog@old@itemitem}{\@itemitem}
9265 % \end{macrocode}
9266 %
9267 % Sneak in our own macro's name.
9268 %
9269 % \begin{macrocode}
9270 \edef\@itemitem{@typog@labelitem\romannumeral\the\@itemdepth}
9271 % \end{macrocode}
9272 %
9273 % Redefine under the original macro's name so that our code gets called and the old code
9274 % (\cs{@typog@old@itemitem}) is expanded.
9275 %
9276 % \begin{macrocode}
9277 \expandafter\def\csname\@itemitem\endcsname
9278 {\raisebox{\csname typog@adjust@labelitem\romannumeral\the\@itemdepth\endcsname}
9279 {\@typog@old@itemitem}}}
9280
9281 % \end{macrocode}
9282 % \end{macro}
9283 %
9284 % If package~\packagename{enumitem} has been loaded, we use the \emph{same} patch. Here comes
9285 % the result of \code{latexdef -c article -p enumitem -s enit@itemize@i} that explains, why no
9286 % change is required:
9287 %
9288 % \begin{verbatim}
9289 % \def\enit@itemize@i#1#2#3#4{%
9290 % \ifnum #1 > #3 \relax
9291 % \enit@toodeep
9292 % \else
9293 % \enit@prelist\@ne{#1}{#2}%
9294 % \edef\@itemitem{label#2\romannumeral#1}%
9295 % \expandafter
9296 % \enit@list
9297 % \csname\@itemitem\endcsname
9298 % {\let\enit@calc\z@
9299 % \def\makelabel##1{\enit@align{\enit@format{##1}}}%
9300 % \enit@preset{#2}{#1}{#4}%
9301 % \enit@calcleft
9302 % \enit@before
9303 % \enit@negwidth}%
9304 % \enit@keyfirst
9305 % \fi}\end{verbatim}
9306 %
9307 % \begin{macro}{\@typog@patch@itemize}
9308 % Unconditionally apply the patches that are just \emph{single} macro calls to disturb the
9309 % original macros as little as possible. If we detect \packagename{enumitem} to be present
9310 % we modify its definition of \code{itemize} otherwise we wrestle \LaTeX's macro.
9311 %
9312 % \begin{macrocode}
9313 \newcommand*{\@typog@patch@itemize}
9314 {\ifdefined\enit@itemize@i
9315 \patchcmd{\enit@itemize@i}
9316 {\expandafter}
9317 {\@typog@itemize@patch\expandafter}
9318 {\typog@debug@typeout{patching enumitem \string\enit@itemize@i\space succeeded}}
9319 {\PackageError{typog}
9320 {Patching enumitem macro \string\enit@itemize@i\space failed}
9321 {}}%
9322 \else
9323 \patchcmd{\itemize}
9324 {\expandafter}
9325 {\@typog@itemize@patch\expandafter}
9326 {\typog@debug@typeout{patching \string\itemize\space succeeded}}
9327 {\PackageError{typog}
9328 {Patching plain LaTeX macro \string\itemize\space failed}
9329 {}}%
9330 \fi}
9331
9332 % \end{macrocode}
9333 % \end{macro}
9334 %
9335 % \begin{macro}{\@typog@maybe@patch@itemize}
9336 % Apply the patches only once.
9337 %
9338 % \begin{macrocode}
9339 \newbool{@typog@itemize@has@been@patched}
9340 \newcommand*{\@typog@maybe@patch@itemize}
9341 {\ifbool{@typog@itemize@has@been@patched}
9342 {\relax}
9343 {\@typog@patch@itemize
9344 \booltrue{@typog@itemize@has@been@patched}}}
9345
9346 % \end{macrocode}
9347 % \end{macro}
9348 %
9349 % Freestanding height-adjusted label items.
9350 %
9351 % \begin{macro}{\Adjustedlabelitemi}
9352 % \changes{v0.5}{2024-12-30}{New macro.}
9353 % \begin{macrocode}
9354 \NewDocumentCommand{\Adjustedlabelitemi}{}
9355 {\raisebox{\typog@adjust@uppercase@labelitemi}
9356 {\labelitemi}}
9357 % \end{macrocode}
9358 % \end{macro}
9359 %
9360 % \begin{macro}{\adjustedlabelitemi}
9361 % \changes{v0.5}{2024-12-30}{New macro.}
9362 % \begin{macrocode}
9363 \NewDocumentCommand{\adjustedlabelitemi}{}
9364 {\raisebox{\typog@adjust@lowercase@labelitemi}
9365 {\labelitemi}}
9366 % \end{macrocode}
9367 % \end{macro}
9368 %
9369 % \begin{macro}{\Adjustedlabelitemii}
9370 % \changes{v0.5}{2024-12-30}{New macro.}
9371 % \begin{macrocode}
9372 \NewDocumentCommand{\Adjustedlabelitemii}{}
9373 {\raisebox{\typog@adjust@uppercase@labelitemii}
9374 {\labelitemii}}
9375 % \end{macrocode}
9376 % \end{macro}
9377 %
9378 % \begin{macro}{\adjustedlabelitemii}
9379 % \changes{v0.5}{2024-12-30}{New macro.}
9380 % \begin{macrocode}
9381 \NewDocumentCommand{\adjustedlabelitemii}{}
9382 {\raisebox{\typog@adjust@lowercase@labelitemii}
9383 {\labelitemii}}
9384 % \end{macrocode}
9385 % \end{macro}
9386 %
9387 % \begin{macro}{\Adjustedlabelitemiii}
9388 % \changes{v0.5}{2024-12-30}{New macro.}
9389 % \begin{macrocode}
9390 \NewDocumentCommand{\Adjustedlabelitemiii}{}
9391 {\raisebox{\typog@adjust@uppercase@labelitemiii}
9392 {\labelitemiii}}
9393 % \end{macrocode}
9394 % \end{macro}
9395 %
9396 % \begin{macro}{\adjustedlabelitemiii}
9397 % \changes{v0.5}{2024-12-30}{New macro.}
9398 % \begin{macrocode}
9399 \NewDocumentCommand{\adjustedlabelitemiii}{}
9400 {\raisebox{\typog@adjust@lowercase@labelitemiii}
9401 {\labelitemiii}}
9402 % \end{macrocode}
9403 % \end{macro}
9404 %
9405 % \begin{macro}{\Adjustedlabelitemiv}
9406 % \changes{v0.5}{2024-12-30}{New macro.}
9407 % \begin{macrocode}
9408 \NewDocumentCommand{\Adjustedlabelitemiv}{}
9409 {\raisebox{\typog@adjust@uppercase@labelitemiv}
9410 {\labelitemiv}}
9411 % \end{macrocode}
9412 % \end{macro}
9413 %
9414 % \begin{macro}{\adjustedlabelitemiv}
9415 % \changes{v0.5}{2024-12-30}{New macro.}
9416 % \begin{macrocode}
9417 \NewDocumentCommand{\adjustedlabelitemiv}{}
9418 {\raisebox{\typog@adjust@lowercase@labelitemiv}
9419 {\labelitemiv}}
9420
9421 % \end{macrocode}
9422 % \end{macro}
9423 %
9424 % And now for their \acronym{PDF}substitutes.
9425 %
9426 % \begin{macrocode}
9427 \typog@register@pdfsubstitute{
9428 \def\Adjustedlabelitemi{\labelitemi}
9429 \def\adjustedlabelitemi{\labelitemi}
9430 \def\Adjustedlabelitemii{\labelitemii}
9431 \def\adjustedlabelitemii{\labelitemii}
9432 \def\Adjustedlabelitemiii{\labelitemiii}
9433 \def\adjustedlabelitemiii{\labelitemiii}
9434 \def\Adjustedlabelitemiv{\labelitemiv}
9435 \def\adjustedlabelitemiv{\labelitemiv}
9436 }
9437
9438 % \end{macrocode}
9439 %
9440 % Here come our convenience macros to simplify an accurate setup of the label adjustments.
9441 %
9442 % \begin{macro}{\typog@hairline@width}
9443 % Line width of the horizontal reference lines in our convenience macros.
9444 %
9445 % \begin{macrocode}
9446 \newcommand*{\typog@hairline@width}{.125pt}
9447 % \end{macrocode}
9448 % \end{macro}
9449 %
9450 % \begin{macro}{\typogadjuststairsfor}
9451 % The arguments are:
9452 % \#1: \meta{scale-factor},
9453 % \#2: \meta{step-size},
9454 % \#3: \meta{number-of-steps},
9455 % \#4: \meta{sample}, and
9456 % \#5: \cs{labelitem}\meta{N}.
9457 %
9458 % Generate an ascending stairs of argument~\#5.
9459 %
9460 % \begin{macrocode}
9461 \newcommand*{\typogadjuststairsfor}[5]
9462 % \end{macrocode}
9463 %
9464 % Store (half of) the space between two samples in \cs{dimen0}.
9465 %
9466 % \begin{macrocode}
9467 {\dimen0=1pt%
9468 % \end{macrocode}
9469 %
9470 % Load the \meta{number-of-steps} and ensure that it is odd.
9471 %
9472 % \begin{macrocode}
9473 \count0=#3\relax
9474 \unless\ifodd\count0
9475 \advance\count0 by 1%
9476 \fi
9477 % \end{macrocode}
9478 %
9479 % Set the iteration counter.
9480 %
9481 % \begin{macrocode}
9482 \setcounter{typog@@iteration}{1}%
9483 % \end{macrocode}
9484 %
9485 % Put the \meta{sample} into a box so that we can measure it with \cs{ht}.
9486 %
9487 % \begin{macrocode}
9488 \setbox0=\hbox{#4}%
9489 % \end{macrocode}
9490 %
9491 % Box~1 is the accumulator for the raised samples.
9492 %
9493 % \begin{macrocode}
9494 \setbox1=\hbox{}%
9495 % \end{macrocode}
9496 %
9497 % Build the stairs.
9498 %
9499 % \begin{macrocode}
9500 \loop
9501 \ifnum\thetypog@@iteration=\numexpr\count0 / 2\relax
9502 \dimen1=3\dimen0
9503 \else
9504 \dimen1=\dimen0
9505 \fi
9506 \dimen2=\dimexpr#2 * (\thetypog@@iteration - \count0 / 2)\relax
9507 \setbox1=\hbox{\unhbox1\raisebox{\dimen2}{\kern\dimen1 #5\kern\dimen1}}%
9508 \addtocounter{typog@@iteration}{1}%
9509 \unless\ifnum\thetypog@@iteration>\count0
9510 \repeat
9511 % \end{macrocode}
9512 %
9513 % Merge the stairs with a hairline at \#1 times the height of \meta{sample}.
9514 % Answer just a single box.
9515 %
9516 % \begin{macrocode}
9517 \mbox{\rlap{\raisebox{\fpeval{#1}\ht0}{\rule{\wd1}{\typog@hairline@width}}}\box1}}
9518
9519 % \end{macrocode}
9520 % \end{macro}
9521 %
9522 % \begin{macro}{\typogadjuststairs}
9523 % \changes{v0.4}{2024-05-14}{New macro.}
9524 % The arguments are:
9525 % \#1: \meta{scale-factor},
9526 % \#2: \meta{step-size},
9527 % \#3: \meta{number-of-steps}, and
9528 % \#4: \meta{sample}.
9529 %
9530 % \begin{macrocode}
9531 \NewDocumentCommand{\typogadjuststairs}{O{.5} m m m}
9532 {\begingroup
9533 \unless\ifdim #2>\z@
9534 \PackageError{typog}
9535 {\string\typogadjuststairs\space non-positive step-size}
9536 {step-size must be a positive dimension}%
9537 \fi
9538 \ifnum #3<1
9539 \PackageError{typog}
9540 {\string\typogadjuststairs\space too few number-of-steps}
9541 {number-of-steps must at least be 1}%
9542 \fi
9543 \ifblank{#4}
9544 {\PackageError{typog}
9545 {sample must not be empty}
9546 {supply either some uppercase or some lowercase letters}}
9547 {}%
9548 \def\arraystretch{1}%
9549 \begin{tabular}{@{}c@{}}
9550 \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemi} \\
9551 \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemii} \\
9552 \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemiii} \\
9553 \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemiv}
9554 \end{tabular}
9555 \endgroup}
9556
9557 % \end{macrocode}
9558 % \end{macro}
9559 %
9560 % \begin{macro}{\typog@uppercase@adjusted@labelitems}
9561 % Return all four labelitems in a horizontal box after they have been adjusted with the
9562 % uppercase-constants set.
9563 %
9564 % \begin{macrocode}
9565 \newcommand*{\typog@uppercase@adjusted@labelitems}
9566 {\hbox{\raisebox{\typog@adjust@uppercase@labelitemi}{\labelitemi}%
9567 \raisebox{\typog@adjust@uppercase@labelitemii}{\labelitemii}%
9568 \raisebox{\typog@adjust@uppercase@labelitemiii}{\labelitemiii}%
9569 \raisebox{\typog@adjust@uppercase@labelitemiv}{\labelitemiv}}}
9570 % \end{macrocode}
9571 % \end{macro}
9572 %
9573 % \begin{macro}{\typoguppercaseadjustcheck}
9574 % \changes{v0.4}{2024-05-14}{New macro.}
9575 % We stuff the user's sample text into a box only to measure its height. We typeset all four
9576 % labels and draw a hairline at half the height of the sample right through it.
9577 %
9578 % \begin{macrocode}
9579 \NewDocumentCommand{\typoguppercaseadjustcheck}{O{.5} m}
9580 {\setbox0=\hbox{#2}%
9581 \setbox1=\typog@uppercase@adjusted@labelitems
9582 \mbox{\rlap{\raisebox{\fpeval{#1}\ht0}
9583 {\rule{\wd1}{\typog@hairline@width}}}%
9584 \box1}}
9585
9586 % \end{macrocode}
9587 % \end{macro}
9588 %
9589 % \begin{macro}{\typog@lowercase@adjusted@labelitems}
9590 % Return all four labelitems in a horizontal box after they have been adjusted with the
9591 % lowercase-constants set.
9592 %
9593 % \begin{macrocode}
9594 \newcommand*{\typog@lowercase@adjusted@labelitems}
9595 {\hbox{\raisebox{\typog@adjust@lowercase@labelitemi}{\labelitemi}%
9596 \raisebox{\typog@adjust@lowercase@labelitemii}{\labelitemii}%
9597 \raisebox{\typog@adjust@lowercase@labelitemiii}{\labelitemiii}%
9598 \raisebox{\typog@adjust@lowercase@labelitemiv}{\labelitemiv}}}
9599 % \end{macrocode}
9600 % \end{macro}
9601 %
9602 % \begin{macro}{\typoglowercaseadjustcheck}
9603 % \changes{v0.4}{2024-05-14}{New macro.}
9604 % Same code as \cs{typoguppercaseadjustcheck} for lowercase.
9605 %
9606 % \begin{macrocode}
9607 \NewDocumentCommand{\typoglowercaseadjustcheck}{O{.5} m}
9608 {\setbox0=\hbox{#2}%
9609 \setbox1=\typog@lowercase@adjusted@labelitems
9610 \mbox{\rlap{\raisebox{\fpeval{#1}\ht0}
9611 {\rule{\wd1}{\typog@hairline@width}}}%
9612 \box1}}
9613
9614 % \end{macrocode}
9615 % \end{macro}
9616 %
9617 %
9618 % \subsection[Align Last Line]{Align Last Line of a Paragraph}
9619 %
9620 % The code of environment |lastlineraggedleftpar|
9621 % has been inspired by macro~\cs{lastlineraggedleft}~\cite[Sec.~2]{wilson:2007}.
9622 %
9623 % \begin{environment}{lastlineraggedleftpar}
9624 % \begin{macrocode}
9625 \NewDocumentEnvironment{lastlineraggedleftpar}{}
9626 {\lastlinefit=0%
9627 \setlength{\leftskip}{\z@ \@plus 1fil}%
9628 \setlength{\rightskip}{-\leftskip}%
9629 \setlength{\parfillskip}{\leftskip}}
9630 {\par}
9631 % \end{macrocode}
9632 % \end{environment}
9633 %
9634 % \begin{environment}{lastlineflushrightpar}
9635 % Define |lastlineflushrightpar| as an alias of |lastlineraggedleftpar|.
9636 %
9637 % \begin{macrocode}
9638 \let\lastlineflushrightpar=\lastlineraggedleftpar
9639 \let\endlastlineflushrightpar=\endlastlineraggedleftpar
9640
9641 % \end{macrocode}
9642 % \end{environment}
9643 %
9644 % \begin{environment}{lastlinecenteredpar}
9645 % The code of environment |lastlinecenteredpar|
9646 % has been inspired by \textit{Tex By Topic}~\cite[Sec.~18.3.1]{eijkhout:2007}.
9647 %
9648 % \begin{macrocode}
9649 \NewDocumentEnvironment{lastlinecenteredpar}{}
9650 {\lastlinefit=0%
9651 \setlength{\leftskip}{\z@ \@plus .5fil}%
9652 \setlength{\rightskip}{-\leftskip}%
9653 \setlength{\parfillskip}{\z@ \@plus 1fil}}
9654 {\par}
9655
9656 % \end{macrocode}
9657 % \end{environment}
9658 %
9659 %
9660 % \subsection[Fill Last Line]
9661 % {Fill Last Line of a Paragraph}
9662 %
9663 % \begin{environment}{shortenpar}
9664 % \begin{macrocode}
9665 \NewDocumentEnvironment{shortenpar}{}
9666 {\advance\looseness by -1
9667 \ifnum\tracingparagraphs>0
9668 \typeout{@ looseness \the\looseness}%
9669 \fi}
9670 {\par}
9671
9672 % \end{macrocode}
9673 % \end{environment}
9674 %
9675 % \begin{environment}{prolongpar}
9676 % We try to be prudent and inhibit hyphenation of the next-to-last line just in case the
9677 % longer paragraph could be cheaply achieved by hyphenation\leftspacedendash at the
9678 % worst\rightspacedendash of the last word.
9679 %
9680 % \begin{macrocode}
9681 \NewDocumentEnvironment{prolongpar}{}
9682 {\finalhyphendemerits=100000001
9683 \advance\looseness by 1
9684 \ifnum\tracingparagraphs>0
9685 \typeout{@ looseness \the\looseness}%
9686 \fi}
9687 {\par}
9688
9689 % \end{macrocode}
9690 % \end{environment}
9691 %
9692 % \begin{macro}{\typog@covernextindentpar@zero@parindent}
9693 % This auxiliary macro and the following one
9694 % are meant as an easy means to override the defaults
9695 % of the user-visible environment~|covernextindentpar|.
9696 %
9697 % \begin{macrocode}
9698 \newcommand*{\typog@covernextindentpar@zero@parindent}{2em}
9699 % \end{macrocode}
9700 % \end{macro}
9701 %
9702 % \begin{macro}{\typog@covernextindentpar@nonzero@parindent}
9703 % \begin{macrocode}
9704 \newcommand*{\typog@covernextindentpar@nonzero@parindent}{2\parindent}
9705 % \end{macrocode}
9706 % \end{macro}
9707 %
9708 % \begin{environment}{covernextindentpar}
9709 % \begin{macrocode}
9710 \NewDocumentEnvironment{covernextindentpar}{o}
9711 {\IfNoValueTF{#1}
9712 {\ifdim\parindent=\z@
9713 \dimen0=\dimexpr\linewidth - \typog@covernextindentpar@zero@parindent
9714 \else
9715 \dimen0=\dimexpr\linewidth - \typog@covernextindentpar@nonzero@parindent
9716 \fi}
9717 {\dimen0=\dimexpr\linewidth - (#1)}%
9718 \parfillskip=\dimen0 \@minus \dimen0
9719 \relax}
9720 {\par}
9721
9722 % \end{macrocode}
9723 % \end{environment}
9724 %
9725 % \begin{macro}{\typog@openlastlinepar@zero@parindent}
9726 % These auxiliary macros are meant as a means to override the defaults
9727 % of the user-visible environment~|openlastlinepar|.
9728 %
9729 % \begin{macrocode}
9730 \newcommand*{\typog@openlastlinepar@zero@parindent}{2em}
9731 % \end{macrocode}
9732 % \end{macro}
9733 %
9734 % \begin{macro}{\typog@openlastlinepar@nonzero@parindent}
9735 % \begin{macrocode}
9736 \newcommand*{\typog@openlastlinepar@nonzero@parindent}{2\parindent}
9737 % \end{macrocode}
9738 % \end{macro}
9739 %
9740 % \begin{environment}{openlastlinepar}
9741 % Compare with the suggestion in reference~\citenum{wermuth:2018}.
9742 %
9743 % \begin{macrocode}
9744 \NewDocumentEnvironment{openlastlinepar}{o}
9745 {\IfNoValueTF{#1}
9746 {\ifdim\parindent=\z@
9747 \skip0=\typog@openlastlinepar@zero@parindent
9748 \@plus 1fil
9749 \@minus \typog@openlastlinepar@zero@parindent
9750 \else
9751 \skip0=\typog@openlastlinepar@nonzero@parindent
9752 \@plus 1fil
9753 \@minus \typog@openlastlinepar@nonzero@parindent
9754 \fi}
9755 {\dimen0=\dimexpr#1\relax
9756 \skip0=\dimen0 \@plus 1fil \@minus \dimen0}
9757 \parfillskip=\skip0}
9758 {\par}
9759
9760 % \end{macrocode}
9761 % \end{environment}
9762 %
9763 % \begin{environment}{lastlinefitpar}
9764 % \changes{v0.5}{2024-09-10}{New environment.}
9765 % Set value of \cs{lastlinefit} for a paragraph.
9766 %
9767 % \begin{macrocode}
9768 \NewDocumentEnvironment{lastlinefitpar}{O{1000}}
9769 {\lastlinefit=#1\relax}
9770 {\par}
9771
9772 % \end{macrocode}
9773 % \end{environment}
9774 %
9775 %
9776 % \subsection{Spacing}
9777 %
9778 % \begin{macro}{\widespacestrength}
9779 % Weight factor (``strength'') for \cs{fontdimen7}, the extra width of a sentence-ending
9780 % space, we apply to construct our \cs{widespace} if \(\cs{fontdimen7} \not= 0\). Can be
9781 % increased to get a more pronounced effect.
9782 %
9783 % \begin{macrocode}
9784 \newcommand*{\widespacestrength}{1.}
9785 % \end{macrocode}
9786 % \end{macro}
9787 %
9788 % \begin{macro}{\widespacescale}
9789 % Scale factor we apply to the glue of the normal space to setup the glue of our
9790 % \cs{widespacescale}. Also used in the fall-back calculation for the width if
9791 % \(\cs{fontdimen7} = 0\).
9792 %
9793 % \begin{macrocode}
9794 \newcommand*{\widespacescale}{1.125}
9795 % \end{macrocode}
9796 % \end{macro}
9797 %
9798 % \begin{macro}{\widespace}
9799 % \changes{v0.2}{2024-3-29}{Add fallback if \cs{fontdimen7} is zero. Extend with a starred version.}
9800 % \begin{macrocode}
9801 \NewDocumentCommand{\widespace}{s}
9802 {\IfBooleanTF{#1}%
9803 {\dimen0=\widespacescale\fontdimen2\font}%
9804 {\ifdim\fontdimen7\font=\z@
9805 \dimen0=\widespacescale\fontdimen2\font
9806 \else
9807 \dimen0=\dimexpr\fontdimen2\font +
9808 \widespacestrength\fontdimen7\font
9809 \fi}%
9810 \hskip \glueexpr\dimen0
9811 \@plus \widespacescale\fontdimen3\font
9812 \@minus \widespacescale\fontdimen4\font
9813 \ignorespaces}
9814
9815 % \end{macrocode}
9816 % \end{macro}
9817 %
9818 % \begin{macro}{\narrowspacestrength}
9819 % Weight factor (``strength'') for \cs{fontdimen7}, the extra width of a sentence-ending
9820 % space, we apply to construct our \cs{narrowspace} if \(\cs{fontdimen7} \not= 0\). Can be
9821 % increased to get a more pronounced effect.
9822 %
9823 % \begin{macrocode}
9824 \newcommand*{\narrowspacestrength}{.5}
9825 % \end{macrocode}
9826 % \end{macro}
9827 %
9828 % \begin{macro}{\narrowspacescale}
9829 % Scale factor we apply to the glue of the normal space to setup the glue of our
9830 % \cs{narrowspacescale}. Also used in the fall-back calculation for the width if
9831 % \(\cs{fontdimen7} = 0\).
9832 %
9833 % \begin{macrocode}
9834 \newcommand*{\narrowspacescale}{.9375}
9835 % \end{macrocode}
9836 % \end{macro}
9837 %
9838 % \begin{macro}{\narrowspace}
9839 % \changes{v0.2}{2024-3-29}{New macro.}
9840 % \begin{macrocode}
9841 \NewDocumentCommand{\narrowspace}{s}
9842 {\IfBooleanTF{#1}%
9843 {\dimen0=\narrowspacescale\fontdimen2\font}%
9844 {\ifdim\fontdimen7\font=\z@
9845 \dimen0=\narrowspacescale\fontdimen2\font
9846 \else
9847 \dimen0=\dimexpr\fontdimen2\font -
9848 \narrowspacestrength\fontdimen7\font
9849 \fi}%
9850 \hskip \glueexpr\dimen0
9851 \@plus \narrowspacescale\fontdimen3\font
9852 \@minus \narrowspacescale\fontdimen4\font
9853 \ignorespaces}
9854
9855 % \end{macrocode}
9856 % \end{macro}
9857 %
9858 %
9859 % See also: TeX by Topic \cite[ch.~20, p.~185\figuredash190]{eijkhout:2007}.
9860 %
9861 % \begin{environment}{loosespacing}
9862 % \begin{macrocode}
9863 \NewDocumentEnvironment{loosespacing}{O{1}}
9864 {\dimen2=\fontdimen2\font
9865 \ifcase #1
9866 \spaceskip=\z@
9867 \or % 1 +5%
9868 \spaceskip=1.05\dimen2 \@plus .5\dimen2 \@minus .1\dimen2
9869 \or % 2 +10%
9870 \spaceskip=1.1\dimen2 \@plus .5\dimen2 \@minus .1\dimen2
9871 \or % 3 +20%
9872 \spaceskip=1.2\dimen2 \@plus .6\dimen2 \@minus .2\dimen2
9873 \else % >= 4 +30%
9874 \spaceskip=1.3\dimen2 \@plus .8\dimen2 \@minus .3\dimen2
9875 \fi
9876 \ignorespaces}
9877 {\ignorespacesafterend}
9878
9879 % \end{macrocode}
9880 % \end{environment}
9881 %
9882 % \begin{environment}{tightspacing}
9883 % \begin{macrocode}
9884 \NewDocumentEnvironment{tightspacing}{O{1}}
9885 {\dimen2=\fontdimen2\font
9886 \ifcase #1
9887 \spaceskip=\z@
9888 \or % 1 -1.25%
9889 \spaceskip=.9875\dimen2 \@plus .0125\dimen2 \@minus .5\dimen2
9890 \or % 2 -2.5%
9891 \spaceskip=.975\dimen2 \@plus .025\dimen2 \@minus .5\dimen2
9892 \or % 3 -5%
9893 \spaceskip=.95\dimen2 \@plus .05\dimen2 \@minus .5\dimen2
9894 \else % >= 4 -10%
9895 \spaceskip=.9\dimen2 \@plus .1\dimen2 \@minus .5\dimen2
9896 \fi
9897 \ignorespaces}
9898 {\ignorespacesafterend}
9899
9900 % \end{macrocode}
9901 % \end{environment}
9902 %
9903 %
9904 % \subsection{\packagename{Microtype} Front\capitalhyphen End}
9905 %
9906 % \subsubsection*{Tracking}
9907 %
9908 % \begin{environment}{setfonttracking}
9909 %
9910 % To achieve the control we want,
9911 % we must tinker with \packagename{microtype's} internals.
9912 % Doh!
9913 %
9914 % \begin{macrocode}
9915 \NewDocumentEnvironment{setfonttracking}{m}
9916 {\edef\MT@letterspace@{#1}%
9917 \lsstyle
9918 \ignorespaces}
9919 {\ignorespacesafterend}
9920
9921 % \end{macrocode}
9922 % \end{environment}
9923 %
9924 %
9925 % \subsubsection*{Font Expansion}
9926 %
9927 % \begin{macro}{\typog@setup@font@expansion}
9928 % Note that we cannot factor the encodings into a macro;
9929 % a single encoding would qualify, though.
9930 % We need to support multiple encodings and thus go with the literal solution.
9931 %
9932 % \begin{macrocode}
9933 \newcommand*{\typog@setup@font@expansion}
9934 {\SetExpansion
9935 [context = typog@shrink1,
9936 shrink = \typog@shrink@i,
9937 stretch = 0]%
9938 {encoding = {*}}%
9939 {}
9940 \SetExpansion
9941 [context = typog@shrink2,
9942 shrink = \typog@shrink@ii,
9943 stretch = 0]%
9944 {encoding = {*}}%
9945 {}
9946 \SetExpansion
9947 [context = typog@shrink3,
9948 shrink = \typog@shrink@iii,
9949 stretch = 0]%
9950 {encoding = {*}}%
9951 {}
9952
9953 \SetExpansion
9954 [context = typog@stretch1,
9955 shrink = 0,
9956 stretch = \typog@stretch@i]%
9957 {encoding = {*}}%
9958 {}
9959 \SetExpansion
9960 [context = typog@stretch2,
9961 shrink = 0,
9962 stretch = \typog@stretch@ii]%
9963 {encoding = {*}}%
9964 {}
9965 \SetExpansion
9966 [context = typog@stretch3,
9967 shrink = 0,
9968 stretch = \typog@stretch@iii]%
9969 {encoding = {*}}%
9970 {}
9971
9972 \SetExpansion
9973 [context = typog@expand1,
9974 shrink = \typog@shrink@i,
9975 stretch = \typog@stretch@i]%
9976 {encoding = {*}}%
9977 {}
9978 \SetExpansion
9979 [context = typog@expand2,
9980 shrink = \typog@shrink@ii,
9981 stretch = \typog@stretch@ii]%
9982 {encoding = {*}}%
9983 {}
9984 \SetExpansion
9985 [context = typog@expand3,
9986 shrink = \typog@shrink@iii,
9987 stretch = \typog@stretch@iii]%
9988 {encoding = {*}}%
9989 {}}
9990 % \end{macrocode}
9991 % \end{macro}
9992 %
9993 % \begin{macro}{\typog@test@microtype@expansion@feature}
9994 % We cannot even parse the \cs{iftypog@microtype@preloaded}~part further down
9995 % unless the \cs{ifMT@expansion}~conditional exists.
9996 % So, we hoist this test in a macro of its own.
9997 % It only gets called if package~\packagename{microtype} already has been sourced.
9998 %
9999 % \begin{macrocode}
10000 \newcommand*{\typog@test@microtype@expansion@feature}
10001 {\ifMT@expansion
10002 \typog@typeout{microtype preloaded -- font expansion features available}%
10003 \def\typog@require@microtype@expansion{\relax}
10004 \typog@setup@font@expansion
10005 \else
10006 \PackageWarning{typog}{microtype preloaded,\space
10007 but font expansion is disabled}%
10008 \def\typog@require@microtype@expansion
10009 {\PackageError{typog}
10010 {microtype font expansion disabled}
10011 {pass option `expansion' to package microtype}}
10012 \fi}
10013 % \end{macrocode}
10014 % \end{macro}
10015 %
10016 % \begin{macro}{\typog@require@microtype@expansion}
10017 % We are all set for the initialization of the font expansion,
10018 % however, we must be careful in which (load-)state
10019 % package~\packagename{microtype} is in.
10020 % Compare with the code for \cs{typog@require@microtype}
10021 % and~\cs{typog@require@preloaded@microtype}.
10022 %
10023 % Initialize our own flag and setup meaningful messages for later feature checks.
10024 %
10025 % \begin{macrocode}
10026 \iftypog@microtype@preloaded
10027 \typog@test@microtype@expansion@feature
10028 \else
10029 \def\typog@require@microtype@expansion
10030 {\PackageError{typog}%
10031 {package microtype not (pre-)loaded, %
10032 which is required for typog's font expansion}%
10033 {require package microtype before package typog}}
10034 \fi
10035
10036 % \end{macrocode}
10037 % \end{macro}
10038 %
10039 % \begin{environment}{setfontshrink}
10040 % \begin{macrocode}
10041 \NewDocumentEnvironment{setfontshrink}{O{1}}
10042 {\typog@require@microtype@expansion
10043 \ifcase#1% 0
10044 \relax
10045 \or % 1
10046 \microtypecontext{expansion=typog@shrink1}%
10047 \or % 2
10048 \microtypecontext{expansion=typog@shrink2}%
10049 \else % >= 3
10050 \microtypecontext{expansion=typog@shrink3}%
10051 \fi
10052 \ignorespaces}
10053 {\ignorespacesafterend}
10054
10055 % \end{macrocode}
10056 % \end{environment}
10057 %
10058 % \begin{environment}{setfontstretch}
10059 % \begin{macrocode}
10060 \NewDocumentEnvironment{setfontstretch}{O{1}}
10061 {\typog@require@microtype@expansion
10062 \ifcase#1% 0
10063 \relax
10064 \or % 1
10065 \microtypecontext{expansion=typog@stretch1}%
10066 \or % 2
10067 \microtypecontext{expansion=typog@stretch2}%
10068 \else % >= 3
10069 \microtypecontext{expansion=typog@stretch3}%
10070 \fi
10071 \ignorespaces}
10072 {\ignorespacesafterend}
10073
10074 % \end{macrocode}
10075 % \end{environment}
10076 %
10077 % \begin{environment}{setfontexpand}
10078 % \begin{macrocode}
10079 \NewDocumentEnvironment{setfontexpand}{O{1}}
10080 {\typog@require@microtype@expansion
10081 \ifcase#1% 0
10082 \relax
10083 \or % 1
10084 \microtypecontext{expansion=typog@expand1}%
10085 \or % 2
10086 \microtypecontext{expansion=typog@expand2}%
10087 \else % >= 3
10088 \microtypecontext{expansion=typog@expand3}%
10089 \fi
10090 \ignorespaces}
10091 {\ignorespacesafterend}
10092
10093 % \end{macrocode}
10094 % \end{environment}
10095 %
10096 % \begin{environment}{nofontexpansion}
10097 % Implementation: We proceed a different approach with respect to requiring package microtype.
10098 % The semantics of the macro is to switch something off.
10099 % If it is not \singlequotes{on} because the necessary package was not loaded, a no-op is ok.
10100 %
10101 % \begin{macrocode}
10102 \NewDocumentEnvironment{nofontexpansion}{}
10103 {\ifdefined\microtypesetup
10104 \microtypesetup{expansion=false}%
10105 \fi
10106 \ignorespaces}
10107 {\ignorespacesafterend}
10108 % \end{macrocode}
10109 % \end{environment}
10110 %
10111 % \begin{environment}{nofontexpand}
10112 % Define |nofontexpand| as an alias of |nofontexpansion|.
10113 %
10114 % \begin{macrocode}
10115 \let\nofontexpand=\nofontexpansion
10116 \let\endnofontexpand=\endnofontexpansion
10117
10118 % \end{macrocode}
10119 % \end{environment}
10120 %
10121 %
10122 % \subsubsection*{Character Protrusion}
10123 %
10124 % \begin{environment}{nocharprotrusion}
10125 % See \singlequotes{Implementation} comment of |nofontexpansion|.
10126 %
10127 % \begin{macrocode}
10128 \NewDocumentEnvironment{nocharprotrusion}{}
10129 {\ifdefined\microtypesetup
10130 \microtypesetup{protrusion=false}%
10131 \fi
10132 \ignorespaces}
10133 {\ignorespacesafterend}
10134
10135 % \end{macrocode}
10136 % \end{environment}
10137 %
10138 %
10139 % \subsection{Sloppy Paragraphs}
10140 %
10141 % \begin{macro}{\typog@scaled@emergencystretch}
10142 % Compute the correct scale factor for the emergency stretch,
10143 % even if we do not have a valid \cs{linewidth}.
10144 %
10145 % \begin{macrocode}
10146 \newcommand*{\typog@scaled@emergencystretch}[1]
10147 {\emergencystretch=\ifdim\linewidth=\z@
10148 #1%
10149 \else
10150 \dimexpr (#1) * \linewidth / \textwidth
10151 \fi}
10152
10153 % \end{macrocode}
10154 % \end{macro}
10155 %
10156 % \begin{macro}{\slightlysloppy}
10157 % Macro~\cs{slightlysloppy} takes an optional~\meta{sloppiness} index ranging from~0 to~8,
10158 % where~0 means the same as \cs{fussy} and~8 or more works like \cs{sloppy}.
10159 % The default \meta{sloppiness} is~1.
10160 %
10161 % \begin{macrocode}
10162 \NewDocumentCommand{\slightlysloppy}{O{1}}
10163 {\ifcase #1% 0
10164 % \tolerance=200
10165 % \emergencystretch=\z@
10166 % \hfuzz=.1\p@
10167 % \vfuzz=\hfuzz
10168 \fussy
10169 \or % 1
10170 \pretolerance=165%
10171 \tolerance=330%
10172 \typog@scaled@emergencystretch{.375em}%
10173 \hfuzz=.15\p@
10174 \vfuzz=\hfuzz
10175 \or % 2
10176 \pretolerance=265%
10177 \tolerance=530%
10178 \typog@scaled@emergencystretch{.75em}%
10179 \hfuzz=.15\p@
10180 \vfuzz=\hfuzz
10181 \or % 3
10182 \pretolerance=435%
10183 \tolerance=870%
10184 \typog@scaled@emergencystretch{1.125em}%
10185 \hfuzz=.2\p@
10186 \vfuzz=\hfuzz
10187 \or % 4
10188 \pretolerance=705%
10189 \tolerance=1410%
10190 \typog@scaled@emergencystretch{1.5em}%
10191 \hfuzz=.3\p@
10192 \vfuzz=\hfuzz
10193 \or % 5
10194 \pretolerance=1155%
10195 \tolerance=2310%
10196 \typog@scaled@emergencystretch{1.875em}%
10197 \hfuzz=.35\p@
10198 \vfuzz=\hfuzz
10199 \or % 6
10200 \pretolerance=1880%
10201 \tolerance=3760%
10202 \typog@scaled@emergencystretch{2.25em}%
10203 \hfuzz=.4\p@
10204 \vfuzz=\hfuzz
10205 \or % 7
10206 \pretolerance=3065%
10207 \tolerance=6130%
10208 \typog@scaled@emergencystretch{2.625em}%
10209 \hfuzz=.45\p@
10210 \vfuzz=\hfuzz
10211 \else % >= 8
10212 % \tolerance=9999
10213 % \emergencystretch=3em
10214 % \hfuzz=.5\p@
10215 % \vfuzz=\hfuzz
10216 \sloppy
10217 \fi
10218 \ignorespaces}
10219 % \end{macrocode}
10220 % \end{macro}
10221 %
10222 % \begin{implementationnote}
10223 % \begin{itemize}
10224 % \item The \cs{tolerance}~values are calculated as the geometric mean of the extreme
10225 % values~200 and~9999. This means the factor
10226 % \begin{equation*}
10227 % f = \Big(\frac{9999}{200}\Big)^{1/8} \approx 1.63
10228 % \end{equation*}
10229 % defines additional tolerances which we generously round values in the actual
10230 % implementation.
10231 %
10232 % \item The \cs{emergencystretch} is scaled linearly with \meta{sloppiness} \emph{and} the
10233 % ratio of the actual \cs{linewidth} to the (maximum) \cs{textwidth}.
10234 %
10235 % \item The \cs{hfuzz}~values are interpolated linearly with \meta{sloppiness} between .1pt
10236 % and~.5pt.
10237 % \end{itemize}
10238 %
10239 % Maxima code to calculate the intermediate values.
10240 %
10241 % \begin{description}
10242 % \item[Initialize.] \code{load("list\_functions")\$}
10243 % \item[\cs{tolerance}:] \code{logspace(log10(200), log10(9999), 9), numer;}
10244 % \item[\cs{emergencystretch}:] \code{linspace(0, 3, 9), numer;}
10245 % \item[\cs{hfuzz}:] \code{linspace(.1, .5, 9);}
10246 % \end{description}
10247 % \end{implementationnote}
10248 %
10249 % \begin{environment}{slightlysloppypar}
10250 % \begin{macrocode}
10251 \NewDocumentEnvironment{slightlysloppypar}{O{1}}
10252 {\par\slightlysloppy[#1]\ignorespaces}
10253 {\par}
10254
10255 % \end{macrocode}
10256 % \end{environment}
10257 %
10258 %
10259 % \subsection[Vert.~Tie Paragraphs]{Vertically Partially-Tied Paragraphs}
10260 %
10261 % \begin{macro}{\typog@geometric@mean}
10262 % This is just the usual geometric mean of two values~\(x\) and~\(y\): \(\sqrt{x y}\).
10263 %
10264 % \begin{macrocode}
10265 \ExplSyntaxOn
10266 \newcommand*{\typog@geometric@mean}[2]
10267 {\fp_to_int:n {sqrt((#1) * (#2))}}
10268 \ExplSyntaxOff
10269
10270 % \end{macrocode}
10271 % \end{macro}
10272 %
10273 % \begin{macro}{typog@mean@penalty}
10274 % Reserve a private counter for the geometric-mean penalties.
10275 %
10276 % \begin{macrocode}
10277 \newcounter{typog@mean@penalty}
10278
10279 % \end{macrocode}
10280 % \end{macro}
10281 %
10282 % \begin{macro}{\vtietop}
10283 % \begin{macrocode}
10284 \NewDocumentCommand{\vtietop}{O{3}}
10285 {\setcounter{typog@mean@penalty}
10286 {\typog@geometric@mean{\@M}{\clubpenalty}}%
10287 \typog@debug@typeout{vtietop: penalties \the\@M--\the\value{typog@mean@penalty}--\the\clubpenalty}%
10288 \unless\ifnum\clubpenalty<\@M
10289 \PackageWarning{typog}{vtietop: clubpenalty=\the\clubpenalty\space>= 10000}%
10290 \fi
10291 \ifcase#1% 0
10292 \relax
10293 \or % 1
10294 \relax
10295 \or % 2
10296 \clubpenalties 3
10297 \@M
10298 \value{typog@mean@penalty}
10299 \clubpenalty
10300 \or % 3
10301 \clubpenalties 4
10302 \@M \@M
10303 \value{typog@mean@penalty}
10304 \clubpenalty
10305 \or % 4
10306 \clubpenalties 5
10307 \@M \@M \@M
10308 \value{typog@mean@penalty}
10309 \clubpenalty
10310 \or % 5
10311 \clubpenalties 6
10312 \@M \@M \@M \@M
10313 \value{typog@mean@penalty}
10314 \clubpenalty
10315 \or % 6
10316 \clubpenalties 7
10317 \@M \@M \@M \@M \@M
10318 \value{typog@mean@penalty}
10319 \clubpenalty
10320 \or % 7
10321 \clubpenalties 8
10322 \@M \@M \@M \@M \@M
10323 \value{typog@mean@penalty}
10324 \clubpenalty
10325 \or % 8
10326 \clubpenalties 9
10327 \@M \@M \@M \@M \@M
10328 \value{typog@mean@penalty}
10329 \clubpenalty
10330 \else % >= 9
10331 \clubpenalties 10
10332 \@M \@M \@M \@M \@M \@M \@M \@M
10333 \value{typog@mean@penalty}
10334 \clubpenalty
10335 \fi}
10336
10337 % \end{macrocode}
10338 % \end{macro}
10339 %
10340 % \begin{environment}{vtietoppar}
10341 % \begin{macrocode}
10342 \NewDocumentEnvironment{vtietoppar}{O{3}}
10343 {\vtietop[#1]}
10344 {\par
10345 \ignorespacesafterend}
10346
10347 % \end{macrocode}
10348 % \end{environment}
10349 %
10350 % \begin{macro}{\splicevtietop}
10351 % \begin{macrocode}
10352 \NewDocumentCommand{\splicevtietop}{O{3}}
10353 {\let\typog@old@item=\@item
10354 \def\@item[##1]{\typog@old@item[##1]\vtietop[#1]}%
10355 \ignorespaces}
10356
10357 % \end{macrocode}
10358 %
10359 % We define an extra style for the users of \packagename{enumitem}.
10360 % Its only drawback is that it hard-codes the default number of tied lines~(3).
10361 %
10362 % \begin{macrocode}
10363 \ifdefined\SetEnumitemKey
10364 \SetEnumitemKey{vtietop}{first=\splicevtietop}
10365 \fi
10366
10367 % \end{macrocode}
10368 % \end{macro}
10369 %
10370 % \begin{macro}{\vtiebot}
10371 % \begin{macrocode}
10372 \NewDocumentCommand{\vtiebot}{O{3}}
10373 {\setcounter{typog@mean@penalty}
10374 {\typog@geometric@mean{\@M}{\widowpenalty}}%
10375 \typog@debug@typeout{vtiebot: penalties \the\@M--\the\value{typog@mean@penalty}--\the\widowpenalty}%
10376 \unless\ifnum\widowpenalty<\@M
10377 \PackageWarning{typog}{vtiebot: widowpenalty=\the\widowpenalty\space>= 10000}%
10378 \fi
10379 \ifcase#1% 0
10380 \relax
10381 \or % 1
10382 \relax
10383 \or % 2
10384 \widowpenalties 3
10385 \@M
10386 \value{typog@mean@penalty}
10387 \widowpenalty
10388 \or % 3
10389 \widowpenalties 4
10390 \@M \@M
10391 \value{typog@mean@penalty}
10392 \widowpenalty
10393 \or % 4
10394 \widowpenalties 5
10395 \@M \@M \@M
10396 \value{typog@mean@penalty}
10397 \widowpenalty
10398 \or % 5
10399 \widowpenalties 6
10400 \@M \@M \@M \@M
10401 \value{typog@mean@penalty}
10402 \widowpenalty
10403 \or % 6
10404 \widowpenalties 7
10405 \@M \@M \@M \@M \@M
10406 \value{typog@mean@penalty}
10407 \widowpenalty
10408 \or % 7
10409 \widowpenalties 8
10410 \@M \@M \@M \@M \@M \@M
10411 \value{typog@mean@penalty}
10412 \widowpenalty
10413 \or % 8
10414 \widowpenalties 9
10415 \@M \@M \@M \@M \@M \@M \@M
10416 \value{typog@mean@penalty}
10417 \widowpenalty
10418 \else % >= 9
10419 \widowpenalties 10
10420 \@M \@M \@M \@M \@M \@M \@M \@M
10421 \value{typog@mean@penalty}
10422 \widowpenalty
10423 \fi}
10424
10425 % \end{macrocode}
10426 % \end{macro}
10427 %
10428 % \begin{environment}{vtiebotpar}
10429 % \begin{macrocode}
10430 \NewDocumentEnvironment{vtiebotpar}{O{3}}
10431 {\vtiebot[#1]}
10432 {\par
10433 \ignorespacesafterend}
10434
10435 % \end{macrocode}
10436 % \end{environment}
10437 %
10438 % \begin{macro}{\typog@vtiebotdisp}
10439 % \begin{macrocode}
10440 \NewDocumentCommand{\typog@vtiebotdisp}{m}
10441 {\setcounter{typog@mean@penalty}
10442 {\typog@geometric@mean{\@M}{\displaywidowpenalty}}%
10443 \typog@debug@typeout{vtiebotdisp: penalties \the\@M--\the\value{typog@mean@penalty}--\the\displaywidowpenalty}%
10444 \unless\ifnum\displaywidowpenalty<\@M
10445 \PackageWarning{typog}{vtiebotdisp: displaywidowpenalty=\the\displaywidowpenalty\space>= 10000}%
10446 \fi
10447 \ifcase#1% 0
10448 \relax
10449 \or % 1
10450 \relax
10451 \or % 2
10452 \displaywidowpenalties 3
10453 \@M
10454 \value{typog@mean@penalty}
10455 \displaywidowpenalty
10456 \or % 3
10457 \displaywidowpenalties 4
10458 \@M \@M
10459 \value{typog@mean@penalty}
10460 \displaywidowpenalty
10461 \or % 4
10462 \displaywidowpenalties 5
10463 \@M \@M \@M
10464 \value{typog@mean@penalty}
10465 \displaywidowpenalty
10466 \or % 5
10467 \displaywidowpenalties 6
10468 \@M \@M \@M \@M
10469 \value{typog@mean@penalty}
10470 \displaywidowpenalty
10471 \or % 6
10472 \displaywidowpenalties 7
10473 \@M \@M \@M \@M \@M
10474 \value{typog@mean@penalty}
10475 \displaywidowpenalty
10476 \or % 7
10477 \displaywidowpenalties 8
10478 \@M \@M \@M \@M \@M \@M
10479 \value{typog@mean@penalty}
10480 \displaywidowpenalty
10481 \or % 8
10482 \displaywidowpenalties 9
10483 \@M \@M \@M \@M \@M \@M \@M
10484 \value{typog@mean@penalty}
10485 \displaywidowpenalty
10486 \else % >= 9
10487 \displaywidowpenalties 10
10488 \@M \@M \@M \@M \@M \@M \@M \@M
10489 \value{typog@mean@penalty}
10490 \displaywidowpenalty
10491 \fi}
10492
10493 % \end{macrocode}
10494 % \end{macro}
10495 %
10496 % \begin{environment}{vtiebotdisp}
10497 % \begin{macrocode}
10498 \NewDocumentEnvironment{vtiebotdisp}{O{3}}
10499 {\typog@vtiebotdisp{#1}}
10500 {\ignorespacesafterend}
10501
10502 % \end{macrocode}
10503 % \end{environment}
10504 %
10505 % \begin{environment}{vtiebotdisptoppar}
10506 % \begin{macrocode}
10507 \NewDocumentEnvironment{vtiebotdisptoppar}{O{3}o}
10508 {\postdisplaypenalty=\@M
10509 \predisplaypenalty=10001% in accordance with package `widows-and-orphans'
10510 \edef\typog@@top@lines{\IfNoValueTF{#2}{#1}{#2}}%
10511 \edef\typog@@after@display@math{\vtietop[\typog@@top@lines]}%
10512 \PushPostHook{display}{\aftergroup\typog@@after@display@math}%
10513 \vtiebotdisp[#1]}
10514 {\par
10515 \PopPostHook{display}%
10516 \ignorespacesafterend}
10517
10518 % \end{macrocode}
10519 % \end{environment}
10520 %
10521 %
10522 % \subsection[Breakable Disp.~Eqs.]{Breakable Displayed Equations}
10523 %
10524 % \begin{environment}{breakabledisplay}
10525 % We use a different default, 3, than \cs{allowdisplaybreaks} which utilizes~4 as its
10526 % default.
10527 %
10528 % \begin{macrocode}
10529 \newenvironment*{breakabledisplay}[1][3]
10530 {\allowdisplaybreaks[#1]}
10531 {\ignorespacesafterend}
10532
10533 % \end{macrocode}
10534 % \end{environment}
10535 %
10536 %
10537 % \subsection{\packagename{Setspace} Front End}
10538 %
10539 % \begin{macro}{\typog@iter@limit}
10540 % The maximum number of iterations we perform before bailing out with an error. Can be
10541 % changed by the user if convergence is slow.
10542 %
10543 % \begin{macrocode}
10544 \newcommand*{\typog@setbaselineskip@iter@limit}{10}
10545 % \end{macrocode}
10546 % \end{macro}
10547 %
10548 % \begin{macro}{\typog@setbaselineskip@relative@error}
10549 % The maximum relative error of the ratio we tolerate for the final baselineskip over the
10550 % target baselineskip. Can also be changed by the user if necessary.
10551 %
10552 % \begin{macrocode}
10553 \newcommand*{\typog@setbaselineskip@relative@error}{.001}
10554 % \end{macrocode}
10555 % \end{macro}
10556 %
10557 % \begin{macro}{\typog@setbaselineskip}
10558 % Given the \meta{target-baselineskip} as argument iterate setting \cs{setstretch} until the
10559 % error drops below our threshold.
10560 %
10561 % \begin{macrocode}
10562 \ExplSyntaxOn
10563 \cs_new:Npn \typog@setbaselineskip #1
10564 {
10565 % \end{macrocode}
10566 %
10567 % Initialize our ``emergency-stop'' loop counter.
10568 %
10569 % \begin{macrocode}
10570 \int_set:Nn \l_tmpa_int {1}
10571 \int_set:Nn \l_tmpb_int {\typog@setbaselineskip@iter@limit}
10572 % \end{macrocode}
10573 %
10574 % Note that the call to \cs{glueexpr} is required to consume dimensions that carry
10575 % stretchability via |plus| or |minus|.
10576 %
10577 % \begin{macrocode}
10578 \dim_set:Nn \l_tmpa_dim {\glueexpr #1}
10579
10580 \typog@debug@typeout{\string\setbaselineskip:\space
10581 initial\space baselineskip:\space \the\baselineskip}
10582 \typog@debug@typeout{\string\setbaselineskip:\space
10583 target\space baselineskip:\space \dim_use:N \l_tmpa_dim}
10584
10585 \dim_compare:nNnTF {\baselineskip} > {\c_zero_dim}
10586 {}
10587 {
10588 \PackageError{typog}
10589 {\string\setbaselineskip:\space
10590 baselineskip\space not\space positive}
10591 {}
10592 }
10593
10594 \dim_compare:nNnTF {\l_tmpa_dim} > {\c_zero_dim}
10595 {}
10596 {
10597 \PackageError{typog}
10598 {\string\setbaselineskip:\space target\space
10599 baselineskip\space must\space be\space
10600 positive}
10601 {}
10602 }
10603
10604 \skip_if_eq:nnTF {\l_tmpa_dim} {\glueexpr #1}
10605 {}
10606 {
10607 \PackageWarning{typog}
10608 {\string\setbaselineskip:\space argument\space
10609 is\space a\space skip;\space
10610 will\space ignore\space glue}
10611 {}
10612 }
10613
10614 \fp_set:Nn \l_tmpa_fp {\l_tmpa_dim / \baselineskip}
10615 \fp_until_do:nNnn {abs(\l_tmpa_dim / \baselineskip - 1)} <
10616 {\typog@setbaselineskip@relative@error}
10617 {
10618 \setstretch{\fp_use:N \l_tmpa_fp}
10619 \fp_set:Nn \l_tmpa_fp
10620 {\l_tmpa_fp * \l_tmpa_dim / \baselineskip}
10621
10622 \int_incr:N \l_tmpa_int
10623 \int_compare:nNnTF {\l_tmpa_int} > {\l_tmpb_int}
10624 {
10625 \PackageError{typog}
10626 {\string\setbaselineskip:\space excessive\space
10627 number\space of\space iterations:\space
10628 \int_use:N \l_tmpa_int\space >\space
10629 \int_use:N \l_tmpb_int}
10630 {}
10631 }
10632 {}
10633 }
10634
10635 \typog@debug@typeout{\string\setbaselineskip:\space
10636 final\space \string\setstretch\space argument:\space
10637 \fp_use:N \l_tmpa_fp}
10638 \typog@debug@typeout{\string\setbaselineskip:\space
10639 final\space baselineskip:\space \the\baselineskip}
10640 }
10641
10642 % \end{macrocode}
10643 % \end{macro}
10644 %
10645 % \begin{macro}{\setbaselineskip}
10646 % \changes{v0.3}{2024-04-04}{New macro.}
10647 %
10648 % Set the \cs{baselineskip} to an absolute length.
10649 %
10650 % \begin{implementationnote}
10651 % Viewed as a standalone macro \cs{setbaselineskip} does not need the decoration
10652 % \cs{After\-Preamble}. However, all of its siblings, \cs{set\-baseline\-skip\-percentage},
10653 % \cs{set\-leading}, and \cs{set\-leading\-percentage} then would behave differently as they are
10654 % delayed to the end of the preamble, but \cs{set\-baseline\-skip} immediately becomes
10655 % effective. For example, the successive calls
10656 %
10657 % \begin{codeexample}
10658 % \cs{setbaselineskippercentage}\{140\} \\
10659 % \cs{setbaselineskip}\{12.5pt\}
10660 % \end{codeexample}
10661 %
10662 % \noindent
10663 % in the preamble would set the baselineskip to 140\% in the document. Therefore,
10664 % \cs{setbaselineskip} is delayed too and the order of the calls thus preserved.
10665 % \end{implementationnote}
10666 %
10667 % \begin{macrocode}
10668 \cs_new:Npn \setbaselineskip #1
10669 {
10670 \AfterPreamble{\typog@setbaselineskip{#1}}
10671 \ignorespaces
10672 }
10673
10674 % \end{macrocode}
10675 % \end{macro}
10676 %
10677 % \begin{macro}{\resetbaselineskip}
10678 % \changes{v0.3}{2024-04-04}{New macro.}
10679 %
10680 % Set the \cs{baselineskip} to \singlequotes{neutral}.
10681 %
10682 % \begin{macrocode}
10683 \cs_new:Npn \resetbaselineskip
10684 {
10685 \AfterPreamble{\setstretch{1}}
10686 }
10687
10688 % \end{macrocode}
10689 % \end{macro}
10690 %
10691 % \begin{ldimen}{\typogfontsize}
10692 % \changes{v0.3}{2024-04-04}{New dimen.}
10693 % Define the default font-size/quad size.
10694 %
10695 % \begin{macrocode}
10696 \dim_new:N \typogfontsize
10697 % \end{macrocode}
10698 %
10699 % Initialize \cs{typogfontsize} at the end of the preamble, which is after all fonts have
10700 % been setup.
10701 %
10702 % \begin{macrocode}
10703 \AfterEndPreamble{
10704 \dim_set:Nn \typogfontsize {\fontdimen6\font}
10705 \typog@debug@typeout{\string\typogfontsize =
10706 \dim_use:N \typogfontsize\space
10707 (at\space begin\space of\space document)}
10708 }
10709
10710 % \end{macrocode}
10711 % \end{ldimen}
10712 %
10713 % \begin{macro}{\setbaselineskippercentage}
10714 % \changes{v0.3}{2024-04-04}{New macro.}
10715 % \begin{macrocode}
10716 \cs_new:Npn \setbaselineskippercentage #1
10717 {
10718 \AfterPreamble{
10719 \dim_compare:nNnTF {\typogfontsize} > {\c_zero_dim}
10720 {
10721 \typog@setbaselineskip{
10722 \fp_eval:n {(#1) / 100} \typogfontsize}
10723 }
10724 {
10725 \PackageError{typog}
10726 {\string\setbaselineskippercentage:\space
10727 \string\typogfontsize <= 0}
10728 {Maybe\space \string\typogfontsize\space
10729 is\space uninitialized?}
10730 }
10731 }
10732 \ignorespaces
10733 }
10734
10735 % \end{macrocode}
10736 % \end{macro}
10737 %
10738 % \begin{macro}{\setleading}
10739 % \changes{v0.3}{2024-04-04}{New macro.}
10740 % \begin{macrocode}
10741 \cs_new:Npn \setleading #1
10742 {
10743 \AfterPreamble{
10744 \dim_compare:nNnTF {\typogfontsize} > {\c_zero_dim}
10745 {
10746 \typog@setbaselineskip{\typogfontsize + \dimexpr #1}
10747 }
10748 {
10749 \PackageError{typog}
10750 {\string\setleading:\space
10751 \string\typogfontsize <= 0}
10752 {Maybe\space \string\typogfontsize\space
10753 is\space uninitialized?}
10754 }
10755 }
10756 \ignorespaces
10757 }
10758
10759 % \end{macrocode}
10760 % \end{macro}
10761 %
10762 % \begin{macro}{\setleadingpercentage}
10763 % \changes{v0.3}{2024-04-04}{New macro.}
10764 % \begin{macrocode}
10765 \cs_new:Npn \setleadingpercentage #1
10766 {
10767 \AfterPreamble{
10768 \dim_compare:nNnTF {\typogfontsize} > {\c_zero_dim}
10769 {
10770 \typog@setbaselineskip{
10771 \fp_eval:n {1 + (#1) / 100} \typogfontsize}
10772 }
10773 {
10774 \PackageError{typog}
10775 {\string\setleadingpercentage:\space
10776 \string\typogfontsize <= 0}
10777 {Maybe\space \string\typogfontsize\space
10778 is\space uninitialized?}
10779 }
10780 }
10781 \ignorespaces
10782 }
10783 \ExplSyntaxOff
10784
10785 % \end{macrocode}
10786 % \end{macro}
10787 %
10788 %
10789 % \subsection{Smooth Ragged}
10790 %
10791 % \begin{macro}{\typog@repeat}
10792 % As we shall have to repeat the line specifications for our paragraphs so often we introduce
10793 % the two argument macro~\cs{typog@repeat} that takes a \meta{repeat-count} and a \meta{body}
10794 % that is repeated.
10795 %
10796 % \begin{macrocode}
10797 \ExplSyntaxOn
10798 \cs_new_eq:NN \typog@repeat \prg_replicate:nn
10799
10800 % \end{macrocode}
10801 % \end{macro}
10802 %
10803 %
10804 % \begin{macro}{\typog@mod}
10805 % For error checking we shall need the modulo operation on integers, i.\,e., the remainder of
10806 % an integral division.
10807 %
10808 % \begin{macrocode}
10809 \newcommand*{\typog@mod}[2]{\int_mod:nn{#1}{#2}}
10810 \ExplSyntaxOff
10811
10812 % \end{macrocode}
10813 % \end{macro}
10814 %
10815 % \begin{macro}{\typog@triplet@max@lines}
10816 % Maximum number of lines a smoothraggedright paragraph can have with the triplet generator.
10817 % The number must be divisible by~3.
10818 %
10819 % \begin{macrocode}
10820 \newcommand*{\typog@triplet@max@lines}{99}
10821
10822 % \end{macrocode}
10823 % \end{macro}
10824 %
10825 % \begin{environment}{smoothraggedrightshapetriplet}
10826 % Engine for 3-line repetitions.
10827 %
10828 % \begin{macrocode}
10829 \define@key[typog]{smoothraggedrightshapetriplet}{leftskip}%
10830 {\def\typog@@triplet@leftskip{#1}}
10831 \define@key[typog]{smoothraggedrightshapetriplet}{parindent}%
10832 {\def\typog@@triplet@parindent{#1}}
10833 \NewDocumentEnvironment{smoothraggedrightshapetriplet}{O{} m m m}
10834 {\def\typog@@triplet@leftskip{\z@}%
10835 \def\typog@@triplet@parindent{\z@}%
10836 \setkeys*[typog]{smoothraggedrightshapetriplet}{#1}%
10837 \skip0=\typog@@triplet@leftskip\relax
10838 \skip1=#2\relax
10839 \skip2=#3\relax
10840 \skip3=#4\relax
10841 \typog@debug@typeout{smoothraggedrightshapetriplet: skip0=\the\skip0}%
10842 \typog@debug@typeout{smoothraggedrightshapetriplet: skip1=\the\skip1}%
10843 \typog@debug@typeout{smoothraggedrightshapetriplet: skip2=\the\skip2}%
10844 \typog@debug@typeout{smoothraggedrightshapetriplet: skip3=\the\skip3}%
10845 \unless\ifnum\typog@mod{\typog@triplet@max@lines}{3}=0
10846 \PackageError{typog}
10847 {Line number of triplet generator\space
10848 (\typog@triplet@max@lines) not divisible by 3}
10849 {}
10850 \fi
10851 \edef\typog@@triplet@linespecs{%
10852 \glueexpr \skip0 + \typog@@triplet@parindent\relax
10853 \glueexpr \skip1 - \typog@@triplet@parindent\relax
10854 \skip0 \skip2 \skip0 \skip3
10855 \typog@repeat{\numexpr\typog@triplet@max@lines / 3 - 1}
10856 {\skip0 \skip1 \skip0 \skip2 \skip0 \skip3}}
10857 \parshape=\typog@triplet@max@lines\typog@@triplet@linespecs\relax}
10858 {\par}
10859
10860 % \end{macrocode}
10861 % \end{environment}
10862 %
10863 %
10864 % \begin{macro}{\typog@quintuplet@max@lines}
10865 % Maximum number of lines a smoothraggedright paragraph can have with the quintuplet
10866 % generator. The number must be divisible by~5.
10867 %
10868 % \begin{macrocode}
10869 \newcommand*{\typog@quintuplet@max@lines}{95}
10870
10871 % \end{macrocode}
10872 % \end{macro}
10873 %
10874 % \begin{environment}{smoothraggedrightshapequintuplet}
10875 % Engine for 5-line repetitions.
10876 %
10877 % \begin{macrocode}
10878 \define@key[typog]{smoothraggedrightshapequintuplet}{leftskip}
10879 {\def\typog@@quintuplet@leftskip{#1}}
10880 \define@key[typog]{smoothraggedrightshapequintuplet}{parindent}
10881 {\def\typog@@quintuplet@parindent{#1}}
10882 \NewDocumentEnvironment{smoothraggedrightshapequintuplet}{O{} m m m m m}
10883 {\def\typog@@quintuplet@leftskip{\z@}%
10884 \def\typog@@quintuplet@parindent{\z@}%
10885 \setkeys*[typog]{smoothraggedrightshapequintuplet}{#1}%
10886 \skip0=\typog@@quintuplet@leftskip\relax
10887 \skip1=#2\relax
10888 \skip2=#3\relax
10889 \skip3=#4\relax
10890 \skip4=#5\relax
10891 \skip5=#6\relax
10892 \typog@debug@typeout{smoothraggedrightshapequintuplet: skip0=\the\skip0}%
10893 \typog@debug@typeout{smoothraggedrightshapequintuplet: skip1=\the\skip1}%
10894 \typog@debug@typeout{smoothraggedrightshapequintuplet: skip2=\the\skip2}%
10895 \typog@debug@typeout{smoothraggedrightshapequintuplet: skip3=\the\skip3}%
10896 \typog@debug@typeout{smoothraggedrightshapequintuplet: skip4=\the\skip4}%
10897 \typog@debug@typeout{smoothraggedrightshapequintuplet: skip5=\the\skip5}%
10898 \unless\ifnum\typog@mod{\typog@quintuplet@max@lines}{5}=0
10899 \PackageError{typog}
10900 {Line number of quintuplet generator\space
10901 (\typog@quintuplet@max@lines) not divisible by 5}
10902 {}
10903 \fi
10904 \edef\typog@@quintuplet@linespecs{%
10905 \glueexpr \skip0 + \typog@@quintuplet@parindent\relax
10906 \glueexpr \skip1 - \typog@@quintuplet@parindent\relax
10907 \skip0 \skip2 \skip0 \skip3
10908 \skip0 \skip4 \skip0 \skip5
10909 \typog@repeat{\numexpr\typog@quintuplet@max@lines / 5 - 1}
10910 {\skip0 \skip1 \skip0 \skip2 \skip0 \skip3
10911 \skip0 \skip4 \skip0 \skip5}}
10912 \parshape=\typog@quintuplet@max@lines\typog@@quintuplet@linespecs\relax}
10913 {\par}
10914 % \end{macrocode}
10915
10916 % \end{environment}
10917 %
10918 %
10919 % \begin{macro}{\typog@septuplet@max@lines}
10920 % Maximum number of lines a smoothraggedright paragraph can have with the septuplet
10921 % generator. The number must be divisible by~7.
10922 %
10923 % \begin{macrocode}
10924 \newcommand*{\typog@septuplet@max@lines}{98}
10925
10926 % \end{macrocode}
10927 % \end{macro}
10928 %
10929 % \begin{environment}{smoothraggedrightshapeseptuplet}
10930 % \changes{v0.4a}{2024-08-11}
10931 % {Add missing backslash to \cs{typog@@\-septuplet@\-parindent} in local
10932 % macro~\cs{typog@@\-septuplet@\-linespecs} which rendered
10933 % the septuplet~generator unusable.}
10934 % Engine for 7-line repetitions.
10935 %
10936 % \begin{macrocode}
10937 \define@key[typog]{smoothraggedrightshapeseptuplet}{leftskip}%
10938 {\def\typog@@septuplet@leftskip{#1}}
10939 \define@key[typog]{smoothraggedrightshapeseptuplet}{parindent}%
10940 {\def\typog@@septuplet@parindent{#1}}
10941 \NewDocumentEnvironment{smoothraggedrightshapeseptuplet}{O{} m m m m m m m}
10942 {\def\typog@@septuplet@leftskip{\z@}%
10943 \def\typog@@septuplet@parindent{\z@}%
10944 \setkeys*[typog]{smoothraggedrightshapeseptuplet}{#1}%
10945 \skip0=\typog@@septuplet@leftskip\relax
10946 \skip1=#2\relax
10947 \skip2=#3\relax
10948 \skip3=#4\relax
10949 \skip4=#5\relax
10950 \skip5=#6\relax
10951 \skip6=#7\relax
10952 \skip7=#8\relax
10953 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip0=\the\skip0}%
10954 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip1=\the\skip1}%
10955 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip2=\the\skip2}%
10956 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip3=\the\skip3}%
10957 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip4=\the\skip4}%
10958 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip5=\the\skip5}%
10959 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip6=\the\skip6}%
10960 \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip7=\the\skip7}%
10961 \unless\ifnum\typog@mod{\typog@septuplet@max@lines}{7}=0
10962 \PackageError{typog}
10963 {Line number of septuplet generator\space
10964 (\typog@septuplet@max@lines) not divisible by 7}
10965 {}
10966 \fi
10967 \edef\typog@@septuplet@linespecs{%
10968 \glueexpr \skip0 + \typog@@septuplet@parindent\relax
10969 \glueexpr \skip1 - \typog@@septuplet@parindent\relax
10970 \skip0 \skip2 \skip0 \skip3 \skip0 \skip4
10971 \skip0 \skip5 \skip0 \skip6 \skip0 \skip7
10972 \typog@repeat{\numexpr\typog@septuplet@max@lines / 7 - 1}
10973 {\skip0 \skip1 \skip0 \skip2 \skip0 \skip3 \skip0 \skip4
10974 \skip0 \skip5 \skip0 \skip6 \skip0 \skip7}}
10975 \parshape=\typog@septuplet@max@lines\typog@@septuplet@linespecs\relax}
10976 {\par}
10977
10978 % \end{macrocode}
10979 % \end{environment}
10980 %
10981 % \begin{macro}{\smoothraggedrightfuzzfactor}
10982 % \begin{macrocode}
10983 \newcommand*{\smoothraggedrightfuzzfactor}{1.0}
10984 % \end{macrocode}
10985 % \end{macro}
10986 %
10987 % \begin{macro}{\smoothraggedrightgenerator}
10988 % \begin{macrocode}
10989 \newcommand*{\smoothraggedrightgenerator}{triplet}
10990 % \end{macrocode}
10991 % \end{macro}
10992 %
10993 % \begin{lskip}{\smoothraggedrightleftskip}
10994 % \begin{macrocode}
10995 \newlength{\smoothraggedrightleftskip}
10996 % \end{macrocode}
10997 % \end{lskip}
10998 %
10999 % \begin{lskip}{\smoothraggedrightparindent}
11000 % \begin{macrocode}
11001 \newlength{\smoothraggedrightparindent}
11002 % \end{macrocode}
11003 % \end{lskip}
11004 %
11005 % \begin{lskip}{\smoothraggedrightragwidth}
11006 % \begin{macrocode}
11007 \newlength{\smoothraggedrightragwidth}
11008 \setlength{\smoothraggedrightragwidth}{2em}
11009
11010 % \end{macrocode}
11011 % \end{lskip}
11012 %
11013 % \begin{ldimen}{\typog@fuzzwidth}
11014 % \begin{macrocode}
11015 \newdimen{\typog@fuzzwidth}
11016
11017 % \end{macrocode}
11018 % \end{ldimen}
11019 %
11020 % \begin{environment}{smoothraggedrightpar}
11021 % The longest line will be \cs{linewidth} wide
11022 % unless overridden by optional argument~|linewidth|.
11023 %
11024 % \begin{macrocode}
11025 \define@key[typog]{smoothraggedrightpar}{linewidth}%
11026 {\def\typog@@linewidth{#1}}
11027
11028 % \end{macrocode}
11029 % Convert generator name to an integer suitable for \cs{ifcase}.
11030 % Indicate an unknown name with -1.
11031 % \begin{macrocode}
11032 \ExplSyntaxOn
11033 \cs_new:Npn \typog@generator@index:n #1 {
11034 \str_case:nnTF {#1}
11035 {
11036 {triplet} {0}
11037 {quintuplet} {1}
11038 {septuplet} {2}
11039 }
11040 {}
11041 {-1}
11042 }
11043 \cs_generate_variant:Nn \typog@generator@index:n {e}
11044 \let\typog@generator@index=\typog@generator@index:e
11045 \ExplSyntaxOff
11046
11047 \NewDocumentEnvironment{smoothraggedrightpar}{O{}}
11048 {\edef\typog@@linewidth{\linewidth}%
11049 \setkeys[typog]{smoothraggedrightpar}{#1}%
11050 \edef\typog@@generatorchoice{\typog@generator@index{\smoothraggedrightgenerator}}%
11051 % \end{macrocode}
11052 % Obey to the indentation prescribed by any list environment.
11053 % \begin{macrocode}
11054 \let\typog@@smoothraggedrightleftskip=\smoothraggedrightleftskip
11055 \ifnum\@listdepth>0
11056 \addtolength{\typog@@smoothraggedrightleftskip}{\leftmargin}%
11057 \fi
11058 % \end{macrocode}
11059 % Scale the fuzz-width by the user's factor.
11060 % Later we shall rescale again specifically for each generator.
11061 % \begin{macrocode}
11062 \typog@fuzzwidth=\smoothraggedrightfuzzfactor\smoothraggedrightragwidth
11063 % \end{macrocode}
11064 %
11065 % Now for the generator-specific code \dots
11066 % \begin{macrocode}
11067 \ifcase\typog@@generatorchoice
11068 % \end{macrocode}
11069 %
11070 % |generator=triplet| produces a \doublequotes{short line -- long line -- middle length line}~sequence.
11071 % \begin{macrocode}
11072 \typog@fuzzwidth=.25\smoothraggedrightragwidth
11073 \typog@debug@typeout{smoothraggedright: generator=triplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
11074 \smoothraggedrightshapetriplet[leftskip=\typog@@smoothraggedrightleftskip,
11075 parindent=\glueexpr\smoothraggedrightparindent + \parindent,
11076 #1]%
11077 {\glueexpr \typog@@linewidth - \smoothraggedrightragwidth
11078 + \glueexpr \z@ \@plus \typog@fuzzwidth\relax}% (1)
11079 {\glueexpr \typog@@linewidth \@minus \typog@fuzzwidth}% (3)
11080 {\glueexpr (\typog@@linewidth * 2 - \smoothraggedrightragwidth) / 2
11081 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (2)
11082 \or
11083 % \end{macrocode}
11084 %
11085 % |generator=quintuplet|.
11086 % \begin{macrocode}
11087 \typog@fuzzwidth=.125\smoothraggedrightragwidth
11088 \typog@debug@typeout{smoothraggedright: generator=quintuplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
11089 \smoothraggedrightshapequintuplet[leftskip=\typog@@smoothraggedrightleftskip,
11090 parindent=\glueexpr\smoothraggedrightparindent + \parindent,
11091 #1]%
11092 {\glueexpr (\typog@@linewidth * 4 - \smoothraggedrightragwidth * 3) / 4
11093 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (2)
11094 {\glueexpr \typog@@linewidth \@minus \typog@fuzzwidth\relax}% (5)
11095 {\glueexpr (\typog@@linewidth * 2 - \smoothraggedrightragwidth) / 2
11096 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (3)
11097 {\glueexpr (\typog@@linewidth * 4 - \smoothraggedrightragwidth) / 4
11098 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (4)
11099 {\glueexpr \typog@@linewidth - \smoothraggedrightragwidth
11100 + \glueexpr \z@ \@plus \typog@fuzzwidth\relax}% (1)
11101 \or
11102 % \end{macrocode}
11103 %
11104 % |generator=septuplet|.
11105 %
11106 % Permutation \mbox{3 -- 6 -- 1 -- 5 -- 2 -- 7 -- 4}
11107 % looks \singlequotes{random} enough for our purposes.
11108 %
11109 % \begin{macrocode}
11110 \typog@fuzzwidth=.08333\smoothraggedrightragwidth
11111 \typog@debug@typeout{smoothraggedright: generator=septuplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
11112 \smoothraggedrightshapeseptuplet[leftskip=\typog@@smoothraggedrightleftskip,
11113 parindent=\glueexpr\smoothraggedrightparindent + \parindent,
11114 #1]%
11115 {\glueexpr (\typog@@linewidth * 3 - \smoothraggedrightragwidth * 2) / 3
11116 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (3)
11117 {\glueexpr (\typog@@linewidth * 6 - \smoothraggedrightragwidth) / 6
11118 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (6)
11119 {\glueexpr \typog@@linewidth - \smoothraggedrightragwidth +
11120 + \glueexpr \z@ \@plus \typog@fuzzwidth\relax}% (1)
11121 {\glueexpr (\typog@@linewidth * 3 - \smoothraggedrightragwidth) / 3
11122 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (5)
11123 {\glueexpr (\typog@@linewidth * 6 - \smoothraggedrightragwidth * 5) / 6
11124 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (2)
11125 {\glueexpr \typog@@linewidth \@minus \typog@fuzzwidth\relax}% (7)
11126 {\glueexpr (\typog@@linewidth * 2 - \smoothraggedrightragwidth) / 2
11127 + \glueexpr \z@ \@plus \typog@fuzzwidth \@minus \typog@fuzzwidth\relax}% (4)
11128 \else
11129 \PackageError{typog}
11130 {smoothraggedright: unknown generator name (\smoothraggedrightgenerator)}
11131 {valid generator names are triplet, quintuplet, and septuplet}
11132 \fi}
11133 {\ifcase\typog@@generatorchoice
11134 \endsmoothraggedrightshapetriplet
11135 \or
11136 \endsmoothraggedrightshapequintuplet
11137 \or
11138 \endsmoothraggedrightshapeseptuplet
11139 \fi}
11140
11141 % \end{macrocode}
11142 % \end{environment}
11143 %
11144 % \begin{environment}{smoothraggedright}
11145 % \begin{macrocode}
11146 \NewDocumentEnvironment{smoothraggedright}{O{}}
11147 {\PushPostHook{par}{\hskip-\parindent\smoothraggedrightpar[#1]\relax}}
11148 {\par\PopPostHook{par}}
11149
11150 % \end{macrocode}
11151 % \end{environment}
11152 % \index{package code|)userman}
11153 % \index{code reference|)userman}
11154 %
11155 %
11156 % \iffalse
11157 %</package>
11158 % \fi
11159 %
11160 %
11161 % \addtocontents{toc}{\protect\end{multicols}}
11162 % \addtocontents{toc}{\protect\end{list}}
11163 %
11164 %
11165 % \Finale
11166 %
11167 %
11168 %
11169 % \iffalse
11170 %<*example>
11171 \documentclass[a4paper]{article}
11172
11173 \tracingonline=0
11174
11175 \PassOptionsToPackage{dvipsnames}{xcolor}
11176
11177 \usepackage{amsmath}
11178 \makeatletter\def\bbl@languages{}\makeatother\usepackage[german,english]{babel}
11179 \usepackage{float}
11180 \usepackage[T1]{fontenc}
11181 \usepackage{hyphenat}
11182 \usepackage{mathtools}
11183 \usepackage[activate=true, letterspace=50, verbose=false]{microtype}
11184 \usepackage{ragged2e}
11185 \usepackage[nobottomtitles*]{titlesec}\renewcommand*{\bottomtitlespace}{.2\textheight}
11186 \usepackage{trace}
11187 \usepackage[debug,
11188 trackingttspacing,
11189 uppercaselabelitemadjustments={-0.025em, .075em, .14em, .075em},
11190 lowercaselabelitemadjustments={-.1em, 0pt, .065em, 0pt}]{typog}
11191 \usepackage{xcolor}
11192
11193 \usepackage[loosest, proportional, scaled=1.064]{erewhon}
11194 \usepackage[erewhon]{newtxmath}
11195 \usepackage[scaled=.95]{cabin}
11196 \usepackage{inconsolata}
11197 \usepackage{setspace}\setstretch{1.08333}
11198
11199
11200 \def\xsfdefault{\relax}
11201
11202 \def\examplefont{6}
11203
11204 \ifcase\examplefont % 0 -- document's default sans-serif font (e.g., ecrm1000)
11205 \def\examplefontname{default}
11206 \let\xsf=\sf
11207 \let\xsfdefault=\sfdefault
11208 \or % 1 -- Nunito
11209 \def\examplefontname{Nunito}
11210 \def\xsfdefault{Nunito-TOsF}
11211 \def\xsf{\let\sfdefault=\xsfdefault\sf}
11212 \or % 2 -- OpenSans
11213 \def\examplefontname{OpenSans}
11214 \def\xsfdefault{opensans-TLF}
11215 \def\xsf{\let\sfdefault=\xsfdefault\sf}
11216 \or % 3 -- Noto Sans
11217 \def\examplefontname{Noto Sans}
11218 \def\xsfdefault{NotoSans-TLF}
11219 \def\xsf{\let\sfdefault=\xsfdefault\sf}
11220 \or % 4 -- Roboto
11221 \def\examplefontname{Roboto}
11222 \def\xsfdefault{Roboto-LF}
11223 \def\xsf{\let\sfdefault=\xsfdefault\sf}
11224 \or % 5 -- Montserrat
11225 \def\examplefontname{Montserrat Alternates}
11226 \def\xsfdefault{MontserratAlternates-LF}
11227 \def\xsf{\let\sfdefault=\xsfdefault\sf}
11228 \or % 6 -- Inter
11229 \def\examplefontname{Inter}
11230 \def\xsfdefault{Inter-LF}
11231 \def\xsf{\let\sfdefault=\xsfdefault\sf}
11232 \else
11233 \SelectedUnknownExampleFont
11234 \fi
11235
11236 \typeout{typog-example: font for examples: `\xsfdefault'}%
11237
11238
11239 \usepackage{hyperref}
11240 \usepackage{cleveref}
11241
11242
11243 \hypersetup{
11244 citecolor = CadetBlue,
11245 colorlinks = true,
11246 linkcolor = Blue,
11247 linktocpage = true,
11248 pdfauthor={Dr. Christoph L. Spiel},
11249 pdfkeywords={Examples,
11250 LaTeX, typography, ligature, italic-correction, paragraph justification, sloppy, ragged},
11251 pdfsubject={Examples for typographic fine-tuning of LaTeX},
11252 pdftitle={Examples for LaTeX package typog},
11253 raiselinks = false,
11254 urlcolor = Mulberry
11255 }
11256
11257
11258 \makeatletter
11259 \newcommand{\fs@myruled}{%
11260 \fs@ruled
11261 \def\@fs@capt##1##2{\floatc@ruled{##1\space\capitaldash*\space}{\fussy ##2}}%
11262 \def\@fs@pre{\hrule height.8pt depth0pt \kern4pt}%
11263 \def\@fs@mid{\kern3pt\hrule\kern3pt}%
11264 \def\@fs@post{\kern4pt\hrule\relax}%
11265 }
11266 \makeatother
11267
11268 \floatstyle{myruled}
11269 \newfloat{exemplary}{htbp}{loe}[section]
11270 \floatname{exemplary}{Example}
11271 \Crefname{exemplary}{Example}{Examples}
11272 \crefname{exemplary}{Ex.}{Ex.}
11273
11274
11275 \newcommand*{\acronym}[1]{\mbox{\letterspacecapitals{\MakeUppercase{#1}}}}
11276 \newcommand*{\bibauthor}[1]{\textsc{#1}}
11277 \newcommand*{\bibtitle}[1]{\textit{#1}}
11278 \newcommand*{\bottomstrut}{\rule[-.5em]{0pt}{0pt}}
11279 \newcommand*{\code}[1]{{\ttfamily\hyphenchar\font=`\-\relax #1}}
11280 \newcommand*{\doublequotes}[1]{\doubleguillemetright#1\doubleguillemetleft}
11281 \newcommand*{\eTeX}{\mbox{\(\epsilon\)-\TeX}}
11282 \newcommand*{\letterspacecapitals}[1]{\textls[30]{#1}}
11283 \newcommand*{\metavar}[1]{\textit{#1}}
11284 \newcommand*{\packagename}[1]{\mbox{\textsf{#1}}}
11285 \newcommand*{\propername}[1]{\mbox{\textsc{\textls[25]{#1}}}}
11286 \newcommand*{\sample}[1]{\mbox{`\texttt{#1}'}}
11287 \newcommand*{\singlequotes}[1]{\singleguillemetright#1\singleguillemetleft}
11288 \newcommand*{\topstrut}{\rule{0pt}{1.25em}}
11289 \newcommand*{\visualpar}{\,\P\quad}
11290
11291 \newlength{\emreference}
11292 \AtBeginDocument{\setlength{\emreference}{\fontdimen6\font}}
11293 \newrobustcmd*{\milliem}[1]
11294 {\ifdim #1=0pt
11295 #1%
11296 \else
11297 \generictextfraction{\the\numexpr\dimexpr (#1) * 1000 / \emreference}{1000}\:em%
11298 \fi}
11299
11300
11301 \makeatletter
11302 \newcommand*{\getpackagefullinfo}[1]{\csname ver@#1.sty\endcsname}
11303
11304 \def\@synthslant@getpackagedate#1/#2/#3 v#4\@nil{#1/#2/#3}
11305 \newcommand*{\getpackagedate}[1]
11306 {\edef\@tempa{\getpackagefullinfo{#1}}%
11307 \expandafter\@synthslant@getpackagedate\@tempa\@nil}
11308
11309 \def\@synthslant@getpackageversion#1/#2/#3 v#4 #5\@nil{#4}
11310 \newcommand*{\getpackageversion}[1]
11311 {\edef\@tempa{\getpackagefullinfo{#1}}%
11312 \expandafter\@synthslant@getpackageversion\@tempa\@nil}
11313
11314 \def\@synthslant@getpackageinfo#1/#2/#3 v#4 #5\@nil{#5}
11315 \newcommand*{\getpackageinfo}[1]
11316 {\edef\@tempa{\getpackagefullinfo{#1}}%
11317 \expandafter\@synthslant@getpackageinfo\@tempa\@nil}
11318 \makeatother
11319
11320
11321 \newcommand*{\generictextfraction}[2]
11322 {\raisebox{.4em}[0pt]{\scriptsize #1}%
11323 \kern-.05em\textfractionsolidus\kern-.05em
11324 \raisebox{-.15em}[0pt][0pt]{\scriptsize #2}}
11325
11326 \newcommand*{\leftmarker}{\rule{.2em}{.1pt}\rule{.1pt}{.667em}}
11327 \newcommand*{\rightmarker}{\rule{.1pt}{.667em}\rule{.2em}{.1pt}}
11328 \newcommand*{\indicatewidth}[1]{\mbox{\leftmarker #1\rightmarker}}
11329
11330 \newenvironment*{widebody}
11331 {\begin{list}{}{\leftmargin=0pt
11332 \listparindent=\parindent
11333 \parsep=\parskip
11334 \rightmargin=-\marginparwidth
11335 \topsep=0pt}
11336 \item\relax}
11337 {\end{list}}
11338
11339 \newlength{\examplewidth}
11340 \setlength{\examplewidth}{160pt}
11341
11342 \newcommand*{\texbooktolerancesample}
11343 {If you want to avoid overfull boxes at all costs without trying to fix them manually,
11344 you might be tempt\-ed to set \texttt{tol\-er\-ance=\allowbreak10000}; this allows
11345 arbitrarily bad lines to be acceptable in tough situations. But infinite tolerance
11346 is a bad idea, because \TeX{} doesn't distinguish between terribly bad and
11347 preposterously horrible lines. Indeed, a tolerance of 10000 encourages \TeX{} to
11348 concentrate all the badness in one place, making one truly unsightly line instead of
11349 two moderately bad ones, because a single ``write-off'' produces fewest total
11350 demerits according to the rules.}
11351 \newcommand*{\texbooktolerancesamplecredits}
11352 {\medskip\noindent
11353 \textsl{The sample text was taken from The~\TeX{}book~\cite[p.~107]{knuth:1986}.}}
11354
11355 \newcommand*{\texbookparfillskipsample}
11356 {We still haven't discussed the special trick that allows the final line of a paragraph
11357 to be shorter than the others. Just before \TeX{} begins to choose breakpoints,
11358 it does two important things: [\dots\itcorr{-4}]}
11359 \newcommand*{\texbooklongparfillskipsample}
11360 {We still haven't discussed the special trick that allows the final line of a paragraph
11361 to be shorter than the others. Just before \TeX{} begins to choose breakpoints,
11362 it does two important things: (1)~If the final item of the current horizontal list is glue,
11363 that glue is discarded. (The reason is that a blank space often gets into a token list just
11364 before \code{\char92par} or just before \code{\char36\char36}, and this blank space should not be
11365 part of the paragraph.) (2)~Three or more items are put at the end of the
11366 current horizontal list~[\dots\itcorr{-4}]}
11367 \newcommand*{\texbookparfillskipsamplecredits}
11368 {\medskip\noindent
11369 \textsl{The sample text was taken from The~\TeX{}book~\cite[p.~99n]{knuth:1986}.}}
11370
11371 \newcommand*{\texbookparshapeskipsample}
11372 {It's possible to control the length of lines in a much more general way, if simple
11373 changes to \code{\string\leftskip} and \code{\string\rightskip} aren't flexible enough for your
11374 purposes. For example, a semicircular hole has been cut out of the present paragraph,
11375 in order to make room for a circular illustration that contains some of
11376 Galileo's immortal words about circles; all of the line breaks in this
11377 paragraph and in the circular quotation were found by \TeX's line-breaking algorithm.
11378 You can specify a essentially arbitrary paragraph shape, by saying
11379 \code{parshape}=\metavar{number}, where the \metavar{number} is a positive integer~\(n\),
11380 followed by \(2n\)~\metavar{dimen} specifications.}
11381 \newcommand*{\texbookparshapeskipsamplecredits}
11382 {\medskip\noindent
11383 \textsl{The sample text was taken from The~\TeX{}book~\cite[p.~101]{knuth:1986}.}}
11384
11385 \newcommand*{\texbookbaselineskipsample}
11386 {When you are typsetting a document that spans several pages, it's generally best to
11387 define \code{\string\baselineskip} so that it cannot stretch or shrink, because
11388 this will give more uniformity to the pages. A small variation in the distance
11389 between the baselines---say only half a point---can make a substantial difference
11390 in the appearance of the type, since it significantly affects the proportion of
11391 white to black. On the other hand, if you are preparing a one-page document, you
11392 might want to give the baselineskip some stretchability, so that \TeX{} will help
11393 you fit the copy on the page.}
11394 \newcommand*{\texbookbaselineskipsamplecredits}
11395 {\medskip\noindent
11396 \textsl{The sample text was taken from The~\TeX{}book~\cite[p.~78]{knuth:1986}.}}
11397
11398
11399
11400 \newcommand*{\examplepreset}{\microtypesetup{activate=false}}
11401 \newcommand*{\examplesetup}{\frenchspacing\xsf\small\fussy}
11402 \newcommand*{\exampleparbox}[2][n/a]
11403 {\begin{typoginspect}{#1}
11404 \examplepreset
11405 \parbox[t]{\examplewidth}{\examplesetup #2}%
11406 \end{typoginspect}}
11407 \newcommand*{\examplesep}{\hspace*{20pt}}
11408 \def\fontnameandweightinfo#1{%
11409 {\def\projectoutfontname##1-##2-##3\relax{##1~\lowercase{##2}}%
11410 \global\expandafter\edef\csname#1\endcsname{\expandafter\projectoutfontname\fontname\font\relax}}}
11411 \newcommand*{\examplefontinformation}
11412 {\smallskip
11413 \examplesetup
11414 \fontnameandweightinfo{exfontnameinfo}%
11415 \fontsizeinfo{exfontsizeinfo}%
11416 The font used in this example is \exfontnameinfo, \exfontsizeinfo*.}
11417
11418
11419 \setcounter{tocdepth}{1}
11420 \setlength{\overfullrule}{0pt}
11421 \hbadness=-1
11422
11423
11424 \input{ushyphex}
11425
11426 \hyphenation{
11427 Double-guillemet-left
11428 Double-guillemet-right
11429 Double-quotes
11430 Single-guillemet-left
11431 Single-guillemet-right
11432 Single-quotes
11433 adj-demerits
11434 allow-display-breaks
11435 babel-hyphenation
11436 base-line-skip
11437 break-penalty
11438 breakable-display
11439 capital-hyphen
11440 capital-times
11441 cite-dash
11442 club-penalties
11443 cref-range-conjunction
11444 display-break
11445 display-widow-penalties
11446 double-guillemet-right
11447 double-hyphen-demerits
11448 double-quotes
11449 final-hyphen-demerits
11450 inter-display-line-penalty
11451 inter-text
11452 kerned-hyphen
11453 last-line-ragged-left
11454 last-line-ragged-left-par
11455 loose-ness
11456 loose-spacing
11457 make-at-letter
11458 make-at-other
11459 mar-gin-al
11460 math-italic-correction
11461 micro-type
11462 number-dash
11463 par-box
11464 par-indent
11465 parfillskip
11466 pdf-string-def-Disable-Commands
11467 post-display-penalty
11468 pre-display-penalty
11469 raise-capital-guillemets
11470 raise-capital-times
11471 raise-number-dash
11472 set-font-expand
11473 set-font-shrink
11474 set-font-stretch
11475 short-inter-text
11476 single-guillemet-left
11477 single-guillemet-right
11478 single-quotes
11479 slash-kern
11480 slightly-sloppy-par
11481 sloppy-par
11482 smooth-ragged-right-fuzz-factor
11483 smooth-ragged-right-par
11484 smooth-ragged-right-shape-quintuplet
11485 smooth-ragged-right-shape-septuplet
11486 smooth-ragged-right-shape-triplet
11487 space-skip
11488 text-italic-correction
11489 tight-spacing
11490 tracing-boxes
11491 tracing-para-graphs
11492 vtie-bot
11493 vtie-bot-disp
11494 vtie-bot-disp-par
11495 vtie-bot-disp-top-par
11496 vtie-bot-par
11497 vtie-top
11498 vtie-top-par
11499 widow-penalties
11500 }
11501
11502
11503 \SetExpansion[context=sloppy, stretch=30, shrink=60, step=5]{encoding={OT1, T1, TS1}}{}% p15
11504 \SetTracking{encoding=*, shape=sc}{20}
11505
11506
11507 \newcount\defaultlastlinefit
11508 \defaultlastlinefit=\lastlinefit
11509
11510
11511 \begin{document}
11512 \fussy
11513 \lastlinefit=1000%
11514 \nonfrenchspacing
11515
11516 \begin{center}
11517 \sf
11518 {\Huge\bfseries TypoG Examples}
11519
11520 \medskip
11521
11522 for \packagename{typog} version~\getpackageversion{typog} as of
11523 \getpackagedate{typog}
11524 \end{center}
11525
11526 \bigskip
11527
11528 \noindent
11529 The section numbers correspond to the subsections of section~3
11530 in the official documentation of package~\packagename{typog}.
11531
11532 \bigskip
11533
11534 \tableofcontents
11535
11536
11537 \clearpage
11538 \listof{exemplary}{Examples}
11539
11540
11541 \clearpage
11542 \noindent
11543 Unless otherwise noted the font used in the examples is \singlequotes{\examplefontname}.
11544
11545
11546 \section{Setup and Reconfiguration}
11547
11548 \noindent
11549 \code{\char`\\ typogget}
11550
11551 \begin{list}{}{\itemsep=0pt\parsep=0pt}
11552 \newcommand*{\expandsto}{$\mathbin{\mapsto}$}
11553 \item \code{breakpenalty} \expandsto{} \the\typogget{breakpenalty}
11554 \item \code{emdashspace} \expandsto{} \the\typogget{emdashspace}
11555 \item \code{endashspace} \expandsto{} \the\typogget{endashspace}
11556 \item \code{ligaturekern} \expandsto{} \milliem{\typogget{ligaturekern}}
11557 \item \code{lowercaselabelitemadjustments} \expandsto{} \typogget{lowercaselabelitemadjustments}
11558 \item \code{lowerslash} \expandsto{} \the\typogget{lowerslash}
11559 \item \code{mathitaliccorrection} \expandsto{} \the\typogget{mathitaliccorrection}
11560 \item \code{raisecapitaldash} \expandsto{} \the\typogget{raisecapitaldash}
11561 \item \code{raisecapitalguillemets} \expandsto{} \the\typogget{raisecapitalguillemets}
11562 \item \code{raisecapitalhyphen} \expandsto{} \the\typogget{raisecapitalhyphen}
11563 \item \code{raisecapitaltimes} \expandsto{} \the\typogget{raisecapitaltimes}
11564 \item \code{raisefiguredash} \expandsto{} \the\typogget{raisefiguredash}
11565 \item \code{raiseguillemets} \expandsto{} \the\typogget{raiseguillemets}
11566 \item \code{raiseinvertedmarks} \expandsto{} \typogget{raiseinvertedmarks}
11567 \item \code{shrinklimits} \expandsto{} \typogget{shrinklimits}
11568 \item \code{slashkern} \expandsto{} \the\typogget{slashkern}
11569 \item \code{stretchlimits} \expandsto{} \typogget{stretchlimits}
11570 \item \code{textitaliccorrection} \expandsto{} \the\typogget{textitaliccorrection}
11571 \item \code{trackingttspacing} \expandsto{} \typogget{trackingttspacing}
11572 \item \code{uppercaselabelitemadjustments} \expandsto{} \typogget{uppercaselabelitemadjustments}
11573 \end{list}
11574
11575 \begingroup
11576 \dimen0=\typogget{raisecapitaldash}%
11577 \setbox0=\hbox to \typogget{ligaturekern} {}%
11578 \endgroup
11579
11580 \noindent
11581 \code{\char`\\ typoggetnth}
11582
11583 \begin{list}{}{\parsep=0pt}
11584 \item
11585 \code{lowercaselabelitemadjustments}:
11586 (1)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{1}\the\dimen0,
11587 (2)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{2}\the\dimen0,
11588 (3)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{3}\the\dimen0, and
11589 (4)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{4}\the\dimen0.
11590
11591 Same elements now accessed from the right-hand-side, i.\,e.~with negative indices:
11592 (\textminus4)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-4}\nth,
11593 (\textminus3)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-3}\nth,
11594 (\textminus2)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-2}\nth, and
11595 (\textminus1)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-1}\nth.
11596
11597 \item \code{raiseinvertedmarks}:
11598 (1)~\typoggetnth{nth}{raiseinvertedmarks}{1}\nth,
11599 (2)~\typoggetnth{nth}{raiseinvertedmarks}{2}\nth, and
11600 (3)~\typoggetnth{nth}{raiseinvertedmarks}{3}\nth.
11601
11602 \item \code{shrinklimits}:
11603 (1)~\typoggetnth{nth}{shrinklimits}{1}\nth,
11604 (2)~\typoggetnth{nth}{shrinklimits}{2}\nth, and
11605 (3)~\typoggetnth{nth}{shrinklimits}{3}\nth.
11606
11607 \item \code{stretchlimits}:
11608 (1)~\typoggetnth{nth}{stretchlimits}{1}\nth,
11609 (2)~\typoggetnth{nth}{stretchlimits}{2}\nth, and
11610 (3)~\typoggetnth{nth}{stretchlimits}{3}\nth.
11611
11612 \item \code{trackingttspacing}:
11613 (1)~\typoggetnth{nth}{trackingttspacing}{1}\nth,
11614 (2)~\typoggetnth{nth}{trackingttspacing}{2}\nth, and
11615 (3)~\typoggetnth{nth}{trackingttspacing}{3}\nth.
11616
11617 \item \code{uppercaselabelitemadjustments}:
11618 (1)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{1}\the\dimen0,
11619 (2)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{2}\the\dimen0,
11620 (3)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{3}\the\dimen0, and
11621 (4)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{4}\the\dimen0.
11622 \end{list}
11623
11624
11625 \section{Information}
11626
11627 \code{\string\fontsizeinfo} --\fontsizeinfo{docsizeinfo}
11628 At this point of the document, the font~size
11629 and the line~spacing are \docsizeinfo*~(w/o~units).
11630 For footnotes however, the current sizes are%
11631 \footnote{This is the footnote where we get the sizes from.\fontsizeinfo{footsizeinfo}}
11632 \footsizeinfo.
11633
11634 Next we show a comparison of different font sizes and line spacings
11635 decorated with the results of \code{\string\fontsizeinfo}.
11636
11637 \medskip
11638
11639 \begin{widebody}
11640 \setstretch{1}
11641 \newcommand*{\baselineskipdoc}%
11642 {Macro \code{\string\baselineskip} is a length macro which
11643 specifies the minimum space between the bottom of two
11644 successive lines in a paragraph. Its value may be
11645 automatically reset by \LaTeX, for example, by font
11646 changes in the text.}
11647 \renewcommand*{\examplefontname}{Merriweather}
11648 Different font sizes and line spacings exemplified with the \examplefontname~font.
11649
11650 \smallskip
11651
11652 \begingroup
11653 \fontfamily{Merriwthr-TLF}\selectfont
11654 \noindent
11655 \parbox[t]{.31\linewidth}%
11656 {\fontsize{8.5}{12}\selectfont
11657 \baselineskipdoc
11658 \fontsizeinfo{examplesizeinfotight}}
11659 \hfill
11660 \parbox[t]{.31\linewidth}%
11661 {\fontsize{10}{12}\selectfont
11662 \baselineskipdoc
11663 \fontsizeinfo{examplesizeinfo}}
11664 \hfill
11665 \parbox[t]{.31\linewidth}%
11666 {\fontsize{10}{13.5}\selectfont
11667 \baselineskipdoc
11668 \fontsizeinfo{examplesizeinfoloose}}
11669 \endgroup
11670
11671 \medskip
11672
11673 \noindent
11674 \parbox[t]{.31\linewidth}{\examplefontname~\examplesizeinfotight*}
11675 \hfill
11676 \parbox[t]{.31\linewidth}{\examplefontname~\examplesizeinfo*}
11677 \hfill
11678 \parbox[t]{.31\linewidth}{\examplefontname~\examplesizeinfoloose*}
11679 \end{widebody}
11680
11681 \noindent Starred form eats spaces? \examplesizeinfo* .
11682
11683
11684 \section{Hyphenation}
11685
11686 \noindent Line-Break Behavior
11687
11688 \begin{quote}
11689 \setlength{\overfullrule}{0pt}
11690 \parbox[t]{0pt}{%
11691 \code{\string\mbox+\string\breakpoint*} \\
11692 \mbox{(pre-)}\breakpoint*Hilbert space}
11693 \hspace{100pt}
11694 \parbox[t]{0pt}{%
11695 \code{\string\breakpoint*} \\
11696 (pre-)\breakpoint*Hilbert space}
11697 \hspace{100pt}
11698 \parbox[t]{0pt}{%
11699 \code{\string\breakpoint} \\
11700 (pre-)\breakpoint Hilbert space}
11701 \end{quote}
11702
11703 \noindent Starred form eats spaces? a\breakpoint* b. Unstarred: a\breakpoint b.
11704
11705 \medskip
11706
11707 \begin{quote}
11708 \setlength{\overfullrule}{0pt}
11709 \parbox[t]{0pt}{%
11710 \begin{hyphenmin}{6}
11711 Set minimum hyphenation values for both \code{\string\lefthyphenmin} and
11712 \code{\string\righthyphenmin}: \the\lefthyphenmin{} and \the\righthyphenmin.
11713 \end{hyphenmin}}
11714 \hspace{100pt}
11715 \parbox[t]{0pt}{%
11716 \begin{hyphenmin}[4]{5}
11717 Set minimum hyphenation values for \code{\string\lefthyphenmin} and
11718 \code{\string\righthyphenmin} separately: \the\lefthyphenmin{} and \the\righthyphenmin.
11719 \end{hyphenmin}}
11720 \hspace{100pt}
11721 \parbox[t]{0pt}{%
11722 Returned to the default values for \code{\string\lefthyphenmin} and
11723 \code{\string\righthyphenmin}: \the\lefthyphenmin{} and \the\righthyphenmin.}
11724 \end{quote}
11725
11726
11727 \section{Disable\kernedslash*Break Ligatures}
11728
11729 \begin{center}
11730 \begin{tabular}{@{}ll@{}}
11731 \hline
11732 \multicolumn{1}{@{}l|}{Macro} & Result \\
11733 \hline
11734 n/a &
11735 fine affirmation of baffling flavors \\
11736 \code{\string\nolig*} &
11737 f\nolig*ine af\nolig*f\nolig*irmation of baf\nolig*f\nolig*ling f\nolig*lavors \\
11738 \code{\string\nolig} &
11739 f\nolig{}ine af\nolig{}f\nolig{}irmation of baf\nolig{}f\nolig{}ling f\nolig{}lavors \\
11740 \code{\string\nolig*[75]} & of\nolig*[75]f\nolig*[75]ice
11741 \end{tabular}
11742 \end{center}
11743
11744 \noindent Line-Break Behavior
11745
11746 \begin{quote}
11747 \setlength{\overfullrule}{0pt}
11748 \parbox[t]{0pt}{%
11749 \code{\string\nolig*} \\
11750 bi\nolig*{}jection}
11751 \hspace{60pt}
11752 \parbox[t]{0pt}{%
11753 \code{\string\nolig} \\
11754 bi\nolig{}jection}
11755 \end{quote}
11756
11757 \noindent Starred form eats spaces? f\nolig* i, f\nolig*[0] i.
11758
11759
11760 \section{Manual Italic Correction}
11761
11762 \paragraph{Text Mode.}
11763
11764 The italic correction of the current font is \the\fontdimen1\font/pt.
11765
11766 We demonstrate the effect of \code{\string\itcorr} with a pair of bookends:
11767 uncorrected italic: \indicatewidth{\it X},
11768 \TeX-corrected (\code{\string\/}): \indicatewidth{\it X\/},
11769 and \code{\string\itcorr\{7\}}: \indicatewidth{\it X\itcorr{7}}.
11770
11771 Correction~0: \indicatewidth{\itcorr*{0}};
11772 corr.~3: \indicatewidth{\itcorr{3}}, \indicatewidth{\itcorr*{3}} (starred);
11773 corr.~\textminus6: \indicatewidth{\itcorr{-6}}.
11774
11775 \paragraph{Mathematical Mode.}
11776
11777 Uncorrected: \([f]\),
11778 corrected: \([\itcorr{1} f\itcorr{1}]\)
11779
11780 Correction~0: \indicatewidth{\(\itcorr{0}\)};
11781 corr.~3: \indicatewidth{\(\itcorr{3}\)};
11782 corr.~\textminus6: \indicatewidth{\(\itcorr{-6}\)}.
11783
11784
11785 \section{Apply Extra Kerning}
11786
11787
11788 \subsection{Slash}
11789
11790 The slash with some extra space~(\code{slashkern}=\the\typogget{slashkern}) around it can be
11791 helpful for certain pairs, as for example years or names.
11792
11793 \begin{center}
11794 \begin{tabular}{@{}lp{9em}p{15em}@{}}
11795 \hline
11796 \multicolumn{1}{@{}l|}{Macro} & \multicolumn{1}{l|}{Local Settings} & Result \\
11797 \hline
11798 n/a & n/a & 1991/1992, New~York/NY, Korringa/Kohn/Rostoker \\
11799 \code{\string\kernedslash} &
11800 n/a &
11801 1991\kernedslash 1992, New~York\kernedslash NY, Korringa\kernedslash Kohn\kernedslash Rostoker \\
11802 \code{\string\kernedslash} &
11803 \ttfamily lowerslash=.1em, slashkern=-.0333em &
11804 \typogsetup{lowerslash=.1em, slashkern=-.0333em}
11805 \scshape bardeen\kernedslash cooper\kernedslash shrieffer \\
11806 \code{\string\kernedslash} &
11807 \ttfamily lowerslash=.1em, slashkern=0pt &
11808 \typogsetup{lowerslash=.1em, slashkern=0pt}abc\kernedslash def, uvw\kernedslash jkl
11809 \end{tabular}
11810 \end{center}
11811
11812 \noindent Line-Break Behavior
11813
11814 \begin{quote}
11815 \setlength{\overfullrule}{0pt}
11816 \parbox[t]{0pt}{%
11817 \code{\string\kernedslash*} \\
11818 1991\kernedslash*1992,
11819 New~York\kernedslash*NY,
11820 Korringa\kernedslash*Kohn\kernedslash*Rostoker}
11821 \hspace{120pt}
11822 \parbox[t]{0pt}{%
11823 \code{\string\kernedslash} \\
11824 1991\kernedslash{}1992,
11825 New~York\kernedslash{}NY,
11826 Korringa\kernedslash{}Kohn\kernedslash{}Rostoker}
11827 \end{quote}
11828
11829 \begin{quote}
11830 \setlength{\overfullrule}{0pt}
11831 \parbox[t]{0pt}{%
11832 \code{\string\kernedslash*}\code{\string\nobreak} \\
11833 1991\kernedslash*\nobreak{}1992,
11834 New~York\kernedslash*\nobreak{}NY,
11835 Korringa\kernedslash*Kohn\kernedslash*\nobreak{}Rostoker}
11836 \hspace{140pt}
11837 \parbox[t]{0pt}{%
11838 \code{\string\allowhyphenation\string\kernedslash} \\
11839 1991\kernedslash{}1992,
11840 New~York\kernedslash{}NY,
11841 Korringa\allowhyphenation\kernedslash{}Kohn\kernedslash{}Rostoker}
11842 \end{quote}
11843
11844 \noindent Starred form eats spaces? p\kernedslash* q.
11845
11846
11847 \subsection{Hyphen}
11848
11849 Uncorrected
11850
11851 \begin{quote}
11852 \(K\)-vector space, \(g\)-factor, \(f\)-function
11853 \end{quote}
11854
11855 \noindent Corrected
11856
11857 \begin{quote}
11858 \typogsetup{raisecapitalhyphen=.075em, raiseguillemets=.05em}
11859 \(K\)\leftkernedhyphen{-75}vector space,
11860 \(g\)\leftkernedhyphen{-25}factor,
11861 \(f\)\leftkernedhyphen{-100}function
11862 %% \(G\)\kernedhyphen[*]{50}{-50}Wirkung,
11863 %% \(G\)\leftkernedhyphen{50}äquivalent,
11864 %% \(K\)\kernedhyphen[*]{-50}{-50}Vektorraum,
11865 %% \(K\)\kernedhyphen{-50}{-25}bilinear,
11866 %% \propername{Young}\rightkernedhyphen{-50}Tableaux,
11867 %% \singlequotes{Bra}\kernedhyphen[50]{50}{-50}Vektor,
11868 %% \singlequotes{Ket}\kernedhyphen[50]{50}{-50}Vektor,
11869 %% halbzahlige~\(l\)\kernedhyphen{50}{-50}Werte.
11870 \end{quote}
11871
11872 \noindent Line-Break Behavior
11873
11874 \begin{quote}
11875 \setlength{\overfullrule}{0pt}
11876
11877 \parbox[t]{0pt}{hyphen~\mbox{`\code{-}'} \\ self-energy}
11878 \hspace{80pt}
11879 \parbox[t]{0pt}{\code{\string\hyp} \\ self\hyp{}energy}
11880 \hspace{60pt}
11881 \parbox[t]{0pt}{\code{\string\kernedhyphen*} \\ self\kernedhyphen*{5}{-5}energy}
11882 \hspace{80pt}
11883 \parbox[t]{0pt}{\code{\string\kernedhyphen} \\ self\kernedhyphen{5}{-5}energy}
11884 \end{quote}
11885
11886 \noindent If a \code{\string\kernedhyphen} goes astray in a math environment,
11887 it decays to an ordinary minus with appropriate kerning:
11888 \(G \kernedhyphen{-30}{-50} V\)\!.
11889
11890
11891 \subsection{En-Dash and Em-Dash}
11892
11893 \iffalse
11894 \section{abc\spacedendash\relax def}
11895 \section{ghi\spacedendash*{}jkl}
11896 \section{mno\spacedendash[1pt]\relax pqr}
11897 \section{stu\spacedendash*[1pt]{}vwx}
11898
11899 \section{GHI\spacedemdash\relax JKL}
11900 \section{MNO\spacedemdash[1pt]{}PQR}
11901 \fi
11902
11903 En-Dash
11904
11905 \setbox0=\hbox{\leftspacedendash}%
11906 \setbox0=\hbox{\leftspaceddash}%
11907 \setbox0=\hbox{\leftspacedendash*}%
11908 \setbox0=\hbox{\leftspaceddash*}%
11909 \setbox0=\hbox{\rightspacedendash}%
11910 \setbox0=\hbox{\rightspaceddash}%
11911 \setbox0=\hbox{\spacedendash}%
11912 \setbox0=\hbox{\spaceddash}%
11913 \setbox0=\hbox{\rightspacedendash*}%
11914 \setbox0=\hbox{\spacedendash*}%
11915 \setbox0=\hbox{\spaceddash*}%
11916 \begin{quote}
11917 abc\spacedendash{}def, ghi\spacedendash* jkl, mno\spacedendash[.3em] pqr (raised by .3\,em)
11918 \end{quote}
11919
11920 \noindent Line-Break Behavior
11921
11922 \begin{quote}
11923 \setlength{\overfullrule}{0pt}
11924
11925 \parbox[t]{0pt}{\code{\string\leftspacedendash} \\ En\-dash\leftspacedendash Spacing}
11926 \hspace{100pt}
11927 \parbox[t]{0pt}{\code{\string\rightspacedendash} \\ En\-dash\rightspacedendash Spacing}
11928 \hspace{100pt}
11929 \parbox[t]{0pt}{\code{\string\spacedendash*} \\ En\-dash\spacedendash* Spacing}
11930 \end{quote}
11931
11932 \noindent Em-Dash
11933
11934 \setbox0=\hbox{\leftspacedemdash}%
11935 \setbox0=\hbox{\leftspacedemdash*}%
11936 \setbox0=\hbox{\rightspacedemdash}%
11937 \setbox0=\hbox{\spacedemdash}%
11938 \setbox0=\hbox{\rightspacedemdash*}%
11939 \setbox0=\hbox{\spacedemdash*}%
11940 \begin{quote}
11941 abc\spacedemdash{}def, ghi\spacedemdash* jkl, mno\spacedemdash[.3em] pqr (raised by .3\,em)
11942 \end{quote}
11943
11944 \noindent Line-Break Behavior
11945
11946 \begin{quote}
11947 \setlength{\overfullrule}{0pt}
11948
11949 \parbox[t]{0pt}{\code{\string\leftspacedemdash} \\ Dash\leftspacedemdash Spacing}
11950 \hspace{100pt}
11951 \parbox[t]{0pt}{\code{\string\rightspacedemdash} \\ Dash\rightspacedemdash Spacing}
11952 \hspace{100pt}
11953 \parbox[t]{0pt}{\code{\string\spacedemdash*} \\ Dash\spacedemdash* Spacing}
11954 \end{quote}
11955
11956
11957 \section{Raise Selected Characters}
11958
11959 \subsection{Capital Hyphen}
11960
11961 \newlength{\exemplaryraisecapitalhyphen}
11962 \setlength{\exemplaryraisecapitalhyphen}{.6667pt}
11963 With the standard hyphen we get
11964
11965 \begin{quote}
11966 \begin{otherlanguage}{german}
11967 \acronym{NMR}-Spektroskopie,
11968 \acronym{SI}-Einheit,
11969 \(G\)-Modul, and
11970 \(K\)-Vektorraum,
11971 \end{otherlanguage}
11972 \end{quote}
11973
11974 \noindent whereas with raising the hyphen by \the\exemplaryraisecapitalhyphen{}
11975 when calling \code{\string\capitalhyphen}, we arrive at
11976
11977 \begin{quote}
11978 \begin{otherlanguage}{german}
11979 \typogsetup{raisecapitalhyphen=.075em}
11980
11981 \acronym{NMR}\capitalhyphen{}Spektroskopie,
11982 \acronym{SI}\capitalhyphen{}Einheit,
11983 \(G\)\capitalhyphen{}Modul, and
11984 \(K\)\capitalhyphen{}Vektorraum
11985 (even better with \code{\string\kernedhyphen}
11986 and the star-option for the correct raise-amount:
11987 \(K\)\leftkernedhyphen[*]{-100}Vektorraum).
11988 \end{otherlanguage}
11989 \end{quote}
11990
11991 \noindent Line-Break Behavior
11992
11993 \begin{quote}
11994 \setlength{\overfullrule}{0pt}
11995 \begin{otherlanguage}{german}
11996 \parbox[t]{0pt}{%
11997 \code{\string\capitalhyphen*} \\
11998 \acronym{NMR}\capitalhyphen*{}Spektroskopie
11999 }
12000 \hspace{120pt}
12001 \parbox[t]{0pt}{%
12002 \code{\string\capitalhyphen} \\
12003 \acronym{NMR}\capitalhyphen{}Spektroskopie
12004 }
12005 \end{otherlanguage}
12006 \end{quote}
12007
12008 \noindent Starred form eats spaces?
12009 {\typogsetup{raisecapitalhyphen=.075em}
12010 V\capitalhyphen* W.}
12011
12012
12013 \subsection{Capital Dash}
12014
12015 \newlength{\exemplaryraisecapitaldash}
12016 \setlength{\exemplaryraisecapitaldash}{.075em}
12017
12018 Compare the result of plain~\code{\string\textendash}
12019
12020 \begin{quote}
12021 A\textendash M, N\textendash Z, C1\,\textendash\,C4, LEED\:\textendash\:STM
12022 \end{quote}
12023
12024 \noindent with \code{\string\capitaldash}:
12025
12026 \begin{quote}
12027 \typogsetup{raisecapitaldash=\exemplaryraisecapitaldash}
12028
12029 A\capitaldash{}M, N\capitaldash{}Z, C1\,\capitaldash\,C4, LEED\:\capitaldash\:STM
12030 \end{quote}
12031
12032 \noindent where the en-dash has been raised by \milliem{\exemplaryraisecapitaldash}.
12033
12034 Starred form eats spaces? V\capitaldash* W.
12035
12036 \smallskip
12037
12038 \noindent Spaced Capital En-Dash
12039
12040 \setbox0=\hbox{\leftspacedcapitalendash}%
12041 \setbox0=\hbox{\leftspacedcapitaldash}%
12042 \setbox0=\hbox{\leftspacedcapitalendash*}%
12043 \setbox0=\hbox{\leftspacedcapitaldash*}%
12044 \setbox0=\hbox{\rightspacedcapitalendash}%
12045 \setbox0=\hbox{\rightspacedcapitaldash}%
12046 \setbox0=\hbox{\spacedcapitalendash}%
12047 \setbox0=\hbox{\spacedcapitaldash}%
12048 \setbox0=\hbox{\rightspacedcapitalendash*}%
12049 \setbox0=\hbox{\spacedcapitalendash*}%
12050 \setbox0=\hbox{\spacedcapitaldash*}%
12051 \begin{quote}
12052 abc\spacedcapitalendash{}def, ghi\spacedcapitalendash* jkl
12053 \end{quote}
12054
12055 \noindent Spaced Capital Em-Dash
12056
12057 \setbox0=\hbox{\leftspacedcapitalemdash}%
12058 \setbox0=\hbox{\leftspacedcapitalemdash*}%
12059 \setbox0=\hbox{\rightspacedcapitalemdash}%
12060 \setbox0=\hbox{\spacedcapitalemdash}%
12061 \setbox0=\hbox{\rightspacedcapitalemdash*}%
12062 \setbox0=\hbox{\spacedcapitalemdash*}%
12063 \begin{quote}
12064 abc\spacedcapitalemdash{}def, ghi\spacedcapitalemdash* jkl
12065 \end{quote}
12066
12067
12068 \subsection{Number Dash}
12069
12070 \newlength{\exemplaryraisefiguredash}
12071 \setlength{\exemplaryraisefiguredash}{.6667pt}
12072 Compare the result of plain~\code{\string\textendash}
12073
12074 \begin{quote}
12075 3--5, 81--82, 485--491
12076 \end{quote}
12077
12078 \noindent with \code{\string\figuredash}:
12079
12080 \begin{quote}
12081 \typogsetup{raisefiguredash=\exemplaryraisefiguredash}
12082 3\figuredash 5, 81\figuredash 82, 485\figuredash 491
12083 \end{quote}
12084
12085 \noindent where the en-dash has been raised by \the\exemplaryraisefiguredash.
12086
12087 \noindent Line-Break Behavior
12088
12089 \begin{quote}
12090 \setlength{\overfullrule}{0pt}
12091 \typogsetup{raisefiguredash=\exemplaryraisefiguredash}
12092 \parbox[t]{0pt}{%
12093 \code{\string\figuredash*} \\
12094 3\figuredash*5, 81\figuredash*82, 485\figuredash*491
12095 }
12096 \hspace{80pt}
12097 \parbox[t]{0pt}{%
12098 \code{\string\figuredash} \\
12099 3\figuredash 5, 81\figuredash 82, 485\figuredash 491
12100 }
12101 \end{quote}
12102
12103 \noindent Starred form eats spaces? 44\figuredash* 55.
12104
12105
12106 \subsection{Multiplication Sign \capitaldash{} Times~``\texttimes''}
12107
12108 \newlength{\exemplaryraisetimes}
12109 \setlength{\exemplaryraisetimes}{.6667pt}
12110 The problem with a too-low multiplication sign arises
12111 for example with matrices of a given, specific size.
12112
12113 \noindent Uncorrected
12114
12115 \begin{quote}
12116 \acronym{LR}-mode: 2\texttimes2-matrix, \(N\)\texttimes\(M\)-matrix \\
12117 Math-mode: \(2\times2\)-matrix, \(N\times M\)-matrix
12118 \end{quote}
12119
12120 \noindent and corrected
12121
12122 \begin{quote}
12123 \typogsetup{raisecapitalhyphen=\exemplaryraisecapitalhyphen,
12124 raisecapitaltimes=\exemplaryraisetimes}
12125 \acronym{LR}-mode: 2\capitaltimes2-matrix, \(N\)\capitaltimes\(M\)-matrix \\
12126 Math-mode: \(2\capitaltimes2\)-matrix, \(N\capitaltimes M\)-matrix.
12127 \end{quote}
12128
12129
12130 \subsection{Guillemets}
12131
12132 \newcommand*{\tschicholdi}
12133 {Use single quotes for a first quotation.}
12134 \newcommand*{\tschicholdii}
12135 {Use double quotes for quotations within quotations.}
12136
12137 \newcommand*{\frenchsinglequotes}[1]{\singleguillemetright #1\singleguillemetleft}
12138 \newcommand*{\Frenchsinglequotes}[1]{\Singleguillemetright #1\Singleguillemetleft}
12139 \newcommand*{\frenchdoublequotes}[1]{\doubleguillemetright #1\doubleguillemetleft}
12140 \newcommand*{\Frenchdoublequotes}[1]{\Doubleguillemetright #1\Doubleguillemetleft}
12141
12142 \newcommand*{\frenchsinglequotesFR}[1]{\singleguillemetleft\,\allowhyphenation#1\,\singleguillemetright}
12143 \newcommand*{\FrenchsinglequotesFR}[1]{\Singleguillemetleft\,\allowhyphenation#1\,\Singleguillemetright}
12144 \newcommand*{\frenchdoublequotesFR}[1]{\doubleguillemetleft\,\allowhyphenation#1\,\doubleguillemetright}
12145 \newcommand*{\FrenchdoublequotesFR}[1]{\Doubleguillemetleft\,\allowhyphenation#1\,\Doubleguillemetright}
12146
12147 \newlength{\exemplaryraiseguillemets}
12148 \setlength{\exemplaryraiseguillemets}{.05em}
12149 \newlength{\exemplaryraisecapitalguillemets}
12150 \setlength{\exemplaryraisecapitalguillemets}{.1em}
12151
12152 We again compare the default implementation with the adjusted one.
12153
12154 \begin{quote}
12155 \frenchsinglequotes{\tschicholdi} \\
12156 \frenchdoublequotes{\tschicholdii} \\
12157 \Frenchsinglequotes{1}, \Frenchsinglequotes{2}, \Frenchsinglequotes{3}. \\
12158 \Frenchdoublequotes{\letterspacecapitals{ABC}},
12159 \Frenchdoublequotes{\letterspacecapitals{MN}},
12160 \Frenchdoublequotes{\letterspacecapitals{XYZ}}.
12161 \end{quote}
12162
12163 \noindent Corrected by raising the glyphs by
12164 \milliem{\exemplaryraiseguillemets} and
12165 \milliem{\exemplaryraisecapitalguillemets}:
12166
12167 \begin{quote}
12168 \typogsetup{raiseguillemets=\exemplaryraiseguillemets,
12169 raisecapitalguillemets=\exemplaryraisecapitalguillemets}
12170 \frenchsinglequotes{\tschicholdi} \\
12171 \frenchdoublequotes{\tschicholdii} \\
12172 \Frenchsinglequotes{1}, \Frenchsinglequotes{2}, \Frenchsinglequotes{3}. \\
12173 \Frenchdoublequotes{\letterspacecapitals{ABC}},
12174 \Frenchdoublequotes{\letterspacecapitals{MN}},
12175 \Frenchdoublequotes{\letterspacecapitals{XYZ}}.
12176 \end{quote}
12177
12178 \noindent And the same using French typographic conventions:
12179
12180 \begin{quote}
12181 \typogsetup{raiseguillemets=\exemplaryraiseguillemets,
12182 raisecapitalguillemets=\exemplaryraisecapitalguillemets}
12183 \frenchsinglequotesFR{\tschicholdi} \\
12184 \frenchdoublequotesFR{\tschicholdii} \\
12185 \FrenchsinglequotesFR{1}, \FrenchsinglequotesFR{2}, \FrenchsinglequotesFR{3}. \\
12186 \FrenchdoublequotesFR{\letterspacecapitals{ABC}},
12187 \FrenchdoublequotesFR{\letterspacecapitals{MN}},
12188 \FrenchdoublequotesFR{\letterspacecapitals{XYZ}}.
12189 \end{quote}
12190
12191 \noindent Line-Break Behavior
12192
12193 \begin{quote}
12194 \setlength{\overfullrule}{0pt}
12195 \typogsetup{raiseguillemets=\exemplaryraiseguillemets,
12196 raisecapitalguillemets=\exemplaryraisecapitalguillemets}
12197
12198 \newcommand*{\samplestring}{relation}
12199
12200 \parbox[t]{0pt}{\frenchsinglequotes{\samplestring}}
12201 \hspace{30pt}
12202 \parbox[t]{0pt}{\Frenchsinglequotes{\samplestring}}
12203 \hspace{30pt}
12204 \parbox[t]{0pt}{\frenchdoublequotes{\samplestring}}
12205 \hspace{30pt}
12206 \parbox[t]{0pt}{\Frenchdoublequotes{\samplestring}}
12207
12208 \smallskip
12209
12210 \parbox[t]{0pt}{\frenchsinglequotesFR{\samplestring}}
12211 \hspace{30pt}
12212 \parbox[t]{0pt}{\FrenchsinglequotesFR{\samplestring}}
12213 \hspace{30pt}
12214 \parbox[t]{0pt}{\frenchdoublequotesFR{\samplestring}}
12215 \hspace{30pt}
12216 \parbox[t]{0pt}{\FrenchdoublequotesFR{\samplestring}}
12217 \end{quote}
12218
12219
12220 \subsection{Inverted Exclamation Mark and Inverted Question Mark}
12221
12222 Without \typoglogo{} support:
12223 g\textexclamdown jk\textquestiondown y\enspace
12224 \textexclamdown E! \textquestiondown Q?
12225
12226 All-caps versus small-caps:
12227
12228 \noindent
12229 \begin{minipage}{.4\textwidth}\parindent=15pt
12230 \noindent
12231 \textsc{Carmen}\par
12232 {\lsstyle\capitalinvertedquestionmark{1}CÓMO ESTÁS, JOSÉ?}
12233
12234 \noindent
12235 \textsc{José}\par
12236 {\lsstyle\capitalinvertedexclamationmark{1}BIEN! \capitalinvertedquestionmark{1}\itcorr{-2}Y TÚ?}
12237
12238 \noindent
12239 \textsc{Carmen}\par
12240 {\lsstyle\capitalinvertedexclamationmark{1}BIEN TAMBIÉN!}
12241 \end{minipage}
12242 \hfill
12243 \begin{minipage}{.4\textwidth}\parindent=15pt
12244 \noindent
12245 \textsc{Carmen}\par
12246 {\scshape\capitalinvertedquestionmark{1}cómo estás, josé?}
12247
12248 \noindent
12249 \textsc{José}\par
12250 {\scshape\capitalinvertedexclamationmark{1}bien! \capitalinvertedquestionmark{1}\itcorr{-2}y tú?}
12251
12252 \noindent
12253 \textsc{Carmen}\par
12254 {\scshape\capitalinvertedexclamationmark{1}bien también!}
12255 \end{minipage}
12256
12257 \medskip
12258
12259 \begin{typogsetup}{raiseinvertedmarks={5pt,*,1sp}}
12260 \noindent
12261 Local settings are \{\typoggetnth{\dimen0}{raiseinvertedmarks}{1}\the\dimen0,
12262 \typoggetnth{\dimen0}{raiseinvertedmarks}{2}\the\dimen0,
12263 \typoggetnth{\dimen0}{raiseinvertedmarks}{3}\the\dimen0\}.
12264
12265 Primaries: ?\capitalinvertedquestionmark{1}? and !\capitalinvertedexclamationmark{1}!
12266
12267 \makeatletter
12268 \def\typog@inverted@exclamationmark@ii{\textexclamdown\textsubscript{2}}
12269 \def\typog@inverted@exclamationmark@iii{\textexclamdown\textsubscript{3}}
12270 \def\typog@inverted@questionmark@ii{\textquestiondown\textsubscript{2}}
12271 \def\typog@inverted@questionmark@iii{\textquestiondown\textsubscript{3}}
12272 \makeatother
12273 Secondaries -- indexed with 2:
12274 \capitalinvertedquestionmark{2}Más?
12275 \capitalinvertedexclamationmark{2}Por venir!
12276
12277 Tertiaries -- indexed with 3:
12278 \capitalinvertedquestionmark{3}Continuemos?
12279 \capitalinvertedexclamationmark{3}Con el texto!
12280
12281 \iffalse
12282 \section{\capitalinvertedexclamationmark{1}E! \capitalinvertedquestionmark{1}Q?}
12283 \section{\capitalinvertedexclamationmark{2}E! \capitalinvertedquestionmark{2}Q?}
12284 \section{\capitalinvertedexclamationmark{3}E! \capitalinvertedquestionmark{3}Q?}
12285 \fi
12286 \end{typogsetup}
12287
12288
12289 \section{Label Items}
12290
12291 The current configurations for the uppercase and lowercase adjustments are
12292 \{\typogget{uppercaselabelitemadjustments}\} and \{\typogget{lowercaselabelitemadjustments}\}.
12293 Here are the results of the freestanding macros~\code{\string\adjusted\-label\-itemi},
12294 \code{\string\adjusted\-label\-itemi} and so on:
12295
12296 \begin{center}
12297 A\Adjustedlabelitemi B\Adjustedlabelitemii E\Adjustedlabelitemiii G\Adjustedlabelitemiv H.
12298
12299 a\adjustedlabelitemi b\adjustedlabelitemii e\adjustedlabelitemiii g\adjustedlabelitemiv h.
12300 \end{center}
12301
12302 For the following nested lists we adjust levels one and three for uppercase and levels two and
12303 four for lowercase.
12304
12305 \begingroup
12306 \uppercaseadjustlabelitems{1,3}
12307 \lowercaseadjustlabelitems{2,4}
12308 \setlength{\itemsep}{0pt}
12309 \setlength{\parsep}{0pt}
12310 \setlength{\topsep}{0pt}
12311 \begin{itemize}
12312 \item A
12313 \item B
12314 \item C
12315 \begin{itemize}
12316 \item d
12317 \item e
12318 \item f
12319 \begin{itemize}
12320 \item G
12321 \item H
12322 \item I
12323 \begin{itemize}
12324 \item j
12325 \item k
12326 \item l
12327 \end{itemize}
12328 \end{itemize}
12329 \end{itemize}
12330 \end{itemize}
12331 \endgroup
12332 \noadjustlabelitems{*}% not necessary, but we want to exercise the macro
12333
12334 The left example shows the result of \code{\string\typogadjuststairs\{.25pt\}\{11\}\{ABC\}} and
12335 the one on the right hand side just uses the same parameters except for the sample~\sample{ace},
12336 this is, only lowercase letters.
12337
12338 \begin{center}
12339 \begin{minipage}[t]{12em}
12340 \centering
12341 \typogadjuststairs{.25pt}{11}{ABC}
12342 \end{minipage}
12343 \begin{minipage}[t]{12em}
12344 \centering
12345 \typogadjuststairs{.25pt}{11}{ace}
12346 \end{minipage}
12347 \end{center}
12348
12349 For this document the calls
12350 \code{\string\typoguppercaseadjustcheck\{ABC\-DEF\-GHI\-JKL\-MNO\-PQR\-STU\-VWX\-YZ\}} and
12351 \code{\string\typoglowercaseadjustcheck\{ace\-gmn\-opq\-rsu\-vwx\-yz\}} yield
12352 \sample{\typoguppercaseadjustcheck{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} and
12353 \sample{\typoglowercaseadjustcheck{acegmnopqrsuvwxyz}}, where the adjustments in effect are
12354 \code{\{\typogget{uppercaselabelitemadjustments}\}} and
12355 \code{\{\typogget{lowercaselabelitemadjustments}\}}.
12356
12357
12358 \clearpage
12359 \section{Align Last Line}
12360
12361 \subsection{Last Line Ragged Left/Flush Right}
12362
12363 \Cref{ex:lastlineraggedleftpar} is a typical use of environment~\code{lastlineraggedleftpar}:
12364 A narrow paragraph gets typeset with full justification
12365 and put \code{\string\flushright} against the right margin as a whole.
12366
12367 The layout may look more coherent if the last lines is moved to the right margin, too.
12368
12369 \begin{exemplary}
12370 \flushright
12371 \caption[Justified -- flushright]
12372 {\begin{typoginspectpar}{justified-flushright}Typeset a justified paragraph flushright and let
12373 macro~\code{\string\lastlineraggedleft} shift the last line
12374 over to the right-hand side.\label{ex:lastlineraggedleftpar}\end{typoginspectpar}}
12375
12376 \setlength{\examplewidth}{220pt}
12377 \exampleparbox[lastlineraggedleftpar]{\lastlineraggedleftpar\texbookparfillskipsample}
12378
12379 \centering
12380 \texbookparfillskipsamplecredits
12381
12382 \examplefontinformation
12383 \end{exemplary}
12384
12385
12386 \subsection{Last Line Centered}
12387
12388 The situation shown in \cref{ex:lastlinecenteredpar} is
12389 more widespread than \cref{ex:lastlineraggedleftpar}
12390 because centered tables and figures are quite common.
12391 Their caption parboxes are centered too,
12392 which is where a centered last line might fortify the layout.
12393
12394 Another possible use of environment~\code{lastlinecenteredpar} are the final lines of chapters~--
12395 in particular if the chapters' ends are marked with centered dingbats.
12396
12397 \begin{exemplary}
12398 \centering
12399 \caption[Typeset a justified paragraph that is centered.]
12400 {\lastlinecenteredpar
12401 Typeset a justified paragraph that is centered.
12402 This very caption uses \code{lastlinecenteredpar}
12403 to have its last line centered as well.
12404 Moreover, we put a nifty asterisk centered at the bottom of the sample text.
12405 \label{ex:lastlinecenteredpar}}
12406
12407 \setlength{\examplewidth}{220pt}
12408 \exampleparbox[lastlinecenteredpar]{\lastlinecenteredpar\texbookparfillskipsample}
12409
12410 \medskip\(\ast\)
12411
12412 \texbookparfillskipsamplecredits
12413
12414 \examplefontinformation
12415 \end{exemplary}
12416
12417
12418 \clearpage
12419 \section{Fill Last Line}
12420
12421 \newcommand*{\abcsample}{abcd efgh ijkl mnop qrst uvwx yz12 3456}
12422
12423 \begin{exemplary}
12424 \def\sness{2}
12425 \def\exparindent{25pt}
12426 \setlength{\examplewidth}{235pt}
12427
12428 \centering
12429 \caption[Plain paragraph vs.~\code{covernextindentpar}]
12430 {Top example: Typeset a paragraph without correction of the last line.
12431 Middle example: Paragraph corrected with \code{covernextindentpar}.
12432 We set a \code{\string\parindent} of~\exparindent{} in both parboxes
12433 and we \emph{must} increase the amount of glue in the paragraph
12434 to reduce the penalty of stretching the last line under a \code{\string\fussy}~setting.
12435 For the samples below, we have chosen \code{\string\slightlysloppy[\sness]}.
12436 The \singlequotes{Alternative}, the bottom example,
12437 shows the effect of \code{tightspacing};
12438 no extra sloppiness is required there.}
12439
12440 \exampleparbox[covernextindentpar-reference]{%
12441 \setlength{\parindent}{\exparindent}%
12442 \slightlysloppy[\sness]
12443 \texbookparfillskipsample{} \abcsample}
12444
12445 \medskip
12446
12447 \exampleparbox[covernextindentpar]{%
12448 \setlength{\parindent}{\exparindent}%
12449 \slightlysloppy[\sness]
12450 \covernextindentpar
12451 \texbookparfillskipsample{} \abcsample}
12452
12453 \medskip
12454
12455 Alternative\dots\hfill\smallskip
12456
12457 \exampleparbox[covernextindentpar-tightspacing]{%
12458 \setlength{\parindent}{\exparindent}%
12459 \begin{tightspacing}
12460 \texbookparfillskipsample{} \abcsample
12461 \end{tightspacing}}
12462
12463 \texbookparfillskipsamplecredits
12464
12465 \examplefontinformation
12466 \end{exemplary}
12467
12468 \begin{exemplary}
12469 \def\sness{2}
12470 \def\exparindent{0pt}
12471 \setlength{\examplewidth}{155pt}
12472
12473 \centering
12474 \caption[Plain paragraph vs.~\code{covernextindentpar} (narrow)]
12475 {Same comparison as the previous example,
12476 but for a small linewidth and zippo~\code{\string\parindent}.
12477 The left-hand side sample is uncorrected,
12478 the right-hand side features \code{\string\covernextindentpar}.
12479 The sloppiness level is~\sness{} for both samples.}
12480
12481 \exampleparbox[narrow-covernextindentpar-reference]{%
12482 \setlength{\parindent}{\exparindent}%
12483 \slightlysloppy[\sness]
12484 \texbookparfillskipsample{} \abcsample}
12485 \qquad
12486 \exampleparbox[narrow-covernextindentpar]{%
12487 \setlength{\parindent}{\exparindent}%
12488 \slightlysloppy[\sness]
12489 \covernextindentpar[30pt]
12490 \texbookparfillskipsample{} \abcsample}
12491
12492 \texbookparfillskipsamplecredits
12493
12494 \examplefontinformation
12495 \end{exemplary}
12496
12497 \begin{exemplary}
12498 \def\exparindent{10pt}
12499 \setlength{\examplewidth}{233pt}
12500
12501 \centering
12502 \caption[Prevent full last line]
12503 {Sample~1: Typeset a paragraph without correction of the last line.
12504 Sample~2: Paragraph corrected with \code{\string\openlastlinepar}.~-- Disappointing!
12505 Sample~3: Same using macro~\code{\string\prolongpar}.
12506 Sample~4: Alternative solution that simply increases the tracking by
12507 \generictextfraction{2}{1000}\,em with~\code{setfonttracking}.
12508 Sample~5: Alternative solution that increases the spacing with
12509 \code{loosespacing}.}
12510
12511 \exampleparbox[openline-reference]{%
12512 \setlength{\parindent}{\exparindent}
12513 \texbookparfillskipsample{} \abcsample}
12514
12515 \medskip
12516
12517 \exampleparbox[openlastlinepar]{%
12518 \setlength{\parindent}{\exparindent}
12519 \openlastlinepar
12520 \texbookparfillskipsample{} \abcsample}
12521
12522 \medskip
12523
12524 \exampleparbox[prolongpar]{%
12525 \setlength{\parindent}{\exparindent}
12526 \prolongpar
12527 \texbookparfillskipsample{} \abcsample}
12528
12529 \medskip
12530
12531 Alternatives\dots\hfill\smallskip
12532
12533 \exampleparbox[openline-tracking]{%
12534 \setlength{\parindent}{\exparindent}%
12535 \setfonttracking{2}
12536 \texbookparfillskipsample{} \abcsample}
12537
12538 \medskip
12539
12540 \exampleparbox[openline-spacing]{%
12541 \setlength{\parindent}{\exparindent}%
12542 \begin{loosespacing}
12543 \texbookparfillskipsample{} \abcsample
12544 \end{loosespacing}}
12545
12546 \texbookparfillskipsamplecredits
12547
12548 \examplefontinformation
12549 \end{exemplary}
12550
12551 \begin{typoginspect}{lastlinefitpar}
12552 \lastlinefit=\defaultlastlinefit
12553 \begin{nofontexpansion}
12554 \begin{lastlinefitpar}
12555 In this paragraph the value of \code{\string\lastlinefit} was increased to
12556 \the\lastlinefit. Thus, the spacing of its last line is equal to that of the next-to-last
12557 line. The effect can be double-checked with log-file, \textit{\jobname.log,} as this text
12558 was wrapped in a \code{typoginspect}~environment with id~\code{lastlinefitpar}.
12559 \end{lastlinefitpar}
12560
12561 The value of \code{\string\lastlinefit} is reset to~\the\lastlinefit{} in the following
12562 paragraph.
12563 \end{nofontexpansion}
12564 \end{typoginspect}
12565
12566
12567 \clearpage
12568 \section{Spacing}
12569
12570 \subsection{Narrow\kernedslash Wide Space}
12571
12572 The current font's parameters are shown in \cref{tab:fontdim}.\!\footnote{For a concise and
12573 understandable explanation of the plethora of font parameters consult \propername{David
12574 Carlisle's} excellent post on \propername{StackExchange}:
12575 \href{https://tex.stackexchange.com/questions/88991/what-do-different-fontdimennum-mean}%
12576 {What Do Different Fontdimennum Mean}.}
12577
12578 \begin{table}[htp]
12579 \centering
12580 \caption{Important \code{\string\fontdimen} values of the current text font.
12581 The middle column~(\#) states the number of the fontdimen.\bottomstrut}
12582 \label{tab:fontdim}
12583
12584 \begin{tabular}{@{}lll@{}}
12585 \hline
12586 \multicolumn{1}{@{}l|}{Name} & \multicolumn{1}{l|}{\#} & Value \\
12587 \hline
12588 Interword space & 2 & \the\fontdimen2\font\topstrut \\
12589 Interword stretch & 3 & \the\fontdimen3\font \\
12590 Interword shrink & 4 & \the\fontdimen4\font \\
12591 Extra space & 7 & \the\fontdimen7\font
12592 \end{tabular}
12593 \end{table}
12594
12595 \begin{center}
12596 \setlength{\overfullrule}{0pt}
12597 \newcommand*{\spacesampletext}[1]{some#1text#1with#1spaces\rule{.1pt}{1em}}
12598 \newsavebox{\narrowspacesample}
12599 \sbox{\narrowspacesample}{\spacesampletext{\narrowspace}}
12600 \newsavebox{\widespacesample}
12601 \sbox{\widespacesample}{\spacesampletext{\widespace}}
12602
12603 \begin{tabular}{@{}ll@{\qquad}l@{}}
12604 Compare & \spacesampletext{\space} & default space, natural glue \\
12605 with & \usebox{\narrowspacesample} & \code{\string\narrowspace}, natural glue \\
12606 {} & \makebox[\wd\narrowspacesample][l]{\hbox to 0pt{\spacesampletext{\narrowspace}}} &
12607 \code{\string\narrowspace}, tight box \\
12608 {} & \makebox[\wd\narrowspacesample][l]{\hbox spread 5pt{\spacesampletext{\narrowspace}}} &
12609 \code{\string\narrowspace}, spread 5pt \\
12610 and again & \spacesampletext{\space} & default space, natural glue \\
12611 with & \usebox{\widespacesample} & \code{\string\widespace}, natural glue \\
12612 {} & \makebox[\wd\widespacesample][l]{\hbox to 0pt{\spacesampletext{\widespace}}} &
12613 \code{\string\widespace}, tight box \\
12614 {} & \makebox[\wd\widespacesample][l]{\hbox spread 5pt{\spacesampletext{\widespace}}} &
12615 \code{\string\widespace}, spread 5pt
12616 \end{tabular}
12617 \end{center}
12618
12619 \noindent Starred form eats spaces? Narrow\narrowspace* Space. Wide\widespace* Space.
12620
12621
12622 \subsection{Looser\kernedslash*Tighter}
12623
12624 \Cref{ex:spacing-i,ex:spacing-ii} show \code{tightspacing} and \code{loosespacing} at work.
12625
12626 \begin{exemplary}
12627 \newcommand*{\sness}{3}
12628 \newcommand*{\tlevel}{1}
12629 \centering
12630
12631 \caption[Looser or tighter spacing -- sloppy]
12632 {Both parboxes are typeset with \code{\string\slightlysloppy[\sness]},
12633 the left one with default spacing,
12634 the right one with \code{tightspacing[\tlevel]}.\label{ex:spacing-i}}
12635
12636 \exampleparbox[tightspacing-reference]{\slightlysloppy[\sness]\texbooktolerancesample}
12637 \qquad
12638 \exampleparbox[tightspacing]{\slightlysloppy[\sness]\tightspacing[\tlevel]\texbooktolerancesample}
12639
12640 \texbooktolerancesamplecredits
12641
12642 \examplefontinformation
12643 \end{exemplary}
12644
12645 \begin{exemplary}
12646 \newcommand*{\sness}{3}
12647 \newcommand*{\llevel}{2}
12648 \centering
12649
12650 \caption[Looser or tighter spacing -- sloppy]
12651 {Both parboxes are typeset with \code{\string\slightlysloppy[\sness]},
12652 the left one with default spacing,
12653 the right one with \code{loosespacing[\llevel]}.\label{ex:spacing-ii}}
12654
12655 \exampleparbox[loosespacing-reference]{\slightlysloppy[\sness]\texbooktolerancesample}
12656 \qquad
12657 \exampleparbox[loosespacing]{\slightlysloppy[\sness]\loosespacing[\llevel]\texbooktolerancesample}
12658
12659 \texbooktolerancesamplecredits
12660
12661 \examplefontinformation
12662 \end{exemplary}
12663
12664
12665 \clearpage
12666 \section{Microtype Front\capitalhyphen End}
12667
12668 \subsection{Tracking}
12669
12670 \newcommand*{\trackingsampletext}{%
12671 This sentence contains an explicit call to \code{\string\textls}
12672 with an optional argument of \((+200)\) to \textls[200]{DEMONSTRATE}
12673 that this macro still works inside of \code{setfonttracking}.
12674 Apart from that it is just some more text to exercise the macro.
12675 Well, the explicit letterspacing example is particularly ugly.}
12676
12677 \begin{exemplary}
12678 \renewcommand*{\examplepreset}{\microtypesetup{activate=true}}
12679 \def\extratracking{7}
12680 \centering
12681
12682 \caption[Microtype: tracking]
12683 {Use \packagename{microtype} to change the font tracking.
12684 The sample on the left-hand side shows neutral tracking.
12685 The one on the right-hand side received an extra tracking of
12686 \generictextfraction{\extratracking}{1000}\,em.}
12687
12688 \exampleparbox[microtype-tracking-reference]{%
12689 \fussy
12690 \noindent
12691 \trackingsampletext}
12692 \qquad
12693 \exampleparbox[microtype-tracking-stretch]{%
12694 \begin{setfonttracking}{\extratracking}
12695 \fussy
12696 \noindent
12697 \trackingsampletext
12698 \end{setfonttracking}}
12699
12700 \examplefontinformation
12701 \end{exemplary}
12702
12703 \newcommand*{\trackingsamplefontchangetext}{%
12704 {\rm RM} {\sf SF} {\rm RM} {\tt TT} {\rm RM};
12705 {\rm RM} {\it IT\/} {\rm RM};
12706 {\rm RM} {\sc SC} {\rm RM}.
12707 {\rm Rm} {\sf Sf} {\rm Rm} {\tt Tt} {\rm Rm};
12708 {\rm Rm} {\it It\/} {\rm Rm};
12709 {\rm Rm} {\sc Sc} {\rm Rm}.
12710 {\rm rm} {\sf sf} {\rm rm} {\tt tt} {\rm rm};
12711 {\rm rm} {\it it\/} {\rm rm};
12712 {\rm rm} {\sc sc} {\rm rm}.}
12713
12714 \begin{exemplary}
12715 \renewcommand*{\examplepreset}{\microtypesetup{activate=true}}
12716 \def\extratracking{1}
12717 \centering
12718
12719 \caption[Microtype: tracking -- font changes]
12720 {Check how font changes (serif, serif~italic, small-caps, sans~serif, typewriter)
12721 interfere with the interword spacing.
12722 The left sample has no tracking changes applied and serves as a reference,
12723 whereas the right sample got an extra tracking of
12724 \generictextfraction{\extratracking}{1000}\,em.\visualpar
12725 The switch from and to typewriter, i.\,e., constant-width fonts
12726 commonly is a source of spacing problems.}
12727
12728 \exampleparbox[microtype-tracking-font-changes-reference]{\trackingsamplefontchangetext}
12729 \qquad
12730 \exampleparbox[microtype-tracking-font-changes-stretch]{%
12731 \begin{setfonttracking}{\extratracking}
12732 \trackingsamplefontchangetext
12733 \end{setfonttracking}}
12734 \end{exemplary}
12735
12736 \noindent
12737 No contents: \leftmarker
12738 \begin{setfonttracking}{0}
12739 \end{setfonttracking}\rightmarker.
12740
12741
12742 \subsection{Font Expansion}
12743
12744 \newcommand*{\expansionsample}
12745 {By default, all characters of a font are allowed to be stretched or
12746 shrunk by the same amount. However, it is also possible to limit
12747 the expansion of certain characters if they are more sensitive to
12748 deformation.
12749 This is the purpose of the \code{\string\SetExpansion}~macro.}
12750
12751 \begin{exemplary}
12752 \setlength{\examplewidth}{250pt}
12753 \renewcommand*{\examplepreset}{\microtypesetup{activate=true}}
12754 \renewcommand*{\examplesetup}{\frenchspacing\small\fussy}
12755
12756 \centering
12757
12758 \caption[Microtype: font expansion]
12759 {Use \packagename{microtype} to stretch or shrink a font.
12760 The top sample uses \code{\string\setfontshrink} at level~3,
12761 the middle sample is the unchanged reference
12762 (which is allowed to shrink and expand),
12763 and the bottom sample utilizes \code{\string\setfontstretch} at level~2.}
12764
12765 \exampleparbox[microtype-expansion-shrink]{%
12766 \begin{setfontshrink}[3]
12767 \noindent\expansionsample
12768 \end{setfontshrink}}
12769
12770 \medskip
12771
12772 \exampleparbox[microtype-expansion-neutral]{%
12773 \begin{setfontexpand}[0]
12774 \noindent\expansionsample
12775 \end{setfontexpand}}
12776
12777 \medskip
12778
12779 \exampleparbox[microtype-expansion-stretch]{%
12780 \begin{setfontstretch}[2]
12781 \noindent\expansionsample
12782 \end{setfontstretch}}
12783
12784 \examplefontinformation
12785 \end{exemplary}
12786
12787 \noindent
12788 No contents -- \code{setfontshrink}: \leftmarker
12789 \begin{setfontshrink}
12790 \end{setfontshrink}\rightmarker.
12791
12792 \noindent
12793 No contents -- \code{setfontstretch}: \leftmarker
12794 \begin{setfontstretch}
12795 \end{setfontstretch}\rightmarker.
12796
12797 \noindent
12798 No contents -- \code{setfontexpand}: \leftmarker
12799 \begin{setfontexpand}
12800 \end{setfontexpand}\rightmarker.
12801
12802 \noindent
12803 No contents -- \code{nofontexpansion}: \leftmarker
12804 \begin{nofontexpansion}
12805 \end{nofontexpansion}\rightmarker.
12806
12807
12808
12809 \subsection{Character Protrusion}
12810
12811 \newcommand*{\zerodepthrule}
12812 {\raisebox{0pt}[0pt][0pt]{\rule[-4.5\baselineskip]{.1pt}{4.25\baselineskip}}}
12813
12814 \newcommand*{\protrusionsampletext}{%
12815 \noindent
12816 \zerodepthrule\hfill\zerodepthrule \\
12817 1\hfill 1 \\
12818 .2\hfill 2. \\
12819 --3\hfill 3-- \\
12820 ---4\hfill 4---}
12821
12822 \begin{exemplary}
12823 \renewcommand*{\examplepreset}{\microtypesetup{activate=true}}
12824 \renewcommand*{\examplesetup}{\frenchspacing\small\fussy}
12825
12826 \centering
12827
12828 \caption[Microtype: protrusion]
12829 {Comparison of the \packagename{microtype} feature ``protrusion'' (left-hand side)
12830 and \code{nocharprotrusion} (right-hand side).}
12831
12832 \exampleparbox[microtype-protrusion-reference]{%
12833 \microtypesetup{protrusion=true}
12834 \protrusionsampletext}
12835 \qquad
12836 \exampleparbox[microtype-protrusion-off]{%
12837 \microtypesetup{protrusion=true}
12838 \nocharprotrusion
12839 \protrusionsampletext}
12840
12841 \medskip
12842 \end{exemplary}
12843
12844 \noindent
12845 No contents -- \code{nocharprotrusion}: \leftmarker
12846 \begin{nocharprotrusion}
12847 \end{nocharprotrusion}\rightmarker.
12848
12849
12850 \clearpage
12851 \section{Sloppy Paragraphs}
12852
12853 \Cref{ex:slightlysloppy-1,ex:slightlysloppy-2} put different amounts of ``sloppiness'' face to face.
12854
12855 \begin{exemplary}
12856 \setlength{\examplewidth}{180pt}
12857 \def\sness{1}
12858 \centering
12859 \caption[Paragraphs typeset slightly sloppy~1]
12860 {Paragraphs typeset slightly sloppy: \code{\string\slightlysloppy} vs.~\code{\string\fussy}.
12861 The left parbox is typeset with \code{\string\slightlysloppy}
12862 and \(\metavar{sloppiness} = \sness\), whereas the right sample
12863 features the well known \code{\string\fussy} setting.
12864 Both parboxes have a width of \the\examplewidth.\label{ex:slightlysloppy-1}}
12865
12866 \exampleparbox[fussy-vs-slightlysloppy]{\slightlysloppy[\sness]\texbooktolerancesample}
12867 \qquad
12868 \exampleparbox[fussy-vs-slightlysloppy-reference]{\fussy\texbooktolerancesample}
12869
12870 \texbooktolerancesamplecredits
12871
12872 \examplefontinformation
12873 \end{exemplary}
12874
12875 \begin{exemplary}
12876 \setlength{\examplewidth}{150pt}
12877 \def\sness{2}
12878 \centering
12879 \caption[Paragraphs typeset slightly sloppy~2]
12880 {Paragraphs typeset slightly sloppy: \code{\string\slightlysloppy} vs.~\code{\string\sloppy}.
12881 The left sample is features \code{\string\slightlysloppy} with \(\metavar{sloppiness} = \sness\),
12882 the right sample is typeset with \code{\string\sloppy}.
12883 Both parboxes have a width of \the\examplewidth.\label{ex:slightlysloppy-2}}
12884
12885 \exampleparbox[sloppy-vs-slightlysloppy]{\slightlysloppy[\sness]\texbooktolerancesample}
12886 \qquad
12887 \exampleparbox[sloppy-vs-slightlysloppy-reference]{\sloppy\texbooktolerancesample}
12888
12889 \texbooktolerancesamplecredits
12890
12891 \examplefontinformation
12892 \end{exemplary}
12893
12894 In conclusion all renderings of the text in
12895 \cref{ex:slightlysloppy-1} and \cref{ex:slightlysloppy-2}
12896 have their merits and their own flaws.
12897
12898
12899 \clearpage
12900 \section{Vertically Partially-Tied Paragraphs}
12901
12902 \paragraph{\code{vtietoppar}}\leavevmode\par
12903
12904 \begin{typoginspect}{vtietoppar}
12905 \clubpenalty=150
12906 \begin{vtietoppar}[2]
12907 After breaking a paragraph into lines, \TeX{} computes the interline
12908 penalties by adding the values of: \code{\string\clubpenalty} after
12909 the first line of a paragraph.\!\footnote{Footnote of \code{vtietoppar}.}
12910 \eTeX{} generalizes the concept of interline, club, widow, and display widow penalty
12911 by allowing their replacement by arrays of penalty values.
12912 \end{vtietoppar}
12913 \end{typoginspect}
12914
12915 \paragraph{\code{vtiebotpar}}\leavevmode\par
12916
12917 \begin{typoginspect}{vtiebotpar}
12918 \widowpenalty=150
12919 \begin{vtiebotpar}[2]
12920 After breaking a paragraph into lines, \TeX{} computes the interline
12921 penalties by adding the values of: \code{\string\widowpenalty}
12922 before the last line of the paragraph.\marginpar{A float!}
12923 \eTeX{} generalizes the concept of interline, club, widow, and display widow penalty
12924 by allowing their replacement by arrays of penalty values.
12925 \end{vtiebotpar}
12926 \end{typoginspect}
12927
12928 \paragraph{\code{vtiebotdisp}}\leavevmode\par
12929
12930 \begin{typoginspect}[tracingboxes]{vtiebotdisp}
12931 \displaywidowpenalty=150
12932 \begin{vtiebotdisp}[2]
12933 After breaking a paragraph into lines, \TeX{} computes the interline
12934 penalties by adding the values of: \code{\string\displaywidowpenalty}
12935 before the line immediately preceding a displayed equation.
12936 \eTeX{} generalizes the concept of interline, club, widow, and display widow penalty
12937 by allowing their replacement by arrays of penalty values.
12938 \[g H = H g \quad \text{for all} \enspace g \in G.\]
12939 \end{vtiebotdisp}
12940
12941 Follow-up paragraph after and outside of the \code{vtiebotdisp}-environment.
12942 \end{typoginspect}
12943
12944 \paragraph{\code{vtiebotdisptoppar}}\leavevmode\par
12945
12946 \begin{typoginspect}{vtiebotdisptoppar}
12947 \displaywidowpenalty=150
12948 \begin{vtiebotdisptoppar}[2]
12949 After breaking a paragraph into lines, \TeX{} computes the interline
12950 penalties by adding the values of: \code{\string\displaywidowpenalty}
12951 before the line immediately preceding a displayed equation.
12952 \eTeX{} generalizes the concept of interline, club, widow, and display widow penalty
12953 by allowing their replacement by arrays of penalty values.
12954 \begin{breakabledisplay}
12955 \begin{displaymath}
12956 g H = H g \quad \text{for all} \enspace g \in G.
12957 \end{displaymath}
12958 \end{breakabledisplay}
12959
12960 In this example we need a paragraph that follows the displayed math.
12961 So, we have to type some more text here
12962 to be able to demonstrate the action of the environment.
12963 \end{vtiebotdisptoppar}
12964 \end{typoginspect}
12965
12966
12967 \clearpage
12968 \section{Breakable Displayed Equations}
12969
12970 \newcommand*{\binaryminus}{\mathbin{-}}
12971 \newcommand*{\diracadj}[1]{\overline{#1}}
12972 \newcommand*{\unaryminus}{{-}}
12973
12974 \begin{typoginspect}{breakabledisplay}
12975 \begin{breakabledisplay}
12976 \begin{align*}
12977 \diracadj{\psi}(x) \mathop{\partial_\mu} \psi(x)
12978 \mapsto \diracadj{\psi'}(x) \mathop{\partial_\mu} \psi'(x)
12979 &= e^{i \alpha(x)} \diracadj{\psi}(x) \mathop{\partial_\mu} \bigl( e^{\unaryminus i \alpha(x)} \psi(x) \bigr) \\
12980 &= \underbrace{\diracadj{\psi}(x) \mathop{\partial_\mu} \psi(x)}_{\text{free particle}}
12981 \mskip\medmuskip \binaryminus \mskip\medmuskip i \, \diracadj{\psi}(x)
12982 \underbrace{\mathop{\partial_\mu} \bigl( \alpha(x) \bigr)}_{\mathclap{\text{vector field}}} \psi(x).
12983 \end{align*}
12984 \end{breakabledisplay}
12985 \end{typoginspect}
12986
12987
12988 \clearpage
12989 \section{\packagename{Setspace} Front End}
12990
12991 \fontsizeinfo{defaultsize}
12992 Current settings are \defaultsize{}
12993 %--\settoheight{\typogfontsize}{CEMNORSUVWXZ}
12994 and \code{\string\typogfontsize} is \the\typogfontsize.
12995
12996
12997 \newcommand*{\absbls}{12pt plus 1pt minus .5pt}
12998 \paragraph{\code{\string\setbaselineskip\{\absbls\}}}
12999 \resetbaselineskip
13000 \setbaselineskip{10pt + 2.75pt}% addition
13001 \setbaselineskip{10.5pt * 100 / 105}% scaling
13002 \setbaselineskip{11.8pt * 85 / 100}% scaling
13003 \setbaselineskip{\absbls}
13004 \fontsizeinfo{baselinesetsize}
13005 New settings: \baselinesetsize.
13006
13007 \texbookbaselineskipsample
13008
13009
13010 \newcommand*{\relbls}{130}
13011 \paragraph{\code{\string\setbaselineskippercentage\{\relbls\}}}
13012 \setbaselineskippercentage{1 + 2 + .3333 * 100 + 100 * .6667}% float expression
13013 \setbaselineskippercentage{\relbls}
13014 \fontsizeinfo{baselinesetsize}
13015 New settings: \baselinesetsize.
13016
13017 \texbookbaselineskipsample
13018
13019
13020 \newcommand*{\absled}{1.5pt}
13021 \paragraph{\code{\string\setleading\{\absled\}}}
13022 \setleading{1pt / -2}% negative leading
13023 \setleading{\absled}
13024 \fontsizeinfo{baselinesetsize}
13025 New settings: \baselinesetsize.
13026
13027 \texbookbaselineskipsample
13028
13029
13030 \newcommand*{\relled}{30}
13031 \paragraph{\code{\string\setleadingpercentage\{\relled\}}}
13032 \setleadingpercentage{10 - 25 / 2}% negative leading
13033 \setleadingpercentage{\relled}
13034 \fontsizeinfo{baselinesetsize}
13035 New settings: \baselinesetsize.
13036
13037 \texbookbaselineskipsample
13038
13039 \medskip
13040
13041 \setstretch{1}
13042 \texbookbaselineskipsamplecredits
13043
13044
13045 \clearpage
13046 \section{Smooth Ragged}
13047
13048 \begin{exemplary}
13049 \newcommand*{\ragwidth}{10pt}
13050 \centering
13051 \caption[Comparison of ragged right typesetting]
13052 {Comparison of ragged right typesetting.
13053 The first example uses \code{RaggedRight} of \packagename{ragged2e}
13054 the second \code{smoothraggedrightpar} of \packagename{typog}.
13055 Both examples share a \code{\string\fussy}~setting and
13056 a \ragwidth~wide ragged right margin.\label{ex:smoothraggedright}}
13057
13058 \setlength{\RaggedRightRightskip}{0pt plus \ragwidth}
13059
13060 %\def\smoothraggedrightgenerator{triplet}
13061 %\def\smoothraggedrightgenerator{quintuplet}
13062 %\def\smoothraggedrightgenerator{septuplet}
13063 \setlength{\smoothraggedrightragwidth}{\ragwidth}
13064 %\def\smoothraggedrightfuzzfactor{.667}
13065
13066 \iffalse
13067 \begin{quote}
13068 \begin{RaggedRight}\examplesetup
13069 \texbookparshapeskipsample
13070 \end{RaggedRight}
13071 \end{quote}
13072
13073 \begin{quote}
13074 \begin{smoothraggedrightpar}\examplesetup
13075 \texbookparshapeskipsample
13076 \end{smoothraggedrightpar}
13077 \end{quote}
13078 \else
13079 \exampleparbox[RaggedRight-reference]{\RaggedRight\texbooktolerancesample}
13080 \qquad
13081 \exampleparbox[smoothraggedrightpar]{\smoothraggedrightpar\texbooktolerancesample}
13082 \fi
13083
13084 \texbookparshapeskipsamplecredits
13085
13086 \examplefontinformation
13087 \end{exemplary}
13088
13089
13090 %--\setlength{\smoothraggedrightparindent}{25pt}
13091 %--\setlength{\parindent}{0pt}
13092
13093 \noindent
13094 \code{\string\parindent}=\the\parindent,
13095 visually: \rule{.1pt}{.8em}\kern\parindent\rule{.1pt}{.8em};
13096
13097 \noindent
13098 \code{\string\smoothraggedrightleftskip}=\the\smoothraggedrightleftskip.
13099 \code{\string\smoothraggedrightparindent}=\the\smoothraggedrightparindent.
13100 \smallskip
13101
13102 {
13103 %--\setlength{\smoothraggedrightragwidth}{8pt}
13104 \begin{smoothraggedright}
13105 \texbooktolerancesample
13106
13107 \texbooktolerancesample
13108 \end{smoothraggedright}
13109 }
13110
13111 \medskip
13112
13113 {
13114 \setlength{\smoothraggedrightragwidth}{15pt}
13115
13116 \newcommand*{\definitionnilpotent}{%
13117 Eine Abbildung oder ein Operator~\(A\)
13118 heißen nilpotent vom Grad~\(k\), falls \(k \in N\)
13119 die kleinste Zahl ist, für die gilt: \(A^k = 0\).}
13120
13121 \begin{otherlanguage}{german}
13122 \parbox[t]{60pt}{\fussy\RaggedRight\definitionnilpotent}
13123 \hspace{40pt}
13124 \parbox[t]{60pt}{\fussy\smoothraggedright\definitionnilpotent}
13125 \end{otherlanguage}
13126 }
13127
13128 \clearpage
13129 \begin{RaggedRight}
13130 \begin{thebibliography}{0}
13131 \bibitem{knuth:1986}
13132 \bibauthor{Knuth, D.~E.},
13133 \bibtitle{The \TeX{}book},
13134 Vol.~A of Computers\&Typesetting,
13135 Addison Wesley, Reading\kernedslash*MA,
13136 1986.
13137 \end{thebibliography}
13138 \end{RaggedRight}
13139 \end{document}
13140 %</example>
13141 % \fi
13142 %
13143 %
13144 %
13145 % \iffalse
13146 %<*without-microtype>
13147 \documentclass[]{article}
13148
13149
13150 \usepackage[english]{babel}
13151
13152 \usepackage{csquotes}
13153 \DeclareQuoteStyle{typog-guillemets}
13154 {\doubleguillemetright}
13155 {\doubleguillemetleft}
13156 {\singleguillemetright}
13157 {\singleguillemetleft}
13158
13159 \usepackage[uppercaselabelitemadjustments={.1em, .075em, .1em, .1em},
13160 lowercaselabelitemadjustments={-.025em, -.05em, -.025em, -.025em}]
13161 {typog}
13162
13163
13164 \newcommand*{\packagename}[1]{\mbox{\textsf{#1}}}
13165
13166
13167 \begin{document}
13168 \begin{center}
13169 \Huge\bf\sf
13170 TypoG Examples \\
13171 without Package~\packagename{microtype}
13172 \end{center}
13173
13174 \bigskip
13175
13176
13177 \section*{No Microtype}
13178
13179 This example \LaTeX-document uses package~\packagename{typog}
13180 \emph{without} package~\packagename{microtype}.
13181
13182 We want \packagename{typog} to be as usable as possible even without
13183 the nice features that \packagename{microtype} offers.
13184 After all \packagename{typog} is just a front end for it.
13185
13186
13187 \section*{No EnumItem}
13188
13189 We intentionally do not load package~\packagename{enumitem}, either.
13190 So, we can test whether \packagename{typog} correctly patches the
13191 plain \LaTeX{} definition if environment~\texttt{itemize}.
13192
13193 The vertical alignment of the label items was setup for
13194 uppercase (ABC\typoguppercaseadjustcheck{ABCXYZ}XYZ) and for
13195 lowercase (ace\typoglowercaseadjustcheck{acexyz}xyz), though
13196 this is not necessary for the test.
13197
13198 \uppercaseadjustlabelitems{*}
13199 \begin{itemize}
13200 \item Level i
13201 \item Sublist \dots
13202 \begin{itemize}
13203 \item Level ii
13204 \item Sublist \dots
13205 \begin{itemize}
13206 \item Level iii
13207 \item Sublist \dots
13208 \begin{itemize}
13209 \item Level iv
13210 \end{itemize}
13211 \end{itemize}
13212 \end{itemize}
13213 \end{itemize}
13214
13215
13216 \section*{CSQuotes}
13217
13218 As we are testing a special configuration here anyhow,
13219 we hook up our quotes with package~csquotes
13220 to check whether they interact ok.
13221 {\setquotestyle{typog-guillemets}%
13222 \enquote{This is the outer part of the phrase
13223 which contains the \enquote{inner part}.}}
13224 \end{document}
13225 %</without-microtype>
13226 % \fi
13227 %
13228 %
13229 %
13230 % \iffalse
13231 %<*minimal-test>
13232 \documentclass{minimal}
13233
13234 \usepackage{typog}
13235
13236 \newcommand*{\raiseamount}{0.5pt}
13237
13238 \begin{document}
13239 \begin{typogsetup}{raise*=\raiseamount}
13240 Em-dash raised by \the\typogget{raisecapitaldash} (expected: \raiseamount).
13241 \end{typogsetup}
13242
13243 \fontsizeinfo{typoinfo}
13244 Document class ``minimal'' sets up font size and line spacing as~\typoinfo.
13245 \end{document}
13246 %</minimal-test>
13247 % \fi
13248 %
13249 %
13250 %
13251 % \iffalse
13252 %<*teximan2latex>
13253 ## Add some extra definitions.
13254 1a\
13255 \\let\\asis=\\relax
13256
13257 ## Remove all lines we neither need nor want.
13258 /^\\input /d
13259 /^@anchor/d
13260 /^@bye/d
13261 /^@documentencoding/d
13262 /^@node/d
13263 /^@setfilename/d
13264 /^@settitle/d
13265 /^@top/d
13266 /@menu/,/@end menu/d
13267
13268 ## Convert sectioning macros to our own hierarchy.
13269 s/^@chapter \(.*\)$/\\subsection{\\titlecase{\1}\\label{\1}}/
13270 s/^@section \(.*\)$/\\subsubsection{\\titlecase{\1}}\\label{\1}/
13271
13272 ## Make `@asis' list resemble the Texinfo format.
13273 s/@table @asis/\\begin{list}{}{\\itemindent=-20pt\\leftmargin=20pt}/
13274 s/@end table/\\end{list}/
13275
13276 ## We substitute our `widebody' environment for `@display'.
13277 s/@display/\\begin{widebody}/
13278 s/@end display/\\end{widebody}/
13279
13280 ## Translate `@example' environments.
13281 s/@example/\\begin{quote}\\tt\\obeylines/
13282 s/@end example/\\end{quote}\n\n/
13283
13284 ## Indenting by four spaces generates a `verbatim' environment.
13285 s/@verbatim/\\begin{verbatim}/
13286 s/@end verbatim/\\end{verbatim}/
13287
13288 ## The argument format of the URL macro is different.
13289 s/@url{\([^,]*\), \([^}]*\)}/\\href{\1}{\2}/g
13290
13291 ## Use our own markup.
13292 s/\.\.\./\\dots{}/g
13293 s/LaTeX/\\LaTeX{}/g
13294 s/@file/\\emph/g
13295 s/@strong/\\textbf/g
13296 s/@var/\\emph/g
13297 s/[w]{/mbox{/g
13298
13299 ## Translate some Texinfo macros.
13300 s/@backslashchar/\\char`\\\\/g
13301 s/@lbracechar/\\{/g
13302 s/@noindent/\\noindent/g
13303 s/@rbracechar/\\}/g
13304
13305 ## Quote some special characters.
13306 s/%/\\%/g
13307 s/_/\\_/g
13308
13309 ## Add space around alternative-indicators.
13310 s/[|]/\\,|\\,/g
13311
13312 ## Adapt to how a man-page is typeset.
13313 ## En-dashes in front of long options really suck!
13314 s/--/-\\nolig*-/g
13315
13316 ## Converting the at-signs to backslashes is a bit tricky.
13317 s/^@item/\\item/
13318 s/@\([A-Za-z][A-Za-z]*\){/\\\1{/g
13319 s/@@/@/g
13320
13321 ## Convert selected macro names.
13322 s/\\jobname/\\textbackslash jobname/g
13323
13324 ## Make qualified Perl names breakable.
13325 s/::/::\\breakpoint*/g
13326 %</teximan2latex>
13327 % \fi
13328 %
13329 %
13330 %
13331 % \iffalse
13332 %<*typog-grep>
13333 #! /usr/bin/env perl
13334
13335
13336 use autodie qw(:all);
13337 use strict;
13338 use warnings;
13339
13340 use Data::Dumper ();
13341 use Encode ();
13342 use English;
13343 use File::Basename ();
13344 use Getopt::Long;
13345 use IO::File;
13346 use IO::Handle;
13347 use Term::ANSIColor ();
13348
13349
13350 use constant COMMAND_NAME => File::Basename::basename($PROGRAM_NAME);
13351
13352
13353 my $DEBUG = 0;
13354 my $MATCH_COUNT = 0;
13355 my $OUTPUT_IS_REDIRECTED;
13356
13357
13358 sub fail_with_error {
13359 print STDERR join('', COMMAND_NAME, ': ', @_, "\n");
13360 exit 2;
13361 }
13362
13363
13364 sub issue_warning {
13365 print STDERR join('', COMMAND_NAME, ': warning: ', @_, "\n");
13366 }
13367
13368
13369 sub debug_print {
13370 return unless $DEBUG;
13371 print STDERR "+ @_\n";
13372 }
13373
13374
13375 sub quote_filesystem {qq("$_[0]")}
13376 sub quote_literal {qq(`$_[0]')}
13377
13378
13379 sub limit_string_length {
13380 my ($a_string, $a_maximum_length) = @_;
13381
13382 if (length $a_string <= $a_maximum_length) {
13383 $a_string;
13384 } else {
13385 substr($a_string, 0, $a_maximum_length - 3) . '...';
13386 }
13387 }
13388
13389
13390 ## We set all colors to `undef' and fill them later with the values
13391 ## of the actual configuration.
13392 my $highlight_patterns = {
13393 PARTIAL_LINE => {
13394 FONT_SPEC => [qr#
13395 \\
13396 (?: OMS | OMX | OT1 | T1 | TS1 | U )
13397 (?: /[^/]+ ){5} / \S+ \s
13398 (?: \([+-]\d+\) )?
13399 #x, undef],
13400 MATH => [qr#
13401 \$
13402 \\
13403 (?: LMS | OML )
13404 (?: /[^/]+ ){5} / \S+ \s
13405 (?: \([+-]\d+\) )?
13406 .*?
13407 \$
13408 #x, undef]
13409 },
13410 WHOLE_LINE => {
13411 FILL_STATE => [qr#^(?:Under|Over)full \\hbox .*$#, undef],
13412 FIRST_VBOX => [qr#^%%#, undef],
13413 HORIZONTAL_BREAKPOINT => [qr#^@@\d+:.*$#, undef],
13414 HORIZONTAL_BREAK_CANDIDATE => [qr#^@[\\ ].*$#, undef],
13415 LINE_BREAK_PASS => [qr#^@[a-z]+?pass#, undef],
13416 TIGHTNESS => [qr#^(?:Loose|Tight) \\hbox .*$#, undef],
13417 VERTICAL_BREAKPOINT => [qr#^% t=\d+.*$#, undef]
13418 }
13419 };
13420
13421
13422 sub colorize_line {
13423 my ($configuration, $line) = @_;
13424
13425 foreach my $pattern_color_pair (values %{$highlight_patterns->{WHOLE_LINE}}) {
13426 next unless $pattern_color_pair->[1];
13427 return Term::ANSIColor::colored($line, $pattern_color_pair->[1])
13428 if $line =~ $pattern_color_pair->[0];
13429 }
13430 return $line if $line =~ m#^\.#; # we do not paint box contents yet
13431
13432 $line =~ s#$highlight_patterns->{PARTIAL_LINE}->{MATH}->[0]
13433 #Term::ANSIColor::colored($MATCH, $highlight_patterns->{PARTIAL_LINE}->{MATH}->[1])
13434 #egx;
13435
13436 $line =~ s#$highlight_patterns->{PARTIAL_LINE}->{FONT_SPEC}->[0]
13437 #Term::ANSIColor::colored($MATCH, $highlight_patterns->{PARTIAL_LINE}->{FONT_SPEC}->[1])
13438 #egx;
13439
13440 return $line;
13441 }
13442
13443
13444 my $open_or_close_tag_regexp = qr#^</?typog-inspect[ >]#; # somewhat sloppy definition
13445 my $close_tag_regexp = qr#^</typog-inspect>#;
13446 my $open_tag_regexp =
13447 qr#^
13448 <typog-inspect \s+
13449 id="(?<id_match> .*?)" \s+
13450 job="(?<job_match> .*?)" \s+
13451 line="(?<line_match> .*?)" \s+
13452 page="(?<page_match> .*?)"
13453 >#x;
13454
13455
13456 sub find_encoder {
13457 my $encoding = shift;
13458
13459 my $encoder;
13460
13461 if ($encoding) {
13462 $encoder = Encode::find_encoding($encoding);
13463 if (!$encoder) {
13464 issue_warning("encoding @{[quote_literal($encoding)]} unknown; proceeding without decoder");
13465 }
13466 }
13467
13468 return $encoder;
13469 }
13470
13471
13472 sub grep_log_file {
13473 my ($options, $configuration, $file, $filename, $id_regexp) = @_;
13474
13475 my $encoder = find_encoder($options->{ENCODING});
13476 my $job_name;
13477 my $line_number = 0; # line number in the log file we are inspecting, i.e., $filename
13478 my $match_count = 0;
13479 my $source_line_number; # line number in TeX file the log refers to, i.e., "$job_name.tex"
13480 my $page_number;
13481 my $regexp_modifier = $options->{IGNORE_CASE} ? 'i' : '';
13482 my $id_value;
13483 my @nesting_levels;
13484
13485 if ($options->{WORD_REGEXP}) {
13486 $id_regexp = "\\b$id_regexp\\b";
13487 }
13488
13489 while (my $line = readline $file) {
13490 chomp $line;
13491 $line_number++;
13492
13493 $line = Encode::encode_utf8($encoder->decode($line, Encode::FB_CROAK)) if $encoder;
13494
13495 if ($line =~ $close_tag_regexp) {
13496 fail_with_error("$filename: $line_number: mismatched open/close tags") unless @nesting_levels;
13497 pop @nesting_levels;
13498 }
13499
13500 if (@nesting_levels and $nesting_levels[-1] and $line !~ $open_or_close_tag_regexp) {
13501 if ($options->{LOG_LINE_NUMBER}) {
13502 my $formatted_log_line_number =
13503 sprintf $configuration->{LOG_LINE_NUMBER_FORMAT}, $line_number;
13504 if ($options->{COLORIZE_OUTPUT}) {
13505 $formatted_log_line_number =
13506 Term::ANSIColor::colored($formatted_log_line_number,
13507 $configuration->{COLORS}->{LOG_LINE_NUMBER});
13508 }
13509 print $formatted_log_line_number, ' ';
13510 }
13511
13512 print "$job_name: " if $options->{JOB_NAME};
13513
13514 if ($options->{LINE_NUMBER}) {
13515 my $formatted_line_number = sprintf $configuration->{LINE_NUMBER_FORMAT}, $source_line_number;
13516 if ($options->{COLORIZE_OUTPUT}) {
13517 $formatted_line_number =
13518 Term::ANSIColor::colored($formatted_line_number,
13519 $configuration->{COLORS}->{LINE_NUMBER});
13520 }
13521 print $formatted_line_number, ' ';
13522 }
13523
13524 if ($options->{PAGE_NUMBER}) {
13525 my $formatted_page_number = sprintf $configuration->{PAGE_NUMBER_FORMAT}, $page_number;
13526 if ($options->{COLORIZE_OUTPUT}) {
13527 $formatted_page_number =
13528 Term::ANSIColor::colored($formatted_page_number,
13529 $configuration->{COLORS}->{PAGE_NUMBER});
13530 }
13531 print $formatted_page_number, ' ';
13532 }
13533
13534 if ($options->{ID} and not $configuration->{PRINT_ID_AS_HEADING}) {
13535 my $formatted_id = sprintf $configuration->{ID_INLINE_FORMAT}, $id_value;
13536 if ($options->{COLORIZE_OUTPUT}) {
13537 $formatted_id = Term::ANSIColor::colored($formatted_id ,
13538 $configuration->{COLORS}->{ID_COLOR});
13539 }
13540 print $formatted_id, ' ';
13541 }
13542
13543 if ($options->{COLORIZE_OUTPUT}) {
13544 print colorize_line($configuration, $line);
13545 } else {
13546 print $line;
13547 }
13548 print "\n";
13549 }
13550
13551 if ($line =~ $open_tag_regexp) {
13552 $id_value = limit_string_length($+{id_match}, $configuration->{ID_MAX_LENGTH});
13553 $job_name = $+{job_match};
13554 $source_line_number = $+{line_match};
13555 $page_number = $+{page_match};
13556
13557 my $found_matching_id = ($id_value =~ m/(?$regexp_modifier)$id_regexp/) ? 1 : 0;
13558 push @nesting_levels, $found_matching_id;
13559 if ($found_matching_id) {
13560 ++$MATCH_COUNT; # global count -- needed for return code of program
13561 ++$match_count; # per file count -- needed to be able to separate the hunks
13562
13563 print "\n" if $match_count >= 2;
13564 if ($options->{ID} and $configuration->{PRINT_ID_AS_HEADING}) {
13565 my $formatted_id = sprintf $configuration->{ID_HEADING_FORMAT}, $id_value;
13566 if ($options->{COLORIZE_OUTPUT}) {
13567 $formatted_id =
13568 Term::ANSIColor::colored($formatted_id,
13569 $configuration->{COLORS}->{ID_HEADING_COLOR});
13570 }
13571 print $formatted_id, "\n";
13572 }
13573 }
13574 }
13575 }
13576
13577 return $match_count;
13578 }
13579
13580
13581 sub show_ids_in_file {
13582 my ($options, $configuration, $file, $filename, $id_regexp) = @_;
13583
13584 my $encoder = find_encoder($options->{ENCODING});
13585 my $line_number = 0;
13586 my $match_count = 0;
13587 my @nesting_levels;
13588
13589 while (my $line = readline $file) {
13590 chomp $line;
13591 $line_number++;
13592
13593 $line = Encode::encode_utf8($encoder->decode($line, Encode::FB_CROAK)) if $encoder;
13594
13595 if ($line =~ $close_tag_regexp) {
13596 fail_with_error("$filename: $line_number: mismatched open/close tags") unless @nesting_levels;
13597 pop @nesting_levels;
13598 }
13599
13600 if ($line =~ $open_tag_regexp) {
13601 my $id_value = limit_string_length($+{id_match}, $configuration->{ID_MAX_LENGTH});
13602 my $job_name = $+{job_match};
13603 my $source_line_number = $+{line_match};
13604 my $page_number = $+{page_match};
13605
13606 ++$MATCH_COUNT;
13607 ++$match_count;
13608 push @nesting_levels, 1;
13609
13610 if ($options->{LOG_LINE_NUMBER}) {
13611 my $formatted_log_line_number =
13612 sprintf $configuration->{LOG_LINE_NUMBER_FORMAT}, $line_number;
13613 if ($options->{COLORIZE_OUTPUT}) {
13614 $formatted_log_line_number =
13615 Term::ANSIColor::colored($formatted_log_line_number,
13616 $configuration->{COLORS}->{LOG_LINE_NUMBER});
13617 }
13618 print $formatted_log_line_number, ' ';
13619 }
13620
13621 print "$job_name: " if $options->{JOB_NAME};
13622
13623 if ($options->{LINE_NUMBER}) {
13624 my $formatted_line_number = sprintf $configuration->{LINE_NUMBER_FORMAT}, $source_line_number;
13625 if ($options->{COLORIZE_OUTPUT}) {
13626 $formatted_line_number =
13627 Term::ANSIColor::colored($formatted_line_number,
13628 $configuration->{COLORS}->{LINE_NUMBER});
13629 }
13630 print $formatted_line_number, ' ';
13631 }
13632
13633 if ($options->{PAGE_NUMBER}) {
13634 my $formatted_page_number = sprintf $configuration->{PAGE_NUMBER_FORMAT}, $page_number;
13635 if ($options->{COLORIZE_OUTPUT}) {
13636 $formatted_page_number =
13637 Term::ANSIColor::colored($formatted_page_number,
13638 $configuration->{COLORS}->{PAGE_NUMBER});
13639 }
13640 print $formatted_page_number, ' ';
13641 }
13642
13643 my $indent = $configuration->{ID_INDENT} * (@nesting_levels - 1);
13644 print ' ' x $indent, $id_value, "\n";
13645 }
13646 }
13647
13648 return $match_count;
13649 }
13650
13651
13652 sub open_file_for_reading {
13653 my $filename = shift;
13654
13655 my $file;
13656
13657 if ($filename eq 'stdin') {
13658 $file = IO::Handle->new();
13659 $file->fdopen(fileno(STDIN), 'r') or
13660 fail_with_error("cannot open stdin: $OS_ERROR");
13661 } else {
13662 $file = IO::File->new($filename, 'r') or
13663 fail_with_error("cannot open @{[quote_filesystem($filename)]}: $OS_ERROR");
13664 }
13665
13666 return $file;
13667 }
13668
13669
13670 sub close_file {
13671 my ($file, $filename) = shift;
13672
13673 $file->close or
13674 issue_warning("problems while closing @{[quote_filesystem($filename)]}: $OS_ERROR");
13675 }
13676
13677
13678 sub grep_or_show {
13679 my ($options, $configuration, $file, $filename, $id_regexp) = @_;
13680
13681 if ($options->{SHOW_ALL_IDS}) {
13682 return show_ids_in_file($options, $configuration, $file, $filename, $id_regexp);
13683 } else {
13684 return grep_log_file($options, $configuration, $file, $filename, $id_regexp);
13685 }
13686 }
13687
13688
13689 sub scan_files {
13690 my ($options, $configuration, $id_regexp, $log_filenames) = @_;
13691
13692 my $match_count = 0;
13693
13694 if (@$log_filenames) {
13695 foreach my $log_filename (@$log_filenames) {
13696 $log_filename = 'stdin' if $log_filename eq '-';
13697 if (@$log_filenames >= 2) {
13698 print "\n" unless $log_filename eq $log_filenames->[0];
13699 my $filename_header = "==> $log_filename <==\n";
13700 $filename_header = Term::ANSIColor::colored($filename_header,
13701 $configuration->{COLORS}->{FILE_HEADER})
13702 if $options->{COLORIZE_OUTPUT};
13703 print $filename_header;
13704 }
13705 my $file = open_file_for_reading($log_filename);
13706 $match_count += grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
13707 close_file($file, $log_filename);
13708 }
13709 } else {
13710 my $log_filename = 'stdin';
13711 my $file = open_file_for_reading($log_filename);
13712 $match_count = grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
13713 close_file($file, $log_filename);
13714 }
13715
13716 return $match_count;
13717 }
13718
13719
13720 sub redirect_and_scan_files {
13721 my ($options, $configuration, $id_regexp, $log_filenames) = @_;
13722
13723 my $pager;
13724
13725 my $pid = open($pager, '|-', $configuration->{PAGER}, $configuration->{PAGER_FLAGS});
13726 fail_with_error('failed to redirect to pager ', quote_literal($configuration->{PAGER}),
13727 ' with flags ', quote_literal($configuration->{PAGER_FLAGS}),
13728 ": $OS_ERROR")
13729 unless defined $pid;
13730 my $stdout = select $pager;
13731
13732 $pager->autoflush;
13733 my $match_count = scan_files($options, $configuration, $id_regexp, $log_filenames);
13734
13735 close $pager or issue_warning "error occurred while closing the pager (pid: $pid) pipe: $OS_ERROR";
13736 select $stdout;
13737
13738 return $match_count;
13739 }
13740
13741
13742 ########################################################################
13743
13744
13745 my $configuration_key_map = {
13746 'id-format' => 'ID_INLINE_FORMAT',
13747 'id-indent' => 'ID_INDENT',
13748 'id-heading' => 'PRINT_ID_AS_HEADING',
13749 'id-heading-format' => 'ID_HEADING_FORMAT',
13750 'id-max-length' => 'ID_MAX_LENGTH',
13751 'line-number-format' => 'LINE_NUMBER_FORMAT',
13752 'log-line-number-format' => 'LOG_LINE_NUMBER_FORMAT',
13753 'page-number-format' => 'PAGE_NUMBER_FORMAT',
13754
13755 'file-header-color' => 'FILE_HEADER',
13756 'fill-state-color' => 'FILL_STATE',
13757 'first-vbox-color' => 'FIRST_VBOX',
13758 'font-spec-color' => 'FONT_SPEC',
13759 'horizontal-break-candidate-color' => 'HORIZONTAL_BREAK_CANDIDATE',
13760 'horizontal-breakpoint-color' => 'HORIZONTAL_BREAKPOINT',
13761 'id-color' => 'ID_COLOR',
13762 'id-heading-color' => 'ID_HEADING_COLOR',
13763 'line-break-pass-color' => 'LINE_BREAK_PASS',
13764 'line-number-color' => 'LINE_NUMBER',
13765 'log-line-number-color' => 'LOG_LINE_NUMBER',
13766 'math-color' => 'MATH',
13767 'page-number-color' => 'PAGE_NUMBER',
13768 'pager' => 'PAGER',
13769 'pager-flags' => 'PAGER_FLAGS',
13770 'tightness-color' => 'TIGHTNESS',
13771 'vertical-breakpoint-color' => 'VERTICAL_BREAKPOINT'
13772 };
13773
13774
13775 my $default_configuration = {
13776 COLORS => {
13777 FILE_HEADER => 'bold black',
13778 FILL_STATE => 'bold magenta',
13779 FIRST_VBOX => 'bold red',
13780 FONT_SPEC => 'grey12',
13781 HORIZONTAL_BREAKPOINT => 'bold green',
13782 HORIZONTAL_BREAK_CANDIDATE => 'blue',
13783 ID_COLOR => 'white on_black',
13784 ID_HEADING_COLOR => 'white on_black',
13785 LINE_BREAK_PASS => 'bold green',
13786 LINE_NUMBER => 'bold black',
13787 LOG_LINE_NUMBER => 'italic black',
13788 MATH => 'yellow',
13789 PAGE_NUMBER => 'bold white on_red',
13790 TIGHTNESS => 'bold cyan',
13791 VERTICAL_BREAKPOINT => 'red'
13792 },
13793 ID_INLINE_FORMAT => '%s:',
13794 ID_HEADING_FORMAT => '--> %s <--',
13795 ID_INDENT => 8,
13796 ID_MAX_LENGTH => 40,
13797 LINE_NUMBER_FORMAT => '%5d',
13798 LOG_LINE_NUMBER_FORMAT => '%6d',
13799 PAGE_NUMBER_FORMAT => '[%3d]',
13800 PAGER => 'less',
13801 PAGER_FLAGS => '--quit-if-one-screen',
13802 PRINT_ID_AS_HEADING => 0
13803 };
13804
13805
13806 sub initialize_highlighting_from_configuration {
13807 my $configuration = shift;
13808
13809 while (my (undef, $assoc) = each %$highlight_patterns) {
13810 while (my ($name, $pattern_color_pair) = each %$assoc) {
13811 $pattern_color_pair->[1] = $configuration->{COLORS}->{$name};
13812 }
13813 }
13814 }
13815
13816
13817 sub modify_configuration {
13818 my ($configuration, $key, $value) = @_;
13819
13820 fail_with_error('malformed KEY=VALUE pair -- missing key') unless $key;
13821
13822 if (defined $configuration_key_map->{$key}) {
13823 if ($key =~ m/-color$/) {
13824 $configuration->{COLORS}->{$configuration_key_map->{$key}} = $value;
13825 } else {
13826 $configuration->{$configuration_key_map->{$key}} = $value;
13827 }
13828 } else {
13829 fail_with_error("@{[quote_literal($key)]} is not a valid configuration KEY");
13830 }
13831 }
13832
13833
13834 sub setup_configuation {
13835 my ($config_spec, $configuration) = @_;
13836
13837 foreach my $spec (split ':', $config_spec) {
13838 my ($key, $value) = split '=', $spec;
13839 modify_configuration($configuration, $key, $value);
13840 }
13841 }
13842
13843
13844 my $default_options = {
13845 COLORIZE_MODE => 'auto',
13846 DEBUG => 0,
13847 ENCODING => undef,
13848 ID => 0,
13849 IGNORE_CASE => 0,
13850 JOB_NAME => 0,
13851 LINE_NUMBER => 0,
13852 LOG_LINE_NUMBER => 0,
13853 PAGE_NUMBER => 0,
13854 REQUEST_PAGER => 1,
13855 WORD_REGEXP => 0
13856 };
13857
13858
13859 sub show_help {
13860 print <<HELP_TEXT;
13861 Usage: @{[COMMAND_NAME]} [OPTION] ID-REGEXP LOG-FILE...
13862 Structured grep for typog-inspect elements that match ID-REGEXP in LOG-FILE.
13863
13864 Options
13865 --color [WHEN],
13866 --colour [WHEN] use color to highlight specific log contents
13867 WHEN is 'always', 'never', or 'auto'
13868 -C, --config KEY=VALUE set configuration KEY to VALUE
13869 -E, --encoding ENCODING set character ENCODING of LOG-FILE
13870 -i, --[no-]id print matching id with output lines
13871 -y, --[no-]ignore-case ignore case distinctions in patterns and data
13872 -j, --[no-]job-name print \\jobname with output lines
13873 -n, --[no-]line-number print TeX-source line number with output lines
13874 -N, --[no-]log-line-number print log-file line number with output lines
13875 -p, --[no-]page-number print page number with output lines
13876 -P, --[no-]pager redirect output to pager
13877 -w, --[no-]word-regexp match only whole words
13878
13879 -a, --all, --any discover all IDs in LOG-FILE
13880
13881 --debug turn on debug output
13882 -h, --help display this help and exit
13883 --show-config show default configuration and exit
13884 --show-encodings show all known encodings and exit
13885 -V, --version show version information and exit
13886
13887 HELP_TEXT
13888
13889 exit 0;
13890 }
13891
13892
13893 sub show_encodings {
13894 my @all_encodings = Encode->encodings(':all');
13895
13896 foreach my $encoding (@all_encodings) {
13897 print "$encoding\n";
13898 }
13899
13900 exit 0;
13901 }
13902
13903
13904 sub show_configuration {
13905 my $format_string_value = sub {quote_literal($default_configuration->{$_[0]})};
13906
13907 print <<FIXED_CONFIGURATION_TEXT;
13908 Configuration
13909 Key Default Value
13910 ------------------------------------ -------------
13911 id-format @{[$format_string_value->('ID_INLINE_FORMAT')]}
13912 id-heading $default_configuration->{PRINT_ID_AS_HEADING}
13913 id-heading-format @{[$format_string_value->('ID_HEADING_FORMAT')]}
13914 id-indent $default_configuration->{ID_INDENT}
13915 id-max-length $default_configuration->{ID_MAX_LENGTH}
13916 line-number-format @{[$format_string_value->('LINE_NUMBER_FORMAT')]}
13917 log-line-number-format @{[$format_string_value->('LOG_LINE_NUMBER_FORMAT')]}
13918 page-number-format @{[$format_string_value->('PAGE_NUMBER_FORMAT')]}
13919 pager @{[$format_string_value->('PAGER')]}
13920 pager-flags @{[$format_string_value->('PAGER_FLAGS')]}
13921
13922 FIXED_CONFIGURATION_TEXT
13923
13924 foreach my $configuration_key (sort keys %$configuration_key_map) {
13925 next unless $configuration_key =~ m/-color$/;
13926 printf("%-36s %s\n",
13927 $configuration_key,
13928 quote_literal($default_configuration->
13929 {COLORS}->
13930 {$configuration_key_map->{$configuration_key}}));
13931 }
13932
13933 exit 0;
13934 }
13935
13936
13937 sub show_version {
13938 print <<VERSION_TEXT;
13939 typog-grep @RELEASE@
13940
13941 Copyright (C) 2025 by Ch. L. Spiel
13942 License LPPL: LaTeX Project Public License version 1.3c or later
13943 VERSION_TEXT
13944
13945 exit 0;
13946 }
13947
13948
13949 sub get_options {
13950 my ($options, $configuration) = @_;
13951
13952 Getopt::Long::Configure('gnu_getopt', 'no_ignore_case');
13953
13954 Getopt::Long::GetOptions('a|all|any' => \$options->{SHOW_ALL_IDS},
13955 'color|colour=s' => \$options->{COLORIZE_MODE},
13956 'C|configuration=s' => sub{setup_configuation($_[1], $configuration)},
13957 'debug+' => \$DEBUG,
13958 'E|encoding=s' => \$options->{ENCODING},
13959 'h|help' => \&show_help,
13960 'i|id!' => \$options->{ID},
13961 'y|ignore-case!' => \$options->{IGNORE_CASE},
13962 'j|job-name!' => \$options->{JOB_NAME},
13963 'n|line-number!' => \$options->{LINE_NUMBER},
13964 'N|log-line-number!' => \$options->{LOG_LINE_NUMBER},
13965 'p|page-number!' => \$options->{PAGE_NUMBER},
13966 'P|pager!' => \$options->{REQUEST_PAGER},
13967 'show-encodings' => \&show_encodings,
13968 'show-config' => \&show_configuration,
13969 'V|version' => \&show_version,
13970 'w|word-regexp!' => \$options->{WORD_REGEXP}) or
13971 fail_with_error('problems while parsing options');
13972
13973 if ($options->{COLORIZE_MODE}) {
13974 fail_with_error("unknown colorize mode @{[quote_literal($options->{COLORIZE_MODE})]}")
13975 unless $options->{COLORIZE_MODE} =~ m/^(?:always|auto|never)$/i;
13976 } else {
13977 $options->{COLORIZE_MODE} = 'auto';
13978 }
13979 }
13980
13981
13982 sub do_colorize {
13983 my $colorize_mode = shift;
13984
13985 if ($colorize_mode =~ m/never/i) {
13986 0;
13987 } elsif ($colorize_mode =~ m/always/i) {
13988 1;
13989 } elsif ($colorize_mode =~ m/auto/i) {
13990 not $OUTPUT_IS_REDIRECTED;
13991 }
13992 }
13993
13994
13995 ## For the comparison with the POSIX spec of grep(1) consult
13996 ## https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html
13997
13998
13999 sub main {
14000 $OUTPUT_IS_REDIRECTED = -t STDOUT ? 0 : 1;
14001
14002 my $configuration = {%$default_configuration};
14003 my $options = {%$default_options};
14004 debug_print(Data::Dumper::Dumper(['Default Configuration', $configuration]));
14005 debug_print(Data::Dumper::Dumper(['Default Options', $options]));
14006
14007 my $user_options = {};
14008 my $user_configuration = {};
14009 get_options($user_options, $user_configuration);
14010 debug_print(Data::Dumper::Dumper(['User Configuration', $user_configuration]));
14011 debug_print(Data::Dumper::Dumper(['User Options', $user_options]));
14012 while (my ($key, $value) = each %$user_options) {
14013 $options->{$key} = $value if $value;
14014 }
14015 while (my ($key, $value) = each %$user_configuration) {
14016 $configuration->{$key} = $value if $value;
14017 }
14018 debug_print(Data::Dumper::Dumper(['Final Configuration', $configuration]));
14019 debug_print(Data::Dumper::Dumper(['Final Options', $options]));
14020
14021 $options->{COLORIZE_OUTPUT} = do_colorize($options->{COLORIZE_MODE});
14022 initialize_highlighting_from_configuration($configuration);
14023
14024 my $id_regexp;
14025 if ($options->{SHOW_ALL_IDS}) {
14026 $id_regexp = '^';
14027 issue_warning("option @{[quote_literal('--id')]} ignored in @{[quote_literal('--all')]} mode")
14028 if $options->{ID};
14029 } else {
14030 fail_with_error('missing ID-REGEXP') unless @ARGV >= 1;
14031 $id_regexp = shift @ARGV;
14032 }
14033
14034 if ($user_options->{REQUEST_PAGER} && $OUTPUT_IS_REDIRECTED) {
14035 issue_warning("option @{[quote_literal('--pager')]} ignored because output is redirected");
14036 }
14037 my $use_pager = $options->{REQUEST_PAGER} && !$OUTPUT_IS_REDIRECTED;
14038 my $match_count;
14039 if ($use_pager) {
14040 $match_count = redirect_and_scan_files($options, $configuration, $id_regexp, \@ARGV);
14041 } else {
14042 $match_count = scan_files($options, $configuration, $id_regexp, \@ARGV);
14043 }
14044
14045 exit ($match_count == 0);
14046 }
14047
14048
14049 main();
14050 %</typog-grep>
14051 % \fi
14052 %
14053 %
14054 %
14055 % \iffalse
14056 %<*typog-grep-documentation>
14057 =begin man
14058
14059 .\" Turn off justification.
14060 .na
14061
14062 =end man
14063
14064 =head1 NAME
14065
14066 typog-grep - specialized grep for typog-inspect elements in LaTeX log files
14067
14068
14069 =head1 SYNOPSIS
14070
14071 =over
14072
14073 =item B<typog-grep> -a|--all|--any [I<OPTION>...] F<LOG-FILE>...
14074
14075 =item B<typog-grep> [I<OPTION>...] I<REGEXP> F<LOG-FILE>...
14076
14077 =back
14078
14079 The first form, ``discovery mode'', shows all I<ID>s of
14080
14081 =begin text
14082
14083 <typog-inspect id="ID" ...>
14084
14085 =end text
14086
14087 =begin man
14088
14089 .RS
14090 .EX
14091 <typog-inspect id="\fI\,ID\/\fP" ...>
14092 .EE
14093 .RE
14094
14095 =end man
14096
14097 =begin texinfo
14098
14099 @example
14100 <typog-inspect id="@var{ID}" ...>
14101 @end example
14102 @noindent
14103
14104 =end texinfo
14105
14106 Z<>
14107 elements in F<LOG-FILE>.
14108
14109 The second form shows the contents, I<LOG-DATA>, of the elements
14110
14111 =begin text
14112
14113 <typog-inspect id="ID" ...>
14114 LOG-DATA
14115 </typog-inspect>
14116
14117 =end text
14118
14119 =begin man
14120
14121 .RS
14122 .EX
14123 <typog-inspect id="\fI\,ID\/\fP" ...>
14124 \fILOG-DATA\fP
14125 </typog-inspect>
14126 .EE
14127 .RE
14128
14129 =end man
14130
14131 =begin texinfo
14132
14133 @example
14134 <typog-inspect id="@var{ID}" ...>
14135 @var{LOG-DATA}
14136 </typog-inspect>
14137 @end example
14138 @noindent
14139
14140 =end texinfo
14141
14142 Z<>
14143 whose I<ID>s match I<REGEXP> in F<LOG-FILE>.
14144
14145 If no F<LOG-FILE> is given read from F<stdin>.
14146 The S<filename C<->> is synonymous to F<stdin>.
14147
14148
14149 =head1 DESCRIPTION
14150
14151 B<typog-grep> is a tailored post-processor for LaTeX S<F<log> files>
14152 and the C<typoginspect> environment as provided by the S<LaTeX package typog>.
14153 It shares more with the venerable
14154 L<B<sgrep>|https://www.cs.helsinki.fi/u/jjaakkol/sgrep.html>
14155 than with S<POSIX L<B<grep>|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html>>.
14156
14157 In the LaTeX source file the user brackets her text or code
14158 in a C<typoginspect> environment:
14159
14160 =begin text
14161
14162 \begin{typoginspect}{ID}
14163 TEXT-OR-CODE-TO-INVESTIGATE
14164 \end{typoginspect}
14165
14166 =end text
14167
14168 =begin man
14169
14170 .RS
14171 .EX
14172 \ebegin{typoginspect}{\fI\,ID\/\fP}
14173 \fITEXT-OR-CODE-TO-INVESTIGATE\fP
14174 \eend{typoginspect}
14175 .EE
14176 .RE
14177
14178 =end man
14179
14180 =begin texinfo
14181
14182 @example
14183 @backslashchar{}begin@lbracechar{}typoginspect@rbracechar{}@lbracechar{}@var{ID}@rbracechar{}
14184 @var{TEXT-OR-CODE-TO-INVESTIGATE}
14185 @backslashchar{}end@lbracechar{}typoginspect@rbracechar{}
14186 @end example
14187 @noindent
14188
14189 =end texinfo
14190
14191 Z<>
14192 where I<ID> is used to identify one or more bracketed snippets.
14193 I<ID> does not have to be unique.
14194 The I<REGEXP> mechanism makes it easy to select groups of related I<ID>s
14195 if they are named accordingly.
14196
14197 In F<LOG-FILE> the result of the environment shows up,
14198 packed with tracing information, as
14199
14200 =begin text
14201
14202 <typog-inspect id="ID" job="JOB-NAME" line="LINE-NUMBER" page="PAGE-NUMBER">
14203 LOG-DATA
14204 </typog-inspect>
14205
14206 =end text
14207
14208 =begin man
14209
14210 .RS
14211 .EX
14212 <typog-inspect id="\fI\,ID\/\fP" job="\fI\,JOB-NAME\/\fP" line="\fI\,LINE-NUMBER\/\fP" page="\fI\,PAGE-NUMBER\/\fP">
14213 \fILOG-DATA\fP
14214 </typog-inspect>
14215 .EE
14216 .RE
14217
14218 =end man
14219
14220 =begin texinfo
14221
14222 @example
14223 <typog-inspect id="@var{ID}" job="@var{JOB-NAME}" line="@var{LINE-NUMBER}" page="@var{PAGE-NUMBER}">
14224 @var{LOG-DATA}
14225 </typog-inspect>
14226 @end example
14227 @noindent
14228
14229 =end texinfo
14230
14231 Z<>
14232 where all the capital-letter sequences are meta-variables
14233 and in particular
14234 I<JOB-NAME> is the expansion of C<\jobname>,
14235 I<LINE-NUMBER> is the LaTeX source file line number
14236 of the beginning of the C<typoginspect> environment,
14237 and I<PAGE-NUMBER> is the page where
14238 the output of S<C<TEXT-OR-CODE-TO-INVESTIGATE>> occurs.
14239
14240 B<typog-grep> reveals the contents of F<LOG-FILE>
14241 between C<E<lt>typog-inspect id="I<ID>" ...E<gt>>
14242 and C<E<lt>/typog-inspectE<gt>> excluding the XML-tags themselves.
14243 Access the I<JOB-NAME>, I<LINE-NUMBER>, and I<PAGE-NUMBER>
14244 with the commandline options
14245 B<--job-name>, B<--line-number>, and B<--page-number>.
14246 Use B<--id> to show the name of the IDs that matched I<REGEXP>.
14247
14248 C<typoginspect> environments can be nested.
14249 B<typog-grep> respects the nesting,
14250 i.e., if the I<ID> of the nested environment does not match I<REGEXP>
14251 it will not be included in the program's output.
14252
14253
14254 =head1 OPTIONS
14255
14256 The list of options is sorted by the names of the long options.
14257
14258 =over 4
14259
14260 =item B<-a>, B<--all>, B<--any>
14261
14262 ID-discovery mode:
14263 Discover all C<typog-inspect> elements independent of any matching patterns
14264 and print their I<ID>s.
14265 The results are printed in their order of occurrence in the F<LOG-FILE>s.
14266 Pipe the output into B<sort> to get alphabetically ordered I<ID>s.
14267
14268 Augment with options
14269 B<--job-name>, B<--line-number>, B<--log-line-number>, or S<B<--page-number>>
14270 for more information.
14271
14272 =item B<--color>, B<colour> I<WHEN>
14273
14274 Colorize specific log contents for the matching I<ID>s.
14275 The S<argument I<WHEN>> determines when to apply color:
14276 C<always>, C<never>, S<or C<auto>>.
14277 The setting C<auto> checks whether standard output has been redirected.
14278 This is the default.
14279
14280 =item B<-C>, B<--config> I<KEY>=I<VALUE>[:I<KEY>=I<VALUE>[:...]]
14281
14282 Set one or more configuration I<KEY> to I<VALUE> pairs.
14283 See section L</CONFIGURATION> for a description
14284 of all available configuration items.
14285 Use S<option B<--show-config>> to display the default configuration.
14286
14287 =item B<--debug>
14288
14289 Turn on debug output on F<stderr>.
14290
14291 =item B<-E>, B<--encoding> I<ENCODING>
14292
14293 Set the I<ENCODING> of F<LOG-FILE> for the translation to UTF-8.
14294 The default is unset.
14295
14296 Use this option to get rid of pesky
14297 S<"E<lt>I<HEX-DIGITS>E<gt>" escapes> on UTF-8 terminals.
14298 See S<option B<--show-encodings>> for the known encodings and
14299 Encode::Supported for a summary of all encodings.
14300 See also S<section L</Some Common Encodings>>.
14301
14302 Apply L<B<iconv>|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/iconv.html>
14303 (POSIX) or L<B<recode>|https://github.com/rrthomas/recode/> (GNU) on F<LOG-FILE>
14304 before this tool to avoid having to use S<option B<--encoding>>.
14305
14306 =item B<-h>, B<--help>
14307
14308 Display brief help then exit.
14309
14310 =item B<-i>, B<--[no-]id>
14311
14312 Print the actual ID-name that matched I<REGEXP>.
14313 Control the appearance of the matching I<ID> with configuration S<item C<id-heading>>.
14314
14315 =item B<-y>, B<--[no-]ignore-case>
14316
14317 Match I<ID>s while ignoring case distinctions in patterns and data.
14318
14319 =item B<-j>, B<--[no-]job-name>
14320
14321 Print the C<\jobname> that B<latex> associated with the input file.
14322
14323 =item B<-n>, B<--[no-]line-number>
14324
14325 Print the line number where the S<C<typoginspect> environment>
14326 was encountered in the LaTeX source file.
14327
14328 =item B<-N>, B<--[no-]log-line-number>
14329
14330 Print the line number of the F<log>-file where the current line was encountered.
14331
14332 =item B<-p>, B<--[no-]page-number>
14333
14334 Print page number where the contents of the S<C<typoginspect> environment>
14335 starts in the typeset document.
14336
14337 =item B<-P>, B<--[no-]pager>
14338
14339 Redirect output from F<stdout> to the configured pager.
14340
14341 =item B<--show-config>
14342
14343 Show the default configuration and exit.
14344
14345 =item B<--show-encodings>
14346
14347 Show all known encodings and exit.
14348
14349 =item B<-V>, B<--version>
14350
14351 Show version information and exit.
14352
14353 =item B<-w>, B<--[no-]word-regexp>
14354
14355 Match only whole words.
14356
14357 =back
14358
14359
14360 =head1 CONFIGURATION
14361
14362 =over 4
14363
14364 =item C<id-format>=I<FORMAT>
14365
14366 Control the I<FORMAT> for printing matching ids in inline-mode,
14367 where I<FORMAT> is passed to Perl's C<printf>.
14368 S<Default: C<%s:>.>
14369
14370 =item C<id-heading>=C<0>E<verbar>C<1>
14371
14372 Choose between printing the matching I<ID>s with S<option B<--id>>:
14373 S<Inline (C<0>)> or heading before the matching data (C<1>).
14374 S<Default: C<0>.>
14375
14376 =item C<id-heading-format>=I<FORMAT>
14377
14378 Control the I<FORMAT> for printing matching I<ID>s in heading-mode,
14379 where I<FORMAT> is passed to Perl's C<printf>.
14380 S<Default: C<--E<gt> %s E<lt>-->.>
14381
14382 =item C<id-indent>=I<INDENT>
14383
14384 Indentation of nested typog-inspect tags.
14385 Only used in ``discovery mode'' (first form), i.e., if S<B<--all>> is active.
14386 S<Default: 8.>
14387
14388 =item C<id-max-length>=I<MAXIMUM-LENGTH>
14389
14390 Set the maximum length of a matching I<ID> for printing.
14391 It a matching I<ID> exceeds this length it will be truncated
14392 and the last three characters (short of I<MAXIMUM-LENGTH>) will be replaced by dots.
14393 S<Default: 40.>
14394
14395 =item C<line-number-format>=I<FORMAT>
14396
14397 Control the I<FORMAT> for printing TeX source line numbers,
14398 where I<FORMAT> is passed to Perl's C<printf>.
14399 S<Default: C<%5d>.>
14400
14401 =item C<log-line-number-format>=I<FORMAT>
14402
14403 Control the I<FORMAT> for printing log line numbers,
14404 where I<FORMAT> is passed to Perl's C<printf>.
14405 S<Default: C<%6d>.>
14406
14407 =item C<page-number-format>=I<FORMAT>
14408
14409 Control the I<FORMAT> for printing page numbers,
14410 where I<FORMAT> is passed to Perl's C<printf>.
14411 S<Default: C<[%3d]>.>
14412
14413 =item C<pager>=I<PAGER>
14414
14415 Name of pager application to pipe output into
14416 if run with S<option B<--pager>>.
14417 S<Default: C<less>>.
14418
14419 =item C<pager-flags>=I<FLAGS>
14420
14421 Pass I<FLAGS> to I<PAGER>.
14422 S<Default: C<--quit-if-one-screen>>.
14423
14424 =item Color Configuration
14425
14426 For the syntax of the color specifications consult
14427 the manual page of Term::ANSIColor(pm).
14428
14429 =over 4
14430
14431 =item C<file-header-color>
14432
14433 Color of the filename header.
14434
14435 =item C<fill-state-color>
14436
14437 Color of the messages that report ``Underfull hbox'' or ``Overfull hbox''.
14438
14439 =item C<first-vbox-color>
14440
14441 Color of the first vbox on a page.
14442
14443 =item C<font-spec-color>
14444
14445 Color of font specifications.
14446
14447 =item C<horizontal-break-candidate-color>
14448
14449 Color of lines with horizontal-breakpoint S<candidates C<@>>.
14450
14451 =item C<horizontal-breakpoint-color>
14452
14453 Color of lines with horizontal S<breakpoints C<@@>>.
14454
14455 =item C<id-color>
14456
14457 Color of matching I<ID>s when printed inline.
14458
14459 =item C<id-heading-color>
14460
14461 Color of matching I<ID>s when printed in heading form.
14462
14463 =item C<line-break-pass-color>
14464
14465 Color of the lines showing which pass (e.g., C<@firstpass>)
14466 of the line-breaking algorithm is active.
14467
14468 =item C<line-number-color>
14469
14470 Color of TeX-source-file line numbers.
14471
14472 =item C<log-line-number-color>
14473
14474 Color of log-file line numbers.
14475
14476 =item C<math-color>
14477
14478 Color used for math expressions including their font specs.
14479
14480 =item C<page-number-color>
14481
14482 Color of page numbers of the final output.
14483
14484 =item C<tightness-color>
14485
14486 Color of lines with Tight/Loose hbox reports.
14487
14488 =item C<vertical-breakpoint-color>
14489
14490 Color of possible vertical breakpoints.
14491
14492 =back
14493
14494 =back
14495
14496
14497 =head2 Brief summary of colors and attributes
14498
14499 =over 4
14500
14501 =item Foreground Color
14502
14503 C<black>, C<red>, C<green>, C<yellow>,
14504 C<blue>, C<magenta>, C<cyan>, C<white>,
14505
14506 Prefix with C<bright_> for high-intensity or bold foreground.
14507
14508 =item Foreground Grey
14509
14510 C<grey0>, ..., C<grey23>
14511
14512 =item Background Color
14513
14514 C<on_black>, C<on_red>, C<on_green>, C<on_yellow>,
14515 S<C<on_blue>>, S<C<on_magenta>>, S<C<on_cyan>>, S<C<on_white>>
14516
14517 Replace C<on_> with C<on_bright_> for high-intensity or bold background.
14518
14519 =item Background Grey
14520
14521 C<on_grey0>, ..., C<on_grey23>
14522
14523 =item Text Attribute
14524
14525 C<bold>, C<dark>, C<italic>, C<underline>, C<reverse>
14526
14527 =back
14528
14529
14530 =head2 Some Common Encodings
14531
14532 The following list shows some encodings
14533 that are suitable for S<option B<--encoding>>.
14534
14535 =over 4
14536
14537 =item Latin-1, Western European
14538
14539 C<iso-8859-1>, C<cp850>, C<cp860>, C<cp1252>
14540
14541 =item Latin-2, Central European
14542
14543 C<iso-8859-2>, C<cp852>, C<cp1250>
14544
14545 =item Latin-3, South European (Esperanto, Maltese)
14546
14547 C<iso-8859-3>
14548
14549 =item Latin-4, North European (Baltics)
14550
14551 C<iso-8859-4>
14552
14553 =item Cyrillics
14554
14555 C<iso-8859-5>, C<cp855>, C<cp866> (Ukrainian), C<cp1251>
14556
14557 =item Arabic
14558
14559 C<iso-8859-6>, C<cp864>, C<cp1006> (Farsi), C<cp1256>
14560
14561 =item Greek
14562
14563 C<iso-8859-7>, C<cp737>, C<cp1253>
14564
14565 =item Hebrew
14566
14567 C<iso-8859-8>, C<cp862>, C<cp1255>
14568
14569 =item Turkish
14570
14571 C<iso-8859-9>, C<cp857>, C<cp1254>
14572
14573 =item Nordic
14574
14575 C<iso-8859-10>, C<cp865>, C<cp861> (Icelandic)
14576
14577 =item Thai
14578
14579 C<iso-8859-11>, C<cp874>
14580
14581 =item Baltic
14582
14583 C<iso-8859-13>, C<cp775>, C<cp1257>
14584
14585 =item Celtic
14586
14587 C<iso-8859-14>
14588
14589 =item Latin-9 (sometimes called Latin0)
14590
14591 C<iso-8859-15>
14592
14593 =item Latin-10
14594
14595 C<iso-8859-16>
14596
14597 =back
14598
14599
14600 =head1 EXIT STATUS
14601
14602 The exit status is 0 if at least one I<ID> matched I<REGEXP>,
14603 1 if no I<ID> matched I<REGEXP>, and 2 if an error occurred.
14604
14605
14606 =head1 CAVEATS
14607
14608 The end tag C<< </typog-inspect> >> sometimes gets placed too early in the output and the trace
14609 I<seems> truncated. However, LaTeX reliably logs the requested the trace information, but the
14610 write operations for trace data and the code which is used to print the S<end tag> are not
14611 synchronized.
14612
14613
14614 =head1 SEE ALSO
14615
14616 B<grep>(1), B<printf>(3), B<Encode::Supported>(pm), B<Term::ANSIColor>(pm)
14617
14618
14619 =cut
14620 %</typog-grep-documentation>
14621 % \fi
14622 %
14623 %
14624 %
14625 \endinput
14626 %
14627 %
14628 %
14629 %%% Local Variables:
14630 %%% compile-command: "latex typog.dtx"
14631 %%% fill-column: 96
14632 %%% End: