summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-08-13 19:57:44 +0000
committerKarl Berry <karl@freefriends.org>2023-08-13 19:57:44 +0000
commitea2e240fa7961191ace5bec8b6b45162c8a48b84 (patch)
tree9604f5ddf55d759b961ce3834a6a3b0660f0ca23 /Master/texmf-dist/tex
parente192ab695d29e59387dcc15edaf39dc3e70618af (diff)
xpunctuate (13aug23)
git-svn-id: svn://tug.org/texlive/trunk@67918 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty108
1 files changed, 55 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty b/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty
index a0768f655f2..a14c8674f53 100644
--- a/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty
+++ b/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty
@@ -6,68 +6,70 @@
%%
%% xpunctuate.dtx (with options: `package')
%%
-%% Copyright (C) 2012 by Philip G. Ratcliffe <philip.ratcliffe@uninsubria.it>
+%% Copyright (C) 2023 Philip G. Ratcliffe <philip.ratcliffe@uninsubria.it>
%%
-%% This file may be distributed and/or modified under the conditions of
-%% the LaTeX Project Public License, either version 1.2 of this license
-%% or (at your option) any later version. The latest version of this
-%% license is in:
+%% It may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this
+%% license or (at your option) any later version. The latest version
+%% of this license is in the file
%%
%% http://www.latex-project.org/lppl.txt
%%
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% This file is part of the "xpunctuate package" (the Work in LPPL)
+%% and all files in that package must be distributed together.
%%
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+%% The released version of this package is available from CTAN.
+%%
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesPackage{xpunctuate}
- [2012/05/21 v1.0 trailing punctuation package (PGR)]
+ [2023/08/13 v2.0 punctuation after command names (PGR)]
\RequirePackage{xspace}
-\DeclareRobustCommand\xperiod{\xprd@Set{}}
-\DeclareRobustCommand\xperiodafter[1]{\xprd@Set{#1}}
-\DeclareRobustCommand\xcomma{\xcmm@Set{}}
-\DeclareRobustCommand\xcommaafter[1]{\xcmm@Set{#1}}
-\DeclareRobustCommand\xperiodcomma{\xpcm@Set{}}
-\DeclareRobustCommand\xperiodcommaafter[1]{\xpcm@Set{#1}}
-\newcommand\xprd@Set[1]{\def\xprd@Obj{#1}\futurelet\xprd@Nxt\xprd@Fin}
-\newcommand\xprd@Fin{%
- \ifx\xprd@Nxt.\relax
- \let\xprd@Out\xprd@Obj
- \else
- \def\xprd@Out{\xprd@Obj.\@\xspace}%
+\xspaceaddexceptions{\xcomma\xperiod\xperiodcomma}
+\NewDocumentCommand\xspaceafter{}{\xpnct@aux\xspace@aux}
+\NewDocumentCommand\xperiod{}{\xpnct@aux\xperiod@aux{}}
+\NewDocumentCommand\xperiodafter{}{\xpnct@aux\xperiod@aux}
+\NewDocumentCommand\xcomma{}{\xpnct@aux\xcomma@aux{}}
+\NewDocumentCommand\xcommaafter{}{\xpnct@aux\xcomma@aux}
+\NewDocumentCommand\xperiodcomma{}{\xpnct@aux\xperiodcomma@aux{}}
+\NewDocumentCommand\xperiodcommaafter{}{\xpnct@aux\xperiodcomma@aux}
+\newtoks\xpnct@tok
+\def\xpnct@aux#1#2{%
+ \xpnct@tok{#2}%
+ \futurelet\xpnct@nxt#1}
+\def\xspace@aux{%
+ \ifx\xpnct@nxt,\else
+ \ifx\xpnct@nxt.\else
+ \xpnct@tok\expandafter{\the\xpnct@tok\xspace}%
+ \fi\fi
+ \the\xpnct@tok}
+\def\xperiod@aux{%
+ \ifx\xpnct@nxt.\else
+ \xpnct@tok\expandafter{\the\xpnct@tok.\@\xspace}%
\fi
- \xprd@Out
-}
-\newcommand\xcmm@Set[1]{\def\xcmm@Obj{#1}\futurelet\xcmm@Nxt\xcmm@Fin}
-\newcommand\xcmm@Fin{%
- \let\xcmm@Out\xcmm@Obj
- \ifx\xcmm@Nxt\bgroup\else
- \ifx\xcmm@Nxt\egroup\else
- \ifx\xcmm@Nxt\/\else
- \ifx\xcmm@Nxt~\else
- \ifx\xcmm@Nxt.\else
- \ifx\xcmm@Nxt!\else
- \ifx\xcmm@Nxt,\else
- \ifx\xcmm@Nxt:\else
- \ifx\xcmm@Nxt;\else
- \ifx\xcmm@Nxt?\else
- \ifx\xcmm@Nxt/\else
- \ifx\xcmm@Nxt'\else
- \ifx\xcmm@Nxt)\else
- \ifx\xcmm@Nxt]\else
- \ifx\xcmm@Nxt-\else
- \def\xcmm@Out{\xcmm@Obj,\xspace}%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \xcmm@Out
-}
-\newcommand\xpcm@Set[1]{\def\xpcm@Obj{#1}\futurelet\xpcm@Nxt\xpcm@Fin}
-\newcommand\xpcm@Fin{%
- \ifx\xpcm@Nxt.\relax
- \let\xpcm@Out\xpcm@Obj
- \else
- \def\xpcm@Out{\xpcm@Obj.\xcomma}%
+ \the\xpnct@tok}
+\def\xcomma@aux{%
+ \ifx\xpnct@nxt.\else
+ \ifx\xpnct@nxt,\else
+ \ifx\xpnct@nxt:\else
+ \ifx\xpnct@nxt;\else
+ \ifx\xpnct@nxt!\else
+ \ifx\xpnct@nxt?\else
+ \ifx\xpnct@nxt/\else
+ \ifx\xpnct@nxt-\else
+ \ifx\xpnct@nxt'\else
+ \ifx\xpnct@nxt)\else
+ \ifx\xpnct@nxt]\else
+ \ifx\xpnct@nxt\}\else
+ \ifx\xpnct@nxt\egroup\else
+ \ifx\xpnct@nxt\/\else
+ \xpnct@tok\expandafter{\the\xpnct@tok,\xspace}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \the\xpnct@tok}
+\def\xperiodcomma@aux{%
+ \ifx\xpnct@nxt.\else
+ \xpnct@tok\expandafter{\the\xpnct@tok.\@\xcomma}%
\fi
- \xpcm@Out
-}
+ \the\xpnct@tok}
\endinput
%%
%% End of file `xpunctuate.sty'.