texlive[42546] Master/texmf-dist: showexpl (20nov16)
commits+karl at tug.org
commits+karl at tug.org
Sun Nov 20 23:11:10 CET 2016
Revision: 42546
http://tug.org/svn/texlive?view=revision&revision=42546
Author: karl
Date: 2016-11-20 23:11:09 +0100 (Sun, 20 Nov 2016)
Log Message:
-----------
showexpl (20nov16)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf
trunk/Master/texmf-dist/doc/latex/showexpl/showexpl.pdf
trunk/Master/texmf-dist/source/latex/showexpl/showexpl.dtx
trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty
Modified: trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/showexpl/showexpl.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/showexpl/showexpl.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/showexpl/showexpl.dtx 2016-11-20 22:10:55 UTC (rev 42545)
+++ trunk/Master/texmf-dist/source/latex/showexpl/showexpl.dtx 2016-11-20 22:11:09 UTC (rev 42546)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2004 -- 2006 by Rolf Niepraschk <Rolf.Niepraschk at gmx.de>
+% Copyright (C) 2004 -- 2016 by Rolf Niepraschk <Rolf.Niepraschk at gmx.de>
% --------------------------------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{showexpl}
%<*package>
- [2016/08/05 v0.3m Typesetting example code (RN)]
+ [2016/11/20 v0.3n Typesetting example code (RN)]
%</package>
%
%<*driver>
@@ -39,7 +39,7 @@
%</driver>
% \fi
%
-% \CheckSum{873}
+% \CheckSum{891}
%
% \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
@@ -182,7 +182,7 @@
% \item[varwidth] Boolean valued key, default value is false. If set to
% true, the formatted text is set with its ``natural'' width instead of a
% fixed width as given by the value of the option |width|.
-% \item[hsep] Defines the vertical distance between the source code and the
+% \item[vsep] Defines the vertical distance between the source code and the
% formatted text.
% \item[wide] Boolean valued key, default value is false. If set to
% true, the source code and the formatted text overlap the print space
@@ -190,11 +190,19 @@
% \item[width] A \meta{dimen} value that defines the width of the
% formatted text. The default value depends of the relative positions of
% the source code and the formatted text.
-% \item[scaled] Without a value the formatted text will be scaled to fit
-% the given width of the result area. With a number as value the formatted
+% \item[scaled] Without a value the formatted text will be scaled to fit
+% the given width of the result area. With a number as value the formatted
% text will be scaled by this number.
% \end{description}
%
+% In addition to these options the kind of the result box (default: |\fbox|)
+% can be changed. For example:
+% \begin{verbatim}
+% \renewcommand\ResultBox{\fcolorbox{green}{lightgray}}
+% \setlength\ResultBoxSep{5mm}
+% \setlength\ResultBoxRule{2mm}
+% \end{verbatim}
+%
% \StopEventually{}
%
% \section{Implementation}
@@ -251,9 +259,9 @@
\newcommand*\SX at scaled{}
\lst at Key{scaled}{?}[!]{\def\SX at scaled{#1}}
% \end{macrocode}
-% \changes{v0.1h}{2005/06/03}{``lstpreset'' renamed to ``explpreset''
+% \changes{v0.1h}{2005/06/03}{``lstpreset'' renamed to ``explpreset''
% (RN).}
-% \changes{v0.3l}{2014/01/19}{Option ``scaled'' and \cmd{\SX at scaled}
+% \changes{v0.3l}{2014/01/19}{Option ``scaled'' and \cmd{\SX at scaled}
% added (RN).}
% \begin{macrocode}
\lst at Key{explpreset}\relax{\def\SX at explpreset{#1}}
@@ -271,6 +279,7 @@
% \changes{v0.2a}{2005/07/16}{``varwidth'' and ``justification'' added (RN).}
% \changes{v0.1l}{2005/06/19}{``graphic'' added (RN).}
% \changes{v0.3a}{2005/08/20}{``attachfile'' added (RN).}
+% \changes{v0.3n}{2016/11/20}{Define \cmd{\ResultBox} etc.}
% \begin{macrocode}
\lst at Key{varwidth}f[t]{\lstKV at SetIf{#1}\if at SX@varwidth}
\lst at Key{justification}\relax{\def\SX at justification{#1}}
@@ -283,6 +292,9 @@
}%
}%
\newbox\SX at ResBox
+\newcommand\ResultBox{} \let\ResultBox=\fbox
+\newdimen\ResultBoxSep \ResultBoxSep=\fboxsep
+\newdimen\ResultBoxRule \ResultBoxRule=\fboxrule
\newcommand*\SX at pos{}
\newcommand*\SX at width{}
\newcommand*\SX at hsep{}
@@ -425,11 +437,11 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{v0.1h}{2005/06/03}{Renamed from ``example'' to ``LTXexample' (RN).}
+% \changes{v0.3n}{2016/11/20}{Prevent utf8 encoding errors}
% \begin{environment}{LTXexample}
-% \changes{v0.1h}{2005/06/03}{Renamed from ``example'' to ``LTXexample' (RN).}
% \begin{macrocode}
-\lstnewenvironment{LTXexample}[1][]
-{%
+\lstnewenvironment{LTXexample}[1][]{%
\@temptokena{#1}%
\begingroup
% \end{macrocode}
@@ -445,11 +457,13 @@
\x
\xdef\SX@@explpreset{\the\@temptokena,codefile=\SX at codefile,
graphic={[\SX at graphicparam]{\SX at graphicname}}}%
- \setbox\@tempboxa=\hbox\bgroup% Warum noetig?
+ \begingroup
+ \let\UTFviii at defined=\@gobble
+ \let\@inpenc at undefined@=\@gobble
\lst at BeginWriteFile{\SX at codefile}%
-}
+}%
{%
- \lst at EndWriteFile\egroup
+ \lst at EndWriteFile\endgroup
\SX at put@code at result
}
% \end{macrocode}
@@ -506,12 +520,13 @@
\fi
% \end{macrocode}
% Correct \cmd{\SX at width} if a frame is requested.
+% \changes{v0.3n}{2016/11/20}{Use \cmd{\ResultBox}}
% \begin{macrocode}
\ifx\SX at rframe\@empty
\long\def\SX at frame##1{##1}%
\else
- \let\SX at frame\fbox
- \setlength\@tempdima{\SX at width-2\fboxsep-2\fboxrule}%
+ \let\SX at frame\ResultBox
+ \setlength\@tempdima{\SX at width-2\ResultBoxSep-2\ResultBoxRule}%
\edef\SX at width{\the\@tempdima}%
\fi
\isSX at odd{\def\@tempa{l}}{\def\@tempa{r}}%
@@ -519,12 +534,11 @@
\parbox{\linewidth+\SX at overhang}{%
% \end{macrocode}
% \cmd{\SX at codefile} (|\jobname.tmp|) is not nessesary for the filelist.
-% \changes{v0.3m}{2016/08/05}{Wrong assignement for \cmd{\lst at belowskip} (RN).}
+% \changes{v0.3m}{2016/08/05}{Wrong assignement for \cmd{\lst at belowskip} (RN).}
% \begin{macrocode}
\let\@addtofilelist\@gobble
\let\lst at ifdisplaystyle=\iftrue
\SX at KillAboveCaptionskip\lst at MakeCaption{t}%
- \lst at belowskip=\z@
\let\lst at belowskip=\z@
% \end{macrocode}
% Use the ``natural'' width of the result code if ``varwidth'' is
@@ -540,6 +554,8 @@
% varwidth environment. (Suggestions by Ulrike Fischer.).}
% \begin{macrocode}
\setbox\SX at ResBox\hbox{%
+ \fboxsep=\ResultBoxSep
+ \fboxrule=\ResultBoxRule
\SX at frame{%
\@nameuse{\if at SX@varwidth varwidth\else minipage\fi}%
\SX at width\relax
Modified: trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty 2016-11-20 22:10:55 UTC (rev 42545)
+++ trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty 2016-11-20 22:11:09 UTC (rev 42546)
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{showexpl}
- [2016/08/05 v0.3m Typesetting example code (RN)]
+ [2016/11/20 v0.3n Typesetting example code (RN)]
\DeclareOption{final}{%
\PassOptionsToPackage{\CurrentOption}{graphicx}%
\PassOptionsToPackage{\CurrentOption}{listings}%
@@ -71,6 +71,9 @@
}%
}%
\newbox\SX at ResBox
+\newcommand\ResultBox{} \let\ResultBox=\fbox
+\newdimen\ResultBoxSep \ResultBoxSep=\fboxsep
+\newdimen\ResultBoxRule \ResultBoxRule=\fboxrule
\newcommand*\SX at pos{}
\newcommand*\SX at width{}
\newcommand*\SX at hsep{}
@@ -167,8 +170,7 @@
{\vskip-\belowcaptionskip}{}%
\fi
}
-\lstnewenvironment{LTXexample}[1][]
-{%
+\lstnewenvironment{LTXexample}[1][]{%
\@temptokena{#1}%
\begingroup
\advance\c at ltxexample\@ne \advance\c at lstlisting\@ne
@@ -180,11 +182,13 @@
\x
\xdef\SX@@explpreset{\the\@temptokena,codefile=\SX at codefile,
graphic={[\SX at graphicparam]{\SX at graphicname}}}%
- \setbox\@tempboxa=\hbox\bgroup% Warum noetig?
+ \begingroup
+ \let\UTFviii at defined=\@gobble
+ \let\@inpenc at undefined@=\@gobble
\lst at BeginWriteFile{\SX at codefile}%
-}
+}%
{%
- \lst at EndWriteFile\egroup
+ \lst at EndWriteFile\endgroup
\SX at put@code at result
}
\newcommand*\SX at put@code at result{%
@@ -218,8 +222,8 @@
\ifx\SX at rframe\@empty
\long\def\SX at frame##1{##1}%
\else
- \let\SX at frame\fbox
- \setlength\@tempdima{\SX at width-2\fboxsep-2\fboxrule}%
+ \let\SX at frame\ResultBox
+ \setlength\@tempdima{\SX at width-2\ResultBoxSep-2\ResultBoxRule}%
\edef\SX at width{\the\@tempdima}%
\fi
\isSX at odd{\def\@tempa{l}}{\def\@tempa{r}}%
@@ -228,11 +232,12 @@
\let\@addtofilelist\@gobble
\let\lst at ifdisplaystyle=\iftrue
\SX at KillAboveCaptionskip\lst at MakeCaption{t}%
- \lst at belowskip=\z@
\let\lst at belowskip=\z@
\let\SX at MakeCaption\lst at MakeCaption
\let\lst at MakeCaption\@gobble{}
\setbox\SX at ResBox\hbox{%
+ \fboxsep=\ResultBoxSep
+ \fboxrule=\ResultBoxRule
\SX at frame{%
\@nameuse{\if at SX@varwidth varwidth\else minipage\fi}%
\SX at width\relax
More information about the tex-live-commits
mailing list