From fa06059a5302c0916d9310783c0ecf7ebf164b5a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 24 May 2012 23:47:35 +0000 Subject: new latex package xpunctuate (24may12) git-svn-id: svn://tug.org/texlive/trunk@26641 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/xpunctuate/xpunctuate.sty | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty (limited to 'Master/texmf-dist/tex/latex/xpunctuate') diff --git a/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty b/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty new file mode 100644 index 00000000000..a0768f655f2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/xpunctuate/xpunctuate.sty @@ -0,0 +1,73 @@ +%% +%% This is file `xpunctuate.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xpunctuate.dtx (with options: `package') +%% +%% Copyright (C) 2012 by Philip G. Ratcliffe +%% +%% 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: +%% +%% 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. +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{xpunctuate} + [2012/05/21 v1.0 trailing punctuation package (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}% + \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}% + \fi + \xpcm@Out +} +\endinput +%% +%% End of file `xpunctuate.sty'. -- cgit v1.2.3