summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncctools/extdash.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ncctools/extdash.sty')
-rw-r--r--Master/texmf-dist/tex/latex/ncctools/extdash.sty44
1 files changed, 34 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/ncctools/extdash.sty b/Master/texmf-dist/tex/latex/ncctools/extdash.sty
index fe69c324652..66001a833b0 100644
--- a/Master/texmf-dist/tex/latex/ncctools/extdash.sty
+++ b/Master/texmf-dist/tex/latex/ncctools/extdash.sty
@@ -20,11 +20,11 @@
%% For the copying and distribution conditions of the source files,
%% see the README file distributed with the ncctools bundle.
%%
-%% File: extdash.dtx Copyright (C) 1998-2005 by Alexander I. Rozhenko
+%% File: extdash.dtx Copyright (C) 1998-2018 by Alexander I. Rozhenko
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{extdash}
- [2005/01/29 v1.2 Extended Dash Package (NCC)]
+ [2018/06/24 v1.3 Extended Dash Package (NCC)]
\def\EXD@test#1{%
\@ifstar{\let\EXD@break\nobreak #1}{\let\EXD@break\@empty #1}%
}
@@ -32,28 +32,49 @@
\DeclareRobustCommand{\Endash}{\EXD@test{\EXD@dash{--}}}
\DeclareRobustCommand{\Emdash}{\EXD@test{\EXD@emd@sh}}
\DeclareRobustCommand{\Halfspace}{\@tempcnta\z@
- \@ifstar{\nobreak\EXD@space\ignorespaces}{\EXD@space\ignorespaces}%
+ \@ifstar{\EXD@nobreak\EXD@space\ignorespaces}{\EXD@space\ignorespaces}%
}
+\def\EXD@nobreak{\ifvmode\leavevmode\else\nobreak\fi}
\def\EXD@dash#1{%
- \nobreak\leavevmode\hbox{#1}\EXD@break\hskip\z@skip \ignorespaces
+ \EXD@nobreak\hbox{#1}\EXD@break\hskip\z@skip \ignorespaces
}
+\def\EXD@emnobreak{\nobreak}
\def\EXD@emd@sh{%
\ifvmode
- \EXD@emdash\nobreak\hskip.35em
+ \leavevmode\EXD@emdash\nobreak\hskip.35em
\else
- \unskip\nobreak\@tempcnta\m@ne
+ \unskip\EXD@emnobreak \@tempcnta\m@ne
\EXD@space \EXD@emdash \EXD@break \EXD@space
\fi \ignorespaces
}
-\def\EXD@space{%
+\DeclareOption{allowbreakbefore}{%
+ \let\EXD@emnobreak\@empty
+}
+\def\EXD@spacecalc{%
\edef\@tempa{%
\ifnum\@tempcnta<\z@ .4\else \ifnum \@tempcnta=\z@ .5\else .6\fi\fi
}%
- \hskip \@tempa\fontdimen2\font \@plus .5\fontdimen3\font
+ \def\@tempb{.5}%
+}
+\def\EXD@space{%
+ \EXD@spacecalc
+ \hskip \@tempa\fontdimen2\font \@plus \@tempb\fontdimen3\font
\@minus \@tempa\fontdimen4\font
\@tempcnta -\@tempcnta
}
-\def\EXD@emdash{\leavevmode\hbox{---}}
+\DeclareOption{wordspacearound}{%
+ \def\EXD@spacecalc{%
+ \edef\@tempa{\ifnum \@tempcnta=\z@ .5\fi}%
+ \let\@tempb\@tempa
+ }
+}
+\DeclareOption{nospacearound}{%
+ \def\EXD@spacecalc{%
+ \edef\@tempa{\ifnum \@tempcnta=\z@ .5\else0\fi}%
+ \let\@tempb\@tempa
+ }
+}
+\def\EXD@emdash{\hbox{---}}
\DeclareOption{shortcuts}{%
\DeclareRobustCommand{\HyphOrDash}{%
\let\EXD@break\@empty
@@ -82,8 +103,11 @@
\let\EXD@bar\= \let\@acciii\BarOrDash \let\=\@acciii
}
}
+\DeclareOption{shortemdash}{%
+ \def\EXD@emdash{\hb@xt@.8\fontdimen6\font{--\hss--}}
+}
\DeclareOption{cyremdash}{%
- \def\EXD@emdash{\leavevmode\hb@xt@.8\fontdimen6\font{--\hss--}}
+ \def\EXD@emdash{\hb@xt@.8\fontdimen6\font{--\hss--}}
}
\ProcessOptions\relax
\endinput