summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/verbatimbox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-06-28 22:27:16 +0000
committerKarl Berry <karl@freefriends.org>2013-06-28 22:27:16 +0000
commite1dea85ce1b88e8920d2aebf40a78e1c184225bd (patch)
tree5a5f54fe907f650c3021f54a702e156c6edf50c6 /Master/texmf-dist/tex/latex/verbatimbox
parent8cc5831a7004aa1d5c74d29b5806491fafc27323 (diff)
verbatimbox (7jun13)
git-svn-id: svn://tug.org/texlive/trunk@31022 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/verbatimbox')
-rw-r--r--Master/texmf-dist/tex/latex/verbatimbox/verbatimbox.sty47
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