spacing-periods.tex /size: 4387 b    last modification: 2021-10-28 13:50
1% language=us runpath=texruns:manuals/spacing
2
3\environment spacing-style
4
5\startcomponent spacing-periods
6
7\startchapter[title=Periods in abbreviations]
8
9% \enabletrackers[typesetters.periodkerns]
10
11When you use so called non french spacing you get more spacing after punctuation
12(as determined by the \type {sfcode} of the punctuation character) . However,
13when you use periods as delimiters for abbreviations, that period is not the end
14of a sentence and you want normal interword spacing instead. One way to achieve
15this is to add a backslash after the period but in an automated workflow where
16the source is not coming from \TEX\ but for instance in \XML\ format, you can't
17do that. The \type {\setupspacing} command can be used to set one of:
18
19\starttabulate[|T|p|]
20\NC fixed  \NC \showglyphs \frenchspacing    bla bla e.g. some more \NC \NR
21\NC packed \NC \showglyphs \newfrenchspacing bla bla e.g. some more \NC \NR
22\NC broad  \NC \showglyphs \nonfrenchspacing bla bla e.g. some more \NC \NR
23\stoptabulate
24
25The \type {packed} case is similar to \type {fixed} but has slightly larger (some
265\percent) spacing after punctuation which (at least historically) avoids some
27side effects with hyphenation and dashes. We default to \type {broad} anyway.
28
29The next examples demonstrate what the \type {\setperiodkerning} does when it gets
30an option passed. Its counterpart is \type {\resetperiodkerning}.
31
32\starttabulate[|T|Tr|p|]
33    \HL
34    \NC                   \NC    \NC \showglyphs \nonfrenchspacing \resetperiodkerning                  bla bla e.g. some more \NC \NR
35    \NC                   \NC    \NC \showglyphs \nonfrenchspacing \resetperiodkerning                  bla bla e.g. Some more \NC \NR
36    \HL
37    \NC zerospaceperiods  \NC 0  \NC \showglyphs \nonfrenchspacing \setperiodkerning  [zerospaceperiods]bla bla e.g. some more \NC \NR
38    \NC                   \NC    \NC \showglyphs \nonfrenchspacing \setperiodkerning  [zerospaceperiods]bla bla e.g. Some more \NC \NR
39    \HL
40    \NC smallspaceperiods \NC .25\NC \showglyphs \nonfrenchspacing \setperiodkerning [smallspaceperiods]bla bla e.g. some more \NC \NR
41    \NC                   \NC    \NC \showglyphs \nonfrenchspacing \setperiodkerning [smallspaceperiods]bla bla e.g. Some more \NC \NR
42    \HL
43    \NC halfspaceperiods  \NC .50 \NC \showglyphs \nonfrenchspacing \setperiodkerning  [halfspaceperiods]bla bla e.g. some more \NC \NR
44    \NC                   \NC    \NC \showglyphs \nonfrenchspacing \setperiodkerning  [halfspaceperiods]bla bla e.g. Some more \NC \NR
45    \HL
46\stoptabulate
47
48Next we enlarge the affected bit of text so that you can see that the last two
49options also affects the space after the periods that bind the characters.
50
51\startlinecorrection
52\startcombination[4*2]
53    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \resetperiodkerning                  e.g. s}}} {}
54    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \setperiodkerning  [zerospaceperiods]e.g. s}}} {}
55    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \setperiodkerning [smallspaceperiods]e.g. s}}} {}
56    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \setperiodkerning  [halfspaceperiods]e.g. s}}} {}
57    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \resetperiodkerning                  e.g. S}}} {}
58    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \setperiodkerning  [zerospaceperiods]e.g. S}}} {\ttxx zerospaceperiods}
59    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \setperiodkerning [smallspaceperiods]e.g. S}}} {\ttxx smallspaceperiods}
60    {\scale[scale=3500]{\ruledhbox{\showglyphs \nonfrenchspacing \setperiodkerning  [halfspaceperiods]e.g. S}}} {\ttxx halfspaceperiods}
61\stopcombination
62\stoplinecorrection
63
64Defining more options is easy, we only specify the factor that determines mid
65periods. When \type {factor} is zero, only the final period is looked at.
66
67\starttyping
68\defineperiodkerning [zerospaceperiods]  [factor=0]
69\defineperiodkerning [smallspaceperiods] [factor=.25]
70\defineperiodkerning [halfspaceperiods]  [factor=.5]
71\stoptyping
72
73This mechanism has been present for a while but I forgot about it. When cleaning
74up code it was decided to add it to the core. Maybe more options and features are
75needed but so far there has never been demand for this so \unknown
76
77\stopchapter
78
79\stopcomponent
80