With tracking activated for small caps, it can be a little bit hard to detect interword spaces. Cf. below.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Libertine Serif}[
SmallCapsFeatures = {Letters = SmallCaps, LetterSpace = 5}]
\begin{document}
The title of my article is \textsc{This is the moment your life changed forever}.
\end{document}
I'd like to increase the space between words in small caps, therefore, but only when words on either side are in small caps (i.e. there should be no extra space before the first word written in small caps or after the last word).
I would've thought I could do this by adding WordSpace = <>
to SmallCapsFeatures
, but this will change the interword space everywhere.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Libertine Serif}[
SmallCapsFeatures = {Letters = SmallCaps, LetterSpace = 5, WordSpace = 5}]
\begin{document}
The title of my article is \textsc{This is the moment your life changed forever}.
\end{document}
Best Answer
You want to set
\spaceskip
to a non null value (and perhaps also\xspaceskip
).The values are of course exaggerated: here the interword space is set to three times the normal value.
When
\spaceskip
has a nonzero value, it is used for the interword space instead of the default font defined one. The relevant font parameters are\fontdimen2\font
(the natural width of the interword space)\fontdimen3\font
(the stretch component)\fontdimen4\font
(the shrink component)Thus, specifying
we're telling to use three times the normal interword space, stretchable three times as much it is normally and shrinking it the same as the default. The parameter
\xspaceskip
is related to the space factor: when the space factor is >2000, TeX adds its value to the normal interword space (this is how the space is increased after periods); by default TeX uses\fontdimen7\font
, but it uses\xspaceskip
if it is nonzero.