blob: 02ca22d33a651368b9bf1816764921c8c0c806b7 (
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
%%
%% This is file `newverbs.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% newverbs.dtx (with options: `package')
%%
%% Copyright (c) 2010-2011 by Martin Scharrer <martin@scharrer-online.de>
%% WWW: http://latex.scharrer-online.de/
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% 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.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Martin Scharrer.
%%
%% This work consists of the files newverbs.dtx and newverbs.ins
%% and the derived file newverbs.sty.
%%
%% $Id: newverbs.dtx 2536 2011-07-26 22:45:59Z martin $
\ProvidesPackage{newverbs}[2011/07/24 v1.3 Define new 'verb' commands and short verb. characters]
\newcommand*\newverbcommand{\new@verbcommand\newcommand}
\newcommand*\renewverbcommand{\new@verbcommand\renewcommand}
\newcommand*\provideverbcommand{\new@verbcommand\providecommand}
\def\new@verbcommand#1#2#3#4{%
#1*#2{%
\begingroup
\newverbcommand@settings
\def\verb@egroup{\verb@orig@egroup#4\endgroup}%
\def\newverbs@txend{#4\endgroup}%
#3\verb
}%
}
\def\newverbs@tabularxsupport{%
\begingroup
\def\orig@TX@vb##1{\def\@tempa####1##1{\toks@{####1}\edef\@tempa{\the\toks@}%
\expandafter\TX@v\meaning\@tempa\\\\\ifnum0=`{\fi}}\@tempa!}%
\ifx\TX@vb\orig@TX@vb
\endgroup
\PackageInfo{newverbs}{Patching 'TX@vb' macro of the 'tabularx' package.}%
\def\TX@vb##1{\def\@tempa####1##1{\toks@{####1}\edef\@tempa{\the\toks@}%
\expandafter\TX@v\meaning\@tempa\\\\\ifnum0=`{\fi}\newverbs@txend}\@tempa!}%
\else
\endgroup
\PackageWarning{newverbs}{Couldn't patch 'TX@vb' macro of the 'tabularx' package. Definition unknown.}%
\fi
\let\newverbs@tabularxsupport\relax
}
\def\newverbs@txend{}
\@ifpackageloaded{tabularx}{%
\newverbs@tabularxsupport
}{%
\AtBeginDocument{\@ifpackageloaded{tabularx}{\newverbs@tabularxsupport}{}}%
}
\def\newverbcommand@settings{%
\let\verb@orig@egroup\verb@egroup
\let\verbbox\@tempboxa
}
\provideverbcommand{\qverb}{\qverbbeginquote}{\qverbendquote}
\@ifundefined{openinnerquote}{%
\def\qverbbeginquote{`}%
\def\qverbendquote{'}%
}{%
\def\qverbbeginquote{\openinnerquote}%
\def\qverbendquote{\closeinnerquote}%
}
\newverbcommand{\fverb}
{\setbox\verbbox\hbox\bgroup\color@setgroup}
{\color@endgroup\egroup\fbox{\box\verbbox}}
\newcommand*\MakeSpecialShortVerb[1]{%
\@ifstar
{\def\@shortvrbdef{#1*}\@MakeShortVerb}%
{\def\@shortvrbdef{#1}\@MakeShortVerb}%
}
\newcommand*\collectverb{%
\begingroup
\verbatim@font
\@ifstar
\@scollectverb
\@collectverb
}
\def\@collectverb#1{%
\verb@eol@error
\let\do\@makeother
\dospecials
\@vobeyspaces
\frenchspacing
\@noligs
\@@collectverb{#1}%
}
\def\@scollectverb#1{%
\verb@eol@error
\let\do\@makeother
\dospecials
\@noligs
\@@collectverb{#1}%
}
\def\@@collectverb#1#2{%
\ifnum`#2=`\{%
\catcode`\}\active
\else
\catcode`#2\active
\fi
\begingroup
\ifnum`#2=`\{%
\lccode`\~`\}%
\else
\lccode`\~`#2%
\fi
\lowercase{\endgroup
\def\@@@collectverb##1~}{#1{##1}\endgroup}%
\@@@collectverb
}
\newcommand*\Collectverb{%
\begingroup
\@ifstar
\@sCollectverb
\@Collectverb
}
\def\@Collectverb#1{%
\verb@eol@error
\let\do\@makeother
\dospecials
\obeyspaces
\@@Collectverb{#1}%
}
\def\@sCollectverb#1{%
\verb@eol@error
\let\do\@makeother
\dospecials
\@@Collectverb{#1}%
}
\def\@@Collectverb#1#2{%
\ifnum`#2=`\{%
\catcode`\}\active
\else
\catcode`#2\active
\fi
\begingroup
\ifnum`#2=`\{%
\lccode`\~`\}%
\else
\lccode`\~`#2%
\fi
\lowercase{\endgroup
\def\@@@Collectverb##1~}{\endgroup#1{##1}}%
\@@@Collectverb
}
\newcommand*\Verbdef{%
\@ifstar
{\@Verbdef*}%
{\@Verbdef{}}%
}
\newcommand*\@Verbdef[2]{%
\Collectverb#1{\def#2}%
}
\endinput
%%
%% End of file `newverbs.sty'.
|