summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv76
1 files changed, 54 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
index 405abcb5da1..ce747a2025b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
@@ -15,7 +15,7 @@
\unprotect
-\registerctxluafile{spac-hor}{1.001}
+\registerctxluafile{spac-hor}{}
\let \parfillrightskip \parfillskip
\newskip\parfillleftskip
@@ -381,9 +381,9 @@
%D \macros
%D {frenchspacing,nonfrenchspacing}
%D
-%D Somehow \type{\frenchspacing} can lead to hyphenation between
-%D dashes so we now have \type {\newfrenchspacing} (moved from
-%D \type {syst-chr}).
+%D Somehow \type{\frenchspacing} can lead to hyphenation between dashes so we now
+%D have \type {\newfrenchspacing} (moved from \type {syst-chr}). Maybe it's not
+%D needed any more.
%D Hm ... todo:
@@ -515,7 +515,7 @@
\fi
\ifdefined\softhyphen \else
- \let\softhyphen\-
+ \let\softhyphen\explicitdiscretionary
\fi
\cldcontext{"\string\\unexpanded\string\\def\string\\\string\n{\string\\space}"}
@@ -680,6 +680,7 @@
\global \s_spac_narrower_middle \zeropoint
\global \s_spac_narrower_right \zeropoint\relax}
\installnarrowermethod \v!none {}
+\installnarrowermethod \v!reverse {} % never seen
\unexpanded\def\spac_narrower_start#1%
{\begingroup
@@ -693,19 +694,45 @@
\spac_narrower_start_apply{\narrowerparameter\v!default}%
\fi}
+\newskip\s_spac_narrower_left_last
+\newskip\s_spac_narrower_right_last
+\newconditional\s_spac_narrower_last_swap
+
\def\spac_narrower_start_apply#1%
{\narrowerparameter\c!before
\global\s_spac_narrower_left \zeropoint
\global\s_spac_narrower_right \zeropoint
\global\s_spac_narrower_middle\zeropoint
- \normalexpanded{\processcommalistwithparameters[#1]}\spac_narrower_initialize
- \advance\leftskip \dimexpr\s_spac_narrower_left +\s_spac_narrower_middle\relax
- \advance\rightskip\dimexpr\s_spac_narrower_right+\s_spac_narrower_middle\relax
+ \edef\askednarrower{#1}
+ \ifx\askednarrower\v!reverse
+ \ifconditional\s_spac_narrower_last_swap
+ \leftskip \s_spac_narrower_right_last
+ \rightskip\s_spac_narrower_left_last
+ \setfalse\s_spac_narrower_last_swap
+ \else
+ \leftskip \s_spac_narrower_left_last
+ \rightskip\s_spac_narrower_right_last
+ \settrue\s_spac_narrower_last_swap
+ \fi
+ \else
+ \normalexpanded{\processcommalistwithparameters[\askednarrower]}\spac_narrower_initialize
+ \advance\leftskip \dimexpr\s_spac_narrower_left +\s_spac_narrower_middle\relax
+ \advance\rightskip\dimexpr\s_spac_narrower_right+\s_spac_narrower_middle\relax
+ \fi
\seteffectivehsize}
\unexpanded\def\spac_narrower_stop
{\narrowerparameter\c!after
- \endgroup}
+ \normalexpanded{%
+ \endgroup
+ \s_spac_narrower_left_last \the\leftskip \relax
+ \s_spac_narrower_right_last\the\rightskip\relax
+ \ifconditional\s_spac_narrower_last_swap
+ \setfalse\s_spac_narrower_last_swap
+ \else
+ \settrue\s_spac_narrower_last_swap
+ \fi
+ }}
\unexpanded\def\startnarrower
{\dosingleempty\spac_narrower_start_basic}
@@ -822,14 +849,16 @@
\forgetbothskips
\to \everyforgetall
-\unexpanded\def\forgetparskip
- {\s_spac_whitespace_parskip\zeropoint
- \parskip\zeropoint
- \let\v_spac_whitespace_current\v!none}
-
-\appendtoks
- \forgetparskip
-\to \everyforgetall
+% in spac-ver.mkiv
+%
+% \unexpanded\def\forgetparskip
+% {\s_spac_whitespace_parskip\zeropoint
+% \parskip\zeropoint
+% \let\v_spac_whitespace_current\v!none}
+%
+% \appendtoks
+% \forgetparskip
+% \to \everyforgetall
%D Tolerance (can also be set with align):
@@ -1013,19 +1042,22 @@
%D adapted to \type {\hspace}:
\unexpanded\def\textormathspace #1#2#3{\ifmmode\mskip#1#2\else\kern #1\hspaceamount\empty{#3}\fi\relax}
+\unexpanded\def\textormathspacecommand #1#2#3{\ifmmode\mskip#1#2\else#3\fi\relax}
\unexpanded\def\breakabletextormathspace#1#2#3{\ifmmode\mskip#1#2\else\hskip#1\hspaceamount\empty{#3}\fi\relax}
\newmuskip\hairmuskip \hairmuskip=.15mu
\unexpanded\def\hairspace {\textormathspace+\hairmuskip{.5}}
\unexpanded\def\thinspace {\textormathspace+\thinmuskip 1}
-\unexpanded\def\medspace {\textormathspace+\medmuskip 2}
+%unexpanded\def\medspace {\textormathspace+\medmuskip 2} % 4/18 em
\unexpanded\def\thickspace {\textormathspace+\thickmuskip3}
\unexpanded\def\neghairspace {\textormathspace-\thinmuskip{.5}}
\unexpanded\def\negthinspace {\textormathspace-\thinmuskip 1}
\unexpanded\def\negmedspace {\textormathspace-\medmuskip 2}
\unexpanded\def\negthickspace{\textormathspace-\thickmuskip3}
+\unexpanded\edef\medspace {\textormathspacecommand+\medmuskip{\Uchar"205F}}
+
% needed for unicode:
%unexpanded\def\breakablethinspace {\breakabletextormathspace+\thinmuskip1}
@@ -1043,10 +1075,10 @@
%unexpanded\def\zerowidthnobreakspace {\penalty\plustenthousand\kern\zeropoint}
%unexpanded\def\zerowidthspace {\hskip\zeropoint}
-\definehspace[.5][.1250\emspaceamount] % could also be [.1250\spaceamount]
-\definehspace[1] [.1667\emspaceamount]
-\definehspace[2] [.2222\emspaceamount]
-\definehspace[3] [.2777\emspaceamount]
+\definehspace[.5][.1250\emwidth] % hair
+\definehspace[1] [.1667\emwidth] % thin
+\definehspace[2] [.2222\emwidth] % med
+\definehspace[3] [.2777\emwidth] % thick
\let \, \thinspace
\let \: \medspace