blob: a0768f655f2215a0efc5df0041fb749b1cdd6f60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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 <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'.
|