diff options
author | Karl Berry <karl@freefriends.org> | 2018-07-03 21:02:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-07-03 21:02:29 +0000 |
commit | cd775453e6876b8eeca27d56ccc301bc813977a8 (patch) | |
tree | 0373a735059d04322b6e6dc8add864b91acaa19a /Master/texmf-dist/tex/latex/ncctools/extdash.sty | |
parent | 8dfe7d3b1c0cf293f8753f67e4c8078e616ca730 (diff) |
ncctools (3jul18)
git-svn-id: svn://tug.org/texlive/trunk@48127 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ncctools/extdash.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ncctools/extdash.sty | 44 |
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 |