texlive[52074] Master/texmf-dist: newverbs (10sep19)

commits+karl at tug.org commits+karl at tug.org
Tue Sep 10 23:45:21 CEST 2019


Revision: 52074
          http://tug.org/svn/texlive?view=revision&revision=52074
Author:   karl
Date:     2019-09-10 23:45:21 +0200 (Tue, 10 Sep 2019)
Log Message:
-----------
newverbs (10sep19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/newverbs/README
    trunk/Master/texmf-dist/doc/latex/newverbs/newverbs.pdf
    trunk/Master/texmf-dist/source/latex/newverbs/newverbs.dtx
    trunk/Master/texmf-dist/tex/latex/newverbs/newverbs.sty

Modified: trunk/Master/texmf-dist/doc/latex/newverbs/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/newverbs/README	2019-09-10 21:45:07 UTC (rev 52073)
+++ trunk/Master/texmf-dist/doc/latex/newverbs/README	2019-09-10 21:45:21 UTC (rev 52074)
@@ -1,6 +1,6 @@
 The 'newverbs' LaTeX package
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Copyright (c) 2010-2012 by Martin Scharrer <martin at scharrer-online.de>
+Copyright (c) 2010-2019 by Martin Scharrer <martin at scharrer-online.de>
 Code repository: https://bitbucket.org/martin_scharrer/newverbs
 
 This package allows the definition of \verb variants which add TeX code before

Modified: trunk/Master/texmf-dist/doc/latex/newverbs/newverbs.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/newverbs/newverbs.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/newverbs/newverbs.dtx	2019-09-10 21:45:07 UTC (rev 52073)
+++ trunk/Master/texmf-dist/source/latex/newverbs/newverbs.dtx	2019-09-10 21:45:21 UTC (rev 52074)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %<=*COPYRIGHT>
-%% Copyright (C) 2012 by Martin Scharrer <martin at scharrer-online.de>
+%% Copyright (C) 2012-2019 by Martin Scharrer <martin at scharrer-online.de>
 %% --------------------------------------------------------------------
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -23,10 +23,10 @@
 %<*driver>
 \ProvidesFile{newverbs.dtx}[%
 %<=*DATE>
-    2012/05/08
+    2019/09/09
 %<=/DATE>
 %<=*VERSION>
-    v1.3a
+    v1.4
 %<=/VERSION>
     newverbs DTX file]
 \documentclass{ydoc}
@@ -44,7 +44,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{0}
+% \CheckSum{458}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -68,6 +68,7 @@
 % \changes{v1.2}{2011/02/16}{Added support for 'tabularx' environments.}
 % \changes{v1.2a}{2011/03/19}{Removed spurious spaces.}
 % \changes{v1.3}{2011/07/24}{Added macros to collect verbatim arguments.}
+% \changes{v1.4}{2019/09/09}{Added several suggested changes.}
 %
 % \DoNotIndex{\newcommand,\newenvironment,\providecommand}
 %
@@ -103,9 +104,9 @@
 %
 % \DescribeMacro\qverb<char><verbatim material><char>
 % This macro adds quote characters around the verbatim material.
-% Two macros are used to insert the quotes: \cs{qverbbeginquote} (`) and \cs{qverbendquote} (').
+% Two macros are used to insert the quotes: \cs{qverbbeginquote} (``) and \cs{qverbendquote} ('').
 % They can be redefined by the user if required. If the \pkg{csquotes} package was loaded beforehand
-% the above macros use its macros \cs{openinnerquote} and \cs{closeinnerquote} to take advantage of the language
+% the above macros use its macros \cs{openautoquote} and \cs{closeautoquote} to take advantage of the language
 % dependent quotation marks. See the manual of \pkg{csquotes} for more details.
 %
 % Using \Macro\qverb<char><verbatim material><char> is equal to \\
@@ -133,7 +134,7 @@
 %
 % The new macro \Macro\MakeSpecialShortVerb*{\textbackslash\meta{verb variant}}{\textbackslash\meta{char}} does the same, but
 % instead of \Macro\verb*\relax\relax\ it uses a \MacroArgs'\'<verb variant>*\relax which needs to be defined using \cs{newverbcommand}.
-% The package \pkg{shortvrb} must be loaded by the user in order to make this macro work. It is not loaded automatically by \pkg{newverbs}.
+% The package \pkg{shortvrb} must be installed in order to make this macro work. It is loaded automatically by \pkg{newverbs}.
 %
 % The special meaning of \meta{char} can be removed using \pkg{shortvrb}'s \cs{DeleteShortVerb}, i.e.\ the same way as for
 % characters defined with the normal \cs{MakeShortVerb}.
@@ -170,8 +171,57 @@
 % The starred version will make spaces appear as `\Collectverb*{}: :' when typeset but still be written to auxiliary files as normal spaces.
 % An exception is if the following \meta{char} is `|{|', then `|}|' is taken as the end \meta{char} to simulate a normal argument to increase user friendliness.
 % Afterwards \meta{code} is expanded with \marg{verbatim material} direct behind it. This macro does not add any group around the code.
-% Should the code be typeset after all a proper font (e.g.\ \Macro\ttfamily or \Macro\verbatim at font) must be enabled manually.
+% Should the material be typeset after all a proper font (e.g.\ \Macro\ttfamily or \Macro\newverbsfont) must be enabled manually.
 %
+%
+%
+% \DescribeMacro\collectverbenv{<code>}
+% \DescribeMacro\collectverbenv*{<code>}
+% This macro is supposed to be used with its \marg{code} argument at the end of the begin-code of an user or package environment definition.
+% It then collects the content of the environment as verbatim material and feeds it as an argument to the provided \meta{code} like \Macro\collectverb does
+% (see there for further details which also apply here).
+% This has the following limitations:
+% When used the \Macro\begin of the environment must end with a line break, i.e.\ the source line must not include any other material afterwards.
+% If the environment is defined with arguments, which is supported, the line break must be after the arguments.
+% The \Macro\end of the macro must be at the beginning of an own source code line.
+% If this conditions are not met incorrect results or an error may occur. Currently trailing material on the \Macro\begin line is simply ignored, but this
+% behaviour might change in future versions.
+%
+% The starred version will make the spaces inside the environment appear as `\collectverb*{}: :'.
+%
+% \noindent Example usage:\\
+% \leavevmode\noindent\bgroup\footnotesize
+% |\newenvironment{myenv}{\maybesomeothercode\collectverbenv{\mycmd}}{\someendcode}| \\
+%
+%
+% \DescribeMacro\Collectverbenv{<code>}
+% \DescribeMacro\Collectverbenv*{<code>}
+% This macro works like \Macro\collectverbenv but collects the environment content as plain verbatim material suitable to be
+% written in auxiliary files or log messages.
+% After collecting the environment the \meta{code} is expanded with \marg{verbatim material} direct behind it. This macro does not add any group around the code.
+% Should the material be typeset after all a proper font (e.g.\ \Macro\ttfamily or \Macro\newverbsfont) must be enabled manually.
+%
+% The starred version will make spaces appear as `\Collectverb*{}: :' when typeset but still be written to auxiliary files as normal spaces.
+%
+%
+% \DescribeMacro\newverbsfont
+% Macro which activates the font used by the \pkg{newverbs} package for the verbatim text.
+% This macro can be used manually if verbatim material collected with \Macro\Collectverb or \Macro\Collectverbenv should be typeset afterall.
+%
+% \DescribeMacro\verbdef<\textbackslash macro><char><verbatim material><char>
+% \DescribeMacro\verbdef*<\textbackslash macro><char><verbatim material><char>
+% \DescribeMacro\verbdef<\textbackslash macro>{<verbatim material>}
+% \DescribeMacro\verbdef*<\textbackslash macro>{<verbatim material>}
+% This macro defines the \meta{\textbackslash macro} as a robust macro which typesets the \meta{verbatim material} in the usual verbatim font.
+% For this the material is placed in a brace group with \Macro\newverbsfont. If a different font is wanted, this macro can be redefined locally.
+%
+% If the \meta{\textbackslash macro} existed before it will be overwritten silently. If an error should be raced instead use
+% \Macro\newcommand{\textbackslash macro}{} just before the \Macro\verbdef.
+%
+% Note that this macro is also provided by the \pkg{verbdef} package. If that package is loaded as well it definition of this macro is used,
+% independent on the order of loading the two packages.
+%
+%
 % \DescribeMacro\Verbdef<\textbackslash macro><char><verbatim material><char>
 % \DescribeMacro\Verbdef*<\textbackslash macro><char><verbatim material><char>
 % \DescribeMacro\Verbdef<\textbackslash macro>{<verbatim material>}
@@ -178,9 +228,14 @@
 % \DescribeMacro\Verbdef*<\textbackslash macro>{<verbatim material>}
 % This macro uses \Macro\Collectverb internally to define \meta{\textbackslash macro} as the plain \meta{verbatim material}.
 % This can be used to define macros for special characters, so these can be used in error or warning messages or be written into auxiliary files.
-% A corresponding \Macro\verbdef macro which defines macros with typesetable verbatim material is already provided by the \pkg{verbdef} package.
 %
+% If the \meta{\textbackslash macro} existed before it will be overwritten silently. If an error should be raced instead use
+% \Macro\newcommand{\textbackslash macro}{} just before the \Macro\Verbdef.
 %
+% Note that for maximum flexibility the such defined macros are not defined as robust macros. Therefore using them inside sectioning commands they should
+% be protected using \Macro\protect to avoid syntax issues in the |.aux| file due to verbatim characters.
+%
+%
 % \section{Compatibility with other verbatim packages}
 % The compatibility with other verbatim packages is not tested yet. This package relies on the normal internal definition of \cs{verb}
 % and \cs{MakeShortVerb}. Any package which changes these might break this package.
@@ -221,17 +276,37 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\new at verbcommand}[4]{underlying definition macro}{macro to define}{code before}{code after}
+% \begin{macro}{\new at verbcommand}[2]{underlying definition macro}{macro to be defined}
+% Checks for optional argument and calls \cs{new@@verbcommand} accordingly.
+%    \begin{macrocode}
+\def\new at verbcommand#1#2{%
+  \@ifnextchar[%
+    {\new@@verbcommand{#1}{#2}}%
+    {\new@@verbcommand{#1}{#2}[\verb]}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\new at verbcommand}[5]{underlying definition macro}{verb macro to be used}{macro to define}{code before}{code after}
 % The trailing code is inserted by patching \cs{verb at egroup} which is called by \cs{verb}
 % after the verbatim content.
 %    \begin{macrocode}
-\def\new at verbcommand#1#2#3#4{%
+\let\newverbs at end\@empty
+\def\new@@verbcommand#1#2[#3]#4#5{%
   #1*#2{%
-    \begingroup
+    \bgroup
     \newverbcommand at settings
-    \def\verb at egroup{\verb at orig@egroup#4\endgroup}%
-    \def\newverbs at txend{#4\endgroup}%
-    #3\verb
+    \ifx\newverbs at end\@empty
+    \expandafter\def\expandafter\verb at egroup\expandafter{\verb at egroup\newverbs at end}%
+    \fi
+    \begingroup\def\@tempa{#5}%
+    \expandafter\expandafter\expandafter\endgroup
+    \expandafter\expandafter\expandafter\def
+    \expandafter\expandafter\expandafter\newverbs at end
+    \expandafter\expandafter\expandafter{\expandafter\@tempa\newverbs at end\egroup}%
+    \def\newverbs at txend{#5\egroup}%
+    \verbatim at font\let\verbatim at font\relax
+    #4#3%
   }%
 }
 %    \end{macrocode}
@@ -306,11 +381,11 @@
 % \changes{v1.1}{2010/04/13}{Added usage of 'csquotes' macros if loaded.}
 %    \begin{macrocode}
 \@ifundefined{openinnerquote}{%
-  \def\qverbbeginquote{`}%
-  \def\qverbendquote{'}%
+  \def\qverbbeginquote{``}%
+  \def\qverbendquote{''}%
 }{%
-  \def\qverbbeginquote{\openinnerquote}%
-  \def\qverbendquote{\closeinnerquote}%
+  \def\qverbbeginquote{\openautoquote}%
+  \def\qverbendquote{\closeautoquote}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -328,21 +403,67 @@
 %
 % \subsection{Make Special Short Verbatim Characters}
 %
-% \begin{macro}{\MakeSpecialShortVerb}[1]{verbatim macro}
+%    \begin{macrocode}
+\RequirePackage{shortvrb}
+%    \end{macrocode}
+%
+% \begin{macro}{\MakeShortVerb}
+%    \begin{macrocode}
+\def\MakeShortVerb{%
+  \@ifstar
+    {\newverbs at MakeShortVerb*}%
+    {\newverbs at MakeShortVerb{}}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newverbs at MakeShortVerb}[1]{star or empty}
+%    \begin{macrocode}
+\def\newverbs at MakeShortVerb#1{%
+  \@ifnextchar[%
+    {\newverbs@@MakeShortVerb{#1}}%
+    {\@MakeSpecialShortVerb{#1}{\verb}}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newverbs@@MakeShortVerb}[2]{star or empty}{verbatim macro}
+%    \begin{macrocode}
+\def\newverbs@@MakeShortVerb#1[#2]{%
+  \@MakeSpecialShortVerb{#1}{#2}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@MakeSpecialShortVerb}[3]{star or empty}{verbatim macro}{escaped short verbatim character}
 % Uses the definition of \cs{MakeShortVerb} from \pkg{shortvrb} except with \cs{verb} replaced with the first argument.
-% The second argument is then read by \cs{@MakeShortVerb}.
+% The last argument is then read by \cs{@MakeShortVerb}.
 %    \begin{macrocode}
-\newcommand*\MakeSpecialShortVerb[1]{%
+\def\@MakeSpecialShortVerb#1#2#3{%
+  %\expandafter\ifx\csname cc\string#3\endcsname\relax
+  %\else
+  %  \DeleteShortVerb{#3}%
+  %\fi
+  \def\@shortvrbdef{#2#1}%
+  \@MakeShortVerb{#3}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeSpecialShortVerb}
+% Checks for the starred version and calls \cs{@MakeSpecialShortVerb} appropriately. The star needs to be added again
+% as \cs{@ifstar} removes it.
+%    \begin{macrocode}
+\newcommand*\MakeSpecialShortVerb{%
   \@ifstar
-    {\def\@shortvrbdef{#1*}\@MakeShortVerb}%
-    {\def\@shortvrbdef{#1}\@MakeShortVerb}%
+    {\@MakeSpecialShortVerb{*}}%
+    {\@MakeSpecialShortVerb{}}%
 }
 %    \end{macrocode}
 % \end{macro}
 %
+%% \subsection{Collect verbatim argument}
 %
-% \subsection{Collect verbatim argument}
-%
 % \begin{macro}{\collectverb}
 % Collects verbatim text which can be typeset.
 % Checks for an existing star.
@@ -485,7 +606,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\@Collectverb}
+% \begin{macro}{\@Collectverb}[1]{<code to be executed afterwards>}
 %    \begin{macrocode}
 \def\@Collectverb#1{%
     \verb at eol@error
@@ -498,7 +619,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\@sCollectverb}
+% \begin{macro}{\@sCollectverb}[1]{<code to be executed afterwards>}
 %    \begin{macrocode}
 \def\@sCollectverb#1{%
     \verb at eol@error
@@ -510,7 +631,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\@@Collectverb}
+% \begin{macro}{\@@Collectverb}[2]{<code to be executed afterwards>}{<delimiter character>}
 %    \begin{macrocode}
 \def\@@Collectverb#1#2{%
     \ifnum`#2=`\{%
@@ -546,7 +667,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\@Collectverbenv}
+% \begin{macro}{\@Collectverbenv}[1]{<code to be executed afterwards>}
 %    \begin{macrocode}
 \def\@Collectverbenv#1{%
     \newverb at catcodes
@@ -582,7 +703,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\@sCollectverbenv}
+% \begin{macro}{\@sCollectverbenv}[1]{<code to be executed afterwards>}
 %    \begin{macrocode}
 \def\@sCollectverbenv#1{%
     \newverb at catcodes
@@ -613,25 +734,6 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\newverbenvironment}
-%    \begin{macrocode}
-\newcommand\newverbenvironment{}
-\long\def\newverbenvironment#1#2#{%
-    \@newverbenvironment{#1}{#2}%
-}
-\long\def\@newverbenvironment#1#2#3#4{%
-    \newenvironment{#1}#2{%
-        \begingroup
-        \newverb at catcodes
-        \obeyspaces
-        #3%
-        \expandafter\@@Collectverbenv\expandafter{\@currenvir}{\long\def\BODY}%
-    }{#4}%
-}
-%    \end{macrocode}
-% \end{macro}
-%
-%
 % \begin{macro}{\newverbsfont}
 %    \begin{macrocode}
 \newcommand\newverbsfont{%
@@ -653,14 +755,43 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\@Verbdef}
+% \begin{macro}{\@Verbdef}[2]{<star or empty>}{<macro to be defined>}
 %    \begin{macrocode}
-\newcommand*\@Verbdef[2]{%
+\def\@Verbdef#1#2{%
     \Collectverb#1{\def#2}%
 }
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\verbdef}
+% Provides an own definition of \Macro\verbdef which is also defined by the \pkg{verbdef} package.
+%    \begin{macrocode}
+\providecommand*\verbdef{%
+    \@ifstar
+        {\newverbs at verbdef*}%
+        {\newverbs at verbdef{}}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@Verbdef}[2]{<star or empty>}{<macro to be defined>}
+%    \begin{macrocode}
+\def\newverbs at verbdef#1#2{%
+    \Collectverb#1{\newverbs@@verbdef{#2}}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@Verbdef}[2]{<star or empty>}{<macro to be defined>}
+%    \begin{macrocode}
+\def\newverbs@@verbdef#1#2{%
+    \DeclareRobustCommand{#1}{{\newverbsfont#2}}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \iffalse
 %</newverbs.sty>
 % \fi

Modified: trunk/Master/texmf-dist/tex/latex/newverbs/newverbs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/newverbs/newverbs.sty	2019-09-10 21:45:07 UTC (rev 52073)
+++ trunk/Master/texmf-dist/tex/latex/newverbs/newverbs.sty	2019-09-10 21:45:21 UTC (rev 52074)
@@ -20,7 +20,7 @@
 %% 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 at scharrer-online.de>
+%% Copyright (C) 2012-2019 by Martin Scharrer <martin at scharrer-online.de>
 %% --------------------------------------------------------------------
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -37,19 +37,33 @@
 %% This work consists of the files newverbs.dtx and newverbs.ins
 %% and the derived file newverbs.sty.
 \ProvidesPackage{newverbs}[%
-    2012/05/08
-    v1.3a
+    2019/09/09
+    v1.4
     Define new 'verb' commands and short verb. characters]
 \newcommand*\newverbcommand{\new at verbcommand\newcommand}
 \newcommand*\renewverbcommand{\new at verbcommand\renewcommand}
 \newcommand*\provideverbcommand{\new at verbcommand\providecommand}
-\def\new at verbcommand#1#2#3#4{%
+\def\new at verbcommand#1#2{%
+  \@ifnextchar[%
+    {\new@@verbcommand{#1}{#2}}%
+    {\new@@verbcommand{#1}{#2}[\verb]}%
+}
+\let\newverbs at end\@empty
+\def\new@@verbcommand#1#2[#3]#4#5{%
   #1*#2{%
-    \begingroup
+    \bgroup
     \newverbcommand at settings
-    \def\verb at egroup{\verb at orig@egroup#4\endgroup}%
-    \def\newverbs at txend{#4\endgroup}%
-    #3\verb
+    \ifx\newverbs at end\@empty
+    \expandafter\def\expandafter\verb at egroup\expandafter{\verb at egroup\newverbs at end}%
+    \fi
+    \begingroup\def\@tempa{#5}%
+    \expandafter\expandafter\expandafter\endgroup
+    \expandafter\expandafter\expandafter\def
+    \expandafter\expandafter\expandafter\newverbs at end
+    \expandafter\expandafter\expandafter{\expandafter\@tempa\newverbs at end\egroup}%
+    \def\newverbs at txend{#5\egroup}%
+    \verbatim at font\let\verbatim at font\relax
+    #4#3%
   }%
 }
 \def\newverbs at tabularxsupport{%
@@ -84,20 +98,43 @@
 }
 \provideverbcommand{\qverb}{\qverbbeginquote}{\qverbendquote}
 \@ifundefined{openinnerquote}{%
-  \def\qverbbeginquote{`}%
-  \def\qverbendquote{'}%
+  \def\qverbbeginquote{``}%
+  \def\qverbendquote{''}%
 }{%
-  \def\qverbbeginquote{\openinnerquote}%
-  \def\qverbendquote{\closeinnerquote}%
+  \def\qverbbeginquote{\openautoquote}%
+  \def\qverbendquote{\closeautoquote}%
 }
 \newverbcommand{\fverb}
   {\setbox\verbbox\hbox\bgroup\color at setgroup}
   {\color at endgroup\egroup\fbox{\box\verbbox}}
-\newcommand*\MakeSpecialShortVerb[1]{%
+\RequirePackage{shortvrb}
+\def\MakeShortVerb{%
   \@ifstar
-    {\def\@shortvrbdef{#1*}\@MakeShortVerb}%
-    {\def\@shortvrbdef{#1}\@MakeShortVerb}%
+    {\newverbs at MakeShortVerb*}%
+    {\newverbs at MakeShortVerb{}}%
 }
+\def\newverbs at MakeShortVerb#1{%
+  \@ifnextchar[%
+    {\newverbs@@MakeShortVerb{#1}}%
+    {\@MakeSpecialShortVerb{#1}{\verb}}%
+}
+\def\newverbs@@MakeShortVerb#1[#2]{%
+  \@MakeSpecialShortVerb{#1}{#2}%
+}
+\def\@MakeSpecialShortVerb#1#2#3{%
+  %\expandafter\ifx\csname cc\string#3\endcsname\relax
+  %\else
+  %  \DeleteShortVerb{#3}%
+  %\fi
+  \def\@shortvrbdef{#2#1}%
+  \@MakeShortVerb{#3}%
+}
+\newcommand*\MakeSpecialShortVerb{%
+  \@ifstar
+    {\@MakeSpecialShortVerb{*}}%
+    {\@MakeSpecialShortVerb{}}%
+}
+%% \subsection{Collect verbatim argument}
 \newcommand*\collectverb{%
     \begingroup
     \verbatim at font
@@ -246,19 +283,6 @@
 )%
 |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 at catcodes
-        \obeyspaces
-        #3%
-        \expandafter\@@Collectverbenv\expandafter{\@currenvir}{\long\def\BODY}%
-    }{#4}%
-}
 \newcommand\newverbsfont{%
     \verbatim at font
     \frenchspacing
@@ -268,9 +292,20 @@
         {\@Verbdef*}%
         {\@Verbdef{}}%
 }
-\newcommand*\@Verbdef[2]{%
+\def\@Verbdef#1#2{%
     \Collectverb#1{\def#2}%
 }
+\providecommand*\verbdef{%
+    \@ifstar
+        {\newverbs at verbdef*}%
+        {\newverbs at verbdef{}}%
+}
+\def\newverbs at verbdef#1#2{%
+    \Collectverb#1{\newverbs@@verbdef{#2}}%
+}
+\def\newverbs@@verbdef#1#2{%
+    \DeclareRobustCommand{#1}{{\newverbsfont#2}}%
+}
 \endinput
 %%
 %% End of file `newverbs.sty'.



More information about the tex-live-commits mailing list