%%
%% 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 <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:
%% 
%%    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'.
