summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/newverbs
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-08 22:31:55 +0000
committerKarl Berry <karl@freefriends.org>2012-05-08 22:31:55 +0000
commit187c81e82ee38ee4e617ea4be4d191812892581e (patch)
treec8e798ff4c51ffe596944d4f20a715df4dec725d /Master/texmf-dist/tex/latex/newverbs
parentb1a34aa4fa5786ec883f9a47338300a32d0ed40d (diff)
newverbs 1.3a (8may12)
git-svn-id: svn://tug.org/texlive/trunk@26258 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/newverbs')
-rw-r--r--Master/texmf-dist/tex/latex/newverbs/newverbs.sty154
1 files changed, 132 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/newverbs/newverbs.sty b/Master/texmf-dist/tex/latex/newverbs/newverbs.sty
index 02ca22d33a6..d54c720b846 100644
--- a/Master/texmf-dist/tex/latex/newverbs/newverbs.sty
+++ b/Master/texmf-dist/tex/latex/newverbs/newverbs.sty
@@ -4,28 +4,42 @@
%%
%% The original source files were:
%%
-%% newverbs.dtx (with options: `package')
+%% newverbs.dtx (with options: `newverbs.sty')
%%
-%% Copyright (c) 2010-2011 by Martin Scharrer <martin@scharrer-online.de>
-%% WWW: http://latex.scharrer-online.de/
+%% IMPORTANT NOTICE:
%%
-%% 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'.
+%% For the copyright see the source file.
%%
-%% The Current Maintainer of this work is Martin Scharrer.
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from newverbs.sty.
%%
-%% This work consists of the files newverbs.dtx and newverbs.ins
-%% and the derived file newverbs.sty.
+%% For distribution of the original source see the terms
+%% for copying and modification in the file newverbs.dtx.
%%
-%% $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]
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%% Copyright (C) 2012 by Martin Scharrer <martin@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.
+\ProvidesPackage{newverbs}[%
+ 2012/05/08
+ v1.3a
+ Define new 'verb' commands and short verb. characters]
\newcommand*\newverbcommand{\new@verbcommand\newcommand}
\newcommand*\renewverbcommand{\new@verbcommand\renewcommand}
\newcommand*\provideverbcommand{\new@verbcommand\providecommand}
@@ -40,16 +54,21 @@
}
\def\newverbs@tabularxsupport{%
\begingroup
- \def\orig@TX@vb##1{\def\@tempa####1##1{\toks@{####1}\edef\@tempa{\the\toks@}%
+ \def\origa@TX@vb##1{\def\@tempa####1##1{\toks@{####1}\edef\@tempa{\the\toks@}%
+ \expandafter\TX@v\meaning\@tempa\\ \\\ifnum0=`{\fi}}\@tempa!}
+ \def\origb@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
+ \ifcase0%
+ \ifx\TX@vb\origa@TX@vb 1\else
+ \ifx\TX@vb\origb@TX@vb 1\fi\fi
+ \relax
+ \endgroup
+ \PackageWarning{newverbs}{Couldn't patch 'TX@vb' macro of the 'tabularx' package. Definition unknown.}%
+ \else
\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
}
@@ -118,6 +137,38 @@
\def\@@@collectverb##1~}{#1{##1}\endgroup}%
\@@@collectverb
}
+\newcommand*\collectverbenv{%
+ \begingroup
+ \verbatim@font
+ \@ifstar
+ \@scollectverbenv
+ \@collectverbenv
+}
+\def\@collectverbenv#1{%
+ \newverb@catcodes
+ \@vobeyspaces
+ \frenchspacing
+ \@noligs
+ \expandafter\@@collectverbenv\expandafter{\@currenvir}{#1}%
+}
+\def\@scollectverbenv#1{%
+ \newverb@catcodes
+ \@noligs
+ \expandafter\@@collectverbenv\expandafter{\@currenvir}{#1}%
+}
+\begingroup
+\catcode`\|=0
+\catcode`\(=1
+\catcode`\)=2
+\@makeother\{
+\@makeother\}
+\@makeother\\
+|catcode`|^^M=|active%
+|gdef|@@collectverbenv#1#2(%
+ |long|def|@@@collectverb##1^^M##2^^M\end{#1}(#2(##2)|endgroup|end(#1))%
+ |@@@collectverb%
+)%
+|endgroup%
\newcommand*\Collectverb{%
\begingroup
\@ifstar
@@ -153,6 +204,65 @@
\def\@@@Collectverb##1~}{\endgroup#1{##1}}%
\@@@Collectverb
}
+\newcommand*\Collectverbenv{%
+ \begingroup
+ \@ifstar
+ \@sCollectverbenv
+ \@Collectverbenv
+}
+\def\@Collectverbenv#1{%
+ \newverb@catcodes
+ \obeyspaces
+ \expandafter\@@Collectverbenv\expandafter{\@currenvir}{#1}%
+}
+\begingroup
+\catcode`\^^I=\active
+\gdef\newverb@catcodes{%
+ \let\do\@makeother
+ \dospecials
+ \obeylines
+ \endlinechar=13
+ \catcode`\^^I=\active
+ \def^^I{\newverb@tab}%
+}
+\gdef^^I{\newverb@tab}%
+\endgroup
+\edef\newverb@tab{\space}%\space\space\space}
+\def\@sCollectverbenv#1{%
+ \newverb@catcodes
+ \expandafter\@@Collectverbenv\expandafter{\@currenvir}{#1}%
+}
+\begingroup
+\catcode`\|=0
+\catcode`\(=1
+\catcode`\)=2
+\@makeother\{
+\@makeother\}
+\@makeother\\
+|catcode`|^^M=|active%
+|gdef|@@Collectverbenv#1#2(%
+ |long|def|@@@Collectverb##1^^M##2^^M\end{#1}(|endgroup#2(##2)|end(#1))%
+ |@@@Collectverb%
+)%
+|gdef|misj(|def^^M(^^J))%
+|endgroup%
+\newcommand\newverbenvironment{}
+\long\def\newverbenvironment#1#2#{%
+ \@newverbenvironment{#1}{#2}%
+}
+\long\def\@newverbenvironment#1#2#3#4{%
+ \newenvironment{#1}#2{%
+ \begingroup
+ \newverb@catcodes
+ \obeyspaces
+ #3%
+ \expandafter\@@Collectverbenv\expandafter{\@currenvir}{\long\def\BODY}%
+ }{#4}%
+}
+\newcommand\newverbsfont{%
+ \verbatim@font
+ \frenchspacing
+}
\newcommand*\Verbdef{%
\@ifstar
{\@Verbdef*}%