diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/verbatimbox')
-rw-r--r-- | Master/texmf-dist/tex/latex/verbatimbox/verbatimbox.sty | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/verbatimbox/verbatimbox.sty b/Master/texmf-dist/tex/latex/verbatimbox/verbatimbox.sty index e237b3798e0..66aed9d85fc 100644 --- a/Master/texmf-dist/tex/latex/verbatimbox/verbatimbox.sty +++ b/Master/texmf-dist/tex/latex/verbatimbox/verbatimbox.sty @@ -1,5 +1,5 @@ \ProvidesPackage{verbatimbox} - [2013/04/24 v3.0 + [2013/06/06 v3.1 Routines for placing verbatim text into boxes, useful in places where the verbatim environment is inaccessible. Secondarily, for adding vertical buffer around an object.] @@ -29,6 +29,13 @@ vertical buffer around an object.] % -Added optional arguments to \addvbuffer % -Fixed \verbfilebox so that it restored \verbatim@processline % -Produced real documentation +% 3.01 -renamed \macro@name so as not to conflict with (I think) ltxdoc +% package +% 3.1 -Corrected default argument to \addvbuffer so that it wouldn't +% break. Also, gave better guidance in documentation to use +% of optional argument to \addvbuffer +% -Added verbnobox environment and \verbfilenobox macro +% -Improved documentation showing line-specific optional arguments \NeedsTeXFormat{LaTeX2e} \@ifundefined{verbatim@processline}{\RequirePackage{verbatim}}{} \usepackage{stringstrings} @@ -182,7 +189,7 @@ vertical buffer around an object.] \global\newlength\boxtop@sep \global\newlength\boxbottom@sep -\newcommand\addvbuffer[2][{\the\boxtopsep} \the\boxbottomsep]{% +\newcommand\addvbuffer[2][\the\boxtopsep\ \the\boxbottomsep]{% \getargs{#1}% \setlength\boxtop@sep{\argi}% \if1\narg\setlength\boxbottom@sep{\argi}\else% @@ -191,5 +198,41 @@ vertical buffer around an object.] } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The following two "nobox" commands are basically versions of +% \verbatiminput and \verbatim that have been adapted to take the +% optional argument style of this package. No boxes are created, +% but breaking across page boundaries is not a problem here, as +% it would be with a box. + +\newcommand\verbfilenobox[2][]{% + \setcounter{VerbboxLineNo}{0}% + \def\verbatim@processline{% + {\addtocounter{VerbboxLineNo}{1}% + #1\setbox0=\hbox{#1\the\verbatim@line}% + \hsize=\wd0 \the\verbatim@line\par}}% + \verbatiminput{#2} + \let\verbatim@processline\sv@verbatim@processline +} + +\newenvironment{verbnobox}{% + \setcounter{VerbboxLineNo}{-1}% +% FOR SOME REASON, USING \my@par INSTEAD OF \par PREVENTS EXTRA SPACE +% ABOVE verbbox WHEN USING OPTIONAL ARGUMENTS + \let\my@par\par% + \def\verbatim@processline{% +% FIRST \@tmp APPLIES OPTIONAL ARGUMENT TO EACH VERBATIM LINE +% SECOND \@tmp MAKES SURE ANY PRINTED MATTER OF OPTIONAL ARGUMENT +% IS ACCOUNTED FOR IN VERBATIM BOX WIDTH + {\addtocounter{VerbboxLineNo}{1}% + \@tmp\setbox0=\hbox{\@tmp\the\verbatim@line}% + \hsize=\wd0 \the\verbatim@line\my@par}}% +\verbatim\verbbox@inner% +} +{% + \endverbatim% + \global\def\@tmp{}% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput |