texlive[55030] Master/texmf-dist: showexpl (5may20)

commits+karl at tug.org commits+karl at tug.org
Tue May 5 23:32:38 CEST 2020


Revision: 55030
          http://tug.org/svn/texlive?view=revision&revision=55030
Author:   karl
Date:     2020-05-05 23:32:38 +0200 (Tue, 05 May 2020)
Log Message:
-----------
showexpl (5may20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf
    trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex
    trunk/Master/texmf-dist/doc/latex/showexpl/showexpl.pdf
    trunk/Master/texmf-dist/source/latex/showexpl/showexpl.dtx
    trunk/Master/texmf-dist/source/latex/showexpl/showexpl.ins
    trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/showexpl/README.md

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/showexpl/README

Deleted: trunk/Master/texmf-dist/doc/latex/showexpl/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/showexpl/README	2020-05-05 21:31:23 UTC (rev 55029)
+++ trunk/Master/texmf-dist/doc/latex/showexpl/README	2020-05-05 21:32:38 UTC (rev 55030)
@@ -1,16 +0,0 @@
-showexpl
-========
-
-The LaTeX package 'showexpl' provides a way to typeset LaTeX source code and
-the related result in the same document. The `listings' package is required.
-See 'doc/showexpl-test.tex' for the details.
-
-Recommended TDS locations:
-
-   showexpl.sty:                             tex/latex/showexpl
-   README, showexpl.pdf, showexpl-test.pdf,
-   showexpl-test.tex, result-picture.pdf:    doc/latex/showexpl
-
-For general installation advice, see
-http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages
-

Added: trunk/Master/texmf-dist/doc/latex/showexpl/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/showexpl/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/showexpl/README.md	2020-05-05 21:32:38 UTC (rev 55030)
@@ -0,0 +1,24 @@
+showexpl
+========
+
+The LaTeX package `showexpl` provides a way to typeset LaTeX source code and
+the related result in the same document. The `listings` package is required.
+See `doc/showexpl-test.tex` for the details.
+
+Recommended TDS locations:
+
+```text
+   showexpl.sty:                             tex/latex/showexpl
+   README, showexpl.pdf, showexpl-test.pdf,
+   showexpl-test.tex, result-picture.pdf:    doc/latex/showexpl
+```
+
+For general installation advice, see
+<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages>
+
+The showexpl package is also on
+CTAN:[macros/latex/contrib/showexpl](http://www.ctan.org/tex-archive/macros/latex/contrib/showexpl)
+
+Rolf Niepraschk,
+email: Rolf.Niepraschk at gmx.de,
+2020-05-03


Property changes on: trunk/Master/texmf-dist/doc/latex/showexpl/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex	2020-05-05 21:31:23 UTC (rev 55029)
+++ trunk/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex	2020-05-05 21:32:38 UTC (rev 55030)
@@ -1,5 +1,5 @@
 
-% Rolf Niepraschk, 2005-07-16, Rolf.Niepraschk at ptb.de
+% Rolf Niepraschk, 2020-05-03, Rolf.Niepraschk at gmx.de
 
 \listfiles\errorcontextlines=100
 \documentclass[a4paper,draft,twoside]{article}
@@ -6,31 +6,28 @@
 
 \usepackage[dvipsnames]{xcolor}
 \usepackage[textwidth=12cm,marginparwidth=4cm]{geometry}
-
 \usepackage[final]{showexpl}
 
-\usepackage[T1]{fontenc}
+\usepackage{iftex}
 
-\IfFileExists{luximono.sty}%
-{%
-  \usepackage[scaled]{luximono}%
-}
-{%
-  \IfFileExists{beramono.sty}%
-  {%
-    \usepackage[scaled]{beramono}%
-  }{}
-}
+\iftutex % LuaTeX, XeTeX
+  \usepackage{fontspec}
+  \setmonofont{DejaVuSansMono}[Scale=MatchUppercase]
+\else % old engines
+  \usepackage[T1]{fontenc}
+  \usepackage{lmodern}
+  \usepackage[scaled]{DejaVuSansMono}
+\fi
 
 \lstset{%
-    basicstyle=\ttfamily\small,
-    commentstyle=\itshape\ttfamily\small,
-    showspaces=false,
-    showstringspaces=false,
-    breaklines=true,
-    backgroundcolor=\color{lightgray},
-    breakautoindent=true,
-    captionpos=t
+  basicstyle=\ttfamily\small,
+  commentstyle=\itshape\ttfamily\small,
+  showspaces=false,
+  showstringspaces=false,
+  breaklines=true,
+  backgroundcolor=\color{lightgray},
+  breakautoindent=true,
+  captionpos=t
 }
 
 \iftrue

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	2020-05-05 21:31:23 UTC (rev 55029)
+++ trunk/Master/texmf-dist/source/latex/showexpl/showexpl.dtx	2020-05-05 21:32:38 UTC (rev 55030)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2004 -- 2016 by Rolf Niepraschk <Rolf.Niepraschk at gmx.de>
+% Copyright (C) 2004 -- 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/12/11 v0.3o Typesetting example code (RN)]
+    [2020/05/04 v0.3p Typesetting example code (RN)]
 %</package>
 %
 %<*driver>
@@ -39,7 +39,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{887}
+% \CheckSum{880}
 %
 % \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
@@ -206,6 +206,7 @@
 %
 % \section{Implementation}
 % \changes{v0.1e}{2004/11/24}{Loading of |showexpl.cfg| added (RN).}
+% \changes{v0.3p}{2020/05/04}{Remove package `calc' (RN).}
 %    \begin{macrocode}
 \DeclareOption{final}{%
   \PassOptionsToPackage{\CurrentOption}{graphicx}%
@@ -224,7 +225,7 @@
 }%
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{listings}}
 \ProcessOptions\relax
-\RequirePackage{listings,calc,ifthen,graphicx,varwidth}
+\RequirePackage{refcount,listings,graphicx,varwidth,float}
 %    \end{macrocode}
 % We must aktivate code from package \textsf{listings} for writing files.
 %    \begin{macrocode}
@@ -316,13 +317,12 @@
 % typesetting the result of the example code. More can be added with
 % the user key ``|preset=...|''.
 % \changes{v0.3e}{2006/04/05}{More redefinitions added (RN).}
+% \changes{v0.3p}{2020/05/04}{Remove extra treatment of `figure'/`table' (RN).}
 %    \begin{macrocode}
 \newcommand*\SX@@preset{%
   \renewcommand\documentclass[2][]{\SX at eat@version}%
   \renewcommand\usepackage[2][]{\SX at eat@version}%
   \renewenvironment{document}{}{}%
-  \renewenvironment{figure}[1][]{\def\@captype{figure}}{}%
-  \renewenvironment{table}[1][]{\def\@captype{table}}{}%
   \renewcommand\cite[1][]{}%
   \let\tableofcontens\relax \let\listoffigures\relax
   \let\listoftables\relax \let\printindex\relax
@@ -344,14 +344,28 @@
 % \begin{macro}{\isSX at odd}
 %  Parameter |#1| is executed on odd pages, parameter |#2| on
 %  even pages.
+%  \changes{v0.3p}{2020/05/04}{Replace \cmd{\isodd} with
+%  \cmd{\ifodd}\cmd{\getpagerefnumber} (remove package `ifthen') (RN).}
 %    \begin{macrocode}
 \newif\ifSX at wasodd
 \if at twoside
-  \newcommand*{\isSX at odd}[2]{%
-    \ifthenelse{\isodd{\pageref{\SX at IDENT}}}%
-      {\SX at wasoddtrue #1}{\SX at wasoddfalse #2}}
+  \newcommand*\isSX at odd{%
+    \begingroup
+      \ifodd\getpagerefnumber{\SX at IDENT}%
+        \aftergroup\SX at wasoddtrue
+      \else
+        \aftergroup\SX at wasoddfalse
+      \fi
+    \endgroup
+    \ifSX at wasodd
+      \expandafter\@firstoftwo
+    \else
+      \expandafter\@secondoftwo
+    \fi
+  }
 \else
-  \newcommand*{\isSX at odd}[2]{#1}\SX at wasoddtrue
+  \SX at wasoddtrue
+  \newcommand*\isSX at odd[2]{#1}
 \fi
 %    \end{macrocode}
 %  The call of \cmd{\isSX at odd} sets also \cmd{\ifSX at wasodd} to true or
@@ -388,20 +402,20 @@
 %    \begin{macrocode}
 \newcommand*\SX at put@t[3]{%
   \SX at ResultArea{\linewidth}{#2}\endgraf\pagebreak[2]%
-  \setlength\@tempdima{\SX at vsep}\vskip\@tempdima
+  \@tempdima=\dimexpr\SX at vsep\vskip\@tempdima
   \SX at CodeArea{\linewidth}{#3}%
 }
 \newcommand*\SX at put@b[3]{%
   \SX at CodeArea{\linewidth}{#3}\endgraf\pagebreak[2]%
-  \setlength\@tempdima{\SX at vsep}\vskip\@tempdima
+  \@tempdima=\dimexpr\SX at vsep\vskip\@tempdima
   \SX at ResultArea{\linewidth}{#2}%
 }
 \newcommand*\SX at put@l[3]{%
-  \setlength\@tempdimc{\linewidth-#1-\SX at hsep}%
+  \@tempdimc=\dimexpr\linewidth-#1-\SX at hsep % 
   \SX at ResultArea{#1}{#2}\hfill\SX at CodeArea{\@tempdimc}{#3}%
 }
 \newcommand*\SX at put@r[3]{%
-  \setlength\@tempdimc{\linewidth-#1-\SX at hsep}%
+  \@tempdimc=\dimexpr\linewidth-#1-\SX at hsep %
   \SX at CodeArea{\@tempdimc}{#3}\hfill\SX at ResultArea{#1}{#2}%
 }
 \newcommand*\SX at put@o[3]{%
@@ -411,12 +425,11 @@
   \@nameuse{SX at put@\ifSX at wasodd l\else r\fi}{#1}{#2}{#3}%
 }
 \newcommand\SX at ResultArea[2]{%
-  \SX at justification\setlength\@tempdima{#1}%
-  %\minipage\@tempdima#2\endminipage
+  \SX at justification\@tempdima=\dimexpr #1 %
   \parbox\@tempdima{#2}%
 }
 \newcommand\SX at CodeArea[2]{%
-  \setlength\@tempdima{#1}%
+  \@tempdima=\dimexpr #1 %
   \sbox\@tempboxa{\parbox\@tempdima{#2}}%
   \@tempdima=\dp\@tempboxa\usebox\@tempboxa
   \rlap{\raisebox{-\@tempdima}[0pt][0pt]{\SX at attachfile}}%
@@ -477,19 +490,12 @@
 \newcommand*\SX at put@code at result{%
   \begingroup
     \expandafter\lstset\expandafter{\SX at explpreset}%
-    \let\lst at float=\relax\let\SX at float=\relax
+    \expandafter\lstset\expandafter{\SX@@explpreset}%
 %    \end{macrocode}
-% Without the following call \cmd{\lst at beginfloat} is undefined.
+% Use listings floating procedure if necessary.
 %    \begin{macrocode}
-    \expandafter\lstset\expandafter{\SX@@explpreset}%
     \ifx\lst at float\relax\else
-%    \end{macrocode}
-% \cmd{\lst at float} must be \cmd{\relax} because the whole ``example''
-% should float but not the listings part in addition.
-%    \begin{macrocode}
-      \let\SX at float=\lst at float\let\lst at float=\relax
-      \g at addto@macro\SX@@explpreset{,float=false}%
-      \edef\@tempa{\noexpand\lst at beginfloat{lstlisting}[\SX at float]}%
+      \edef\@tempa{\noexpand\lst at beginfloat{lstlisting}[\lst at float]}
       \expandafter\@tempa
     \fi
     \ifx\lst at caption\@empty
@@ -511,7 +517,7 @@
         \ifx\@tempa\SX at pos\@tempswafalse\fi
         \def\@tempa{b}%
         \ifx\@tempa\SX at pos\@tempswafalse\fi
-        \setlength\@tempdima{\linewidth+\SX at overhang}%
+        \@tempdima=\dimexpr\linewidth+\SX at overhang %
         \if at tempswa\@tempdima=.5\@tempdima\fi%
         \edef\SX at width{\the\@tempdima}%
       \fi
@@ -523,12 +529,12 @@
         \long\def\SX at frame##1{##1}%
       \else
         \let\SX at frame\ResultBox
-        \setlength\@tempdima{\SX at width-2\ResultBoxSep-2\ResultBoxRule}%
+        \@tempdima=\dimexpr\SX at width-2\ResultBoxSep-2\ResultBoxRule %
         \edef\SX at width{\the\@tempdima}%
       \fi
       \isSX at odd{\def\@tempa{l}}{\def\@tempa{r}}%
       \makebox[\linewidth][\@tempa]{%
-        \parbox{\linewidth+\SX at overhang}{%
+        \parbox{\dimexpr\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).}
@@ -541,10 +547,7 @@
 % true.
 % \changes{v0.3k}{2013/03/21}{Setting \cmd{\lst at MakeCaption} to \cmd{\@gobble}
 %    again (prevent multiply defined labels; label key)}.
-%    \begin{macrocode}
-          \let\SX at MakeCaption\lst at MakeCaption
-          \let\lst at MakeCaption\@gobble{}
-%    \end{macrocode}
+% \changes{v0.3p}{2020/05/04}{Let's leave \cmd{\lst at MakeCaption} untouched (RN).}
 % \changes{v0.3j}{2012/09/22}{Setting \cmd{\lst at MakeCaption} to
 %    was a bad idea for hyperlinks. Group added to
 %   varwidth environment. (Suggestions by Ulrike Fischer.).}
@@ -564,12 +567,11 @@
             {\@latex at error{Parameter `\SX at pos' undefined}\@ehd}%
           {\@nameuse{SX at put@\SX at pos}%
             {\SX at width}{\box\SX at ResBox}{\SX at codeInput}}%
-          \let\lst at MakeCaption\SX at MakeCaption
           \lst at MakeCaption{b}\SX at KillBelowCaptionskip
         }%
       }%
     \endtrivlist
-    \ifx\SX at float\relax\else\expandafter\lst at endfloat\fi
+    \ifx\lst at float\relax\else\expandafter\lst at endfloat\fi
     \gdef\SX@@explpreset{}%
   \endgroup
 }
@@ -693,6 +695,20 @@
           \def\SX at tempb##1{\scalebox{\SX at scaled}{##1}}%
         \fi
       \fi
+      \let\SX at lst@Init=\lst at Init
+%    \end{macrocode}      
+%  Prevents float environments from floating. This is not enough for floating
+%  listing environments! Why?
+%  \changes{v0.3p}{2020/05/04}{Better handling of floats (RN).}
+%    \begin{macrocode}
+      \def\@xfloat##1[##2]{\@float at HH{##1}[H]}%
+%    \end{macrocode}
+%  Special handling of floating listing environments.
+%    \begin{macrocode}
+      \def\lst at Init{%
+        \let\lst at float=\relax
+        \SX at lst@Init
+      }
       \SX at tempb{\SX at tempa{\SX at codefile}}\par
     \endgroup
   \else
@@ -726,7 +742,7 @@
     \fi
     \SX at Info
     \expandafter\lstinputlisting\expandafter[\SX@@explpreset,nolol=true,%
-      caption={},belowskip=\z@,aboveskip=\z@]{\SX at codefile}%
+      caption={},belowskip=\z@,aboveskip=\z@,float=false]{\SX at codefile}%
   \endgroup
 }%
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/showexpl/showexpl.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/showexpl/showexpl.ins	2020-05-05 21:31:23 UTC (rev 55029)
+++ trunk/Master/texmf-dist/source/latex/showexpl/showexpl.ins	2020-05-05 21:32:38 UTC (rev 55030)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2004 by Rolf Niepraschk <Rolf.Niepraschk at gmx.de>
+%% Copyright (C) 2004 -- by Rolf Niepraschk <Rolf.Niepraschk at gmx.de>
 %%
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.2 of this license

Modified: trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty	2020-05-05 21:31:23 UTC (rev 55029)
+++ trunk/Master/texmf-dist/tex/latex/showexpl/showexpl.sty	2020-05-05 21:32:38 UTC (rev 55030)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{showexpl}
-    [2016/12/11 v0.3o Typesetting example code (RN)]
+    [2020/05/04 v0.3p Typesetting example code (RN)]
 \DeclareOption{final}{%
   \PassOptionsToPackage{\CurrentOption}{graphicx}%
   \PassOptionsToPackage{\CurrentOption}{listings}%
@@ -37,7 +37,7 @@
 }%
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{listings}}
 \ProcessOptions\relax
-\RequirePackage{listings,calc,ifthen,graphicx,varwidth}
+\RequirePackage{refcount,listings,graphicx,varwidth,float}
 \lst at RequireAspects{writefile}
 \newcommand*\SX at defaultWD[2]{%
   \afterassignment\SX at def@WD\dimen@#2\linewidth\relax{#1}}
@@ -89,8 +89,6 @@
   \renewcommand\documentclass[2][]{\SX at eat@version}%
   \renewcommand\usepackage[2][]{\SX at eat@version}%
   \renewenvironment{document}{}{}%
-  \renewenvironment{figure}[1][]{\def\@captype{figure}}{}%
-  \renewenvironment{table}[1][]{\def\@captype{table}}{}%
   \renewcommand\cite[1][]{}%
   \let\tableofcontens\relax \let\listoffigures\relax
   \let\listoftables\relax \let\printindex\relax
@@ -109,11 +107,23 @@
 \newcommand*\SX at eat@version[1][]{}
 \newif\ifSX at wasodd
 \if at twoside
-  \newcommand*{\isSX at odd}[2]{%
-    \ifthenelse{\isodd{\pageref{\SX at IDENT}}}%
-      {\SX at wasoddtrue #1}{\SX at wasoddfalse #2}}
+  \newcommand*\isSX at odd{%
+    \begingroup
+      \ifodd\getpagerefnumber{\SX at IDENT}%
+        \aftergroup\SX at wasoddtrue
+      \else
+        \aftergroup\SX at wasoddfalse
+      \fi
+    \endgroup
+    \ifSX at wasodd
+      \expandafter\@firstoftwo
+    \else
+      \expandafter\@secondoftwo
+    \fi
+  }
 \else
-  \newcommand*{\isSX at odd}[2]{#1}\SX at wasoddtrue
+  \SX at wasoddtrue
+  \newcommand*\isSX at odd[2]{#1}
 \fi
 \newcounter{ltxexample}
 \newcommand*{\SX at IDENT}{SX@\number\value{ltxexample}}
@@ -125,20 +135,20 @@
 }
 \newcommand*\SX at put@t[3]{%
   \SX at ResultArea{\linewidth}{#2}\endgraf\pagebreak[2]%
-  \setlength\@tempdima{\SX at vsep}\vskip\@tempdima
+  \@tempdima=\dimexpr\SX at vsep\vskip\@tempdima
   \SX at CodeArea{\linewidth}{#3}%
 }
 \newcommand*\SX at put@b[3]{%
   \SX at CodeArea{\linewidth}{#3}\endgraf\pagebreak[2]%
-  \setlength\@tempdima{\SX at vsep}\vskip\@tempdima
+  \@tempdima=\dimexpr\SX at vsep\vskip\@tempdima
   \SX at ResultArea{\linewidth}{#2}%
 }
 \newcommand*\SX at put@l[3]{%
-  \setlength\@tempdimc{\linewidth-#1-\SX at hsep}%
+  \@tempdimc=\dimexpr\linewidth-#1-\SX at hsep %
   \SX at ResultArea{#1}{#2}\hfill\SX at CodeArea{\@tempdimc}{#3}%
 }
 \newcommand*\SX at put@r[3]{%
-  \setlength\@tempdimc{\linewidth-#1-\SX at hsep}%
+  \@tempdimc=\dimexpr\linewidth-#1-\SX at hsep %
   \SX at CodeArea{\@tempdimc}{#3}\hfill\SX at ResultArea{#1}{#2}%
 }
 \newcommand*\SX at put@o[3]{%
@@ -148,12 +158,11 @@
   \@nameuse{SX at put@\ifSX at wasodd l\else r\fi}{#1}{#2}{#3}%
 }
 \newcommand\SX at ResultArea[2]{%
-  \SX at justification\setlength\@tempdima{#1}%
-  %\minipage\@tempdima#2\endminipage
+  \SX at justification\@tempdima=\dimexpr #1 %
   \parbox\@tempdima{#2}%
 }
 \newcommand\SX at CodeArea[2]{%
-  \setlength\@tempdima{#1}%
+  \@tempdima=\dimexpr #1 %
   \sbox\@tempboxa{\parbox\@tempdima{#2}}%
   \@tempdima=\dp\@tempboxa\usebox\@tempboxa
   \rlap{\raisebox{-\@tempdima}[0pt][0pt]{\SX at attachfile}}%
@@ -192,12 +201,9 @@
 \newcommand*\SX at put@code at result{%
   \begingroup
     \expandafter\lstset\expandafter{\SX at explpreset}%
-    \let\lst at float=\relax\let\SX at float=\relax
     \expandafter\lstset\expandafter{\SX@@explpreset}%
     \ifx\lst at float\relax\else
-      \let\SX at float=\lst at float\let\lst at float=\relax
-      \g at addto@macro\SX@@explpreset{,float=false}%
-      \edef\@tempa{\noexpand\lst at beginfloat{lstlisting}[\SX at float]}%
+      \edef\@tempa{\noexpand\lst at beginfloat{lstlisting}[\lst at float]}
       \expandafter\@tempa
     \fi
     \ifx\lst at caption\@empty
@@ -213,7 +219,7 @@
         \ifx\@tempa\SX at pos\@tempswafalse\fi
         \def\@tempa{b}%
         \ifx\@tempa\SX at pos\@tempswafalse\fi
-        \setlength\@tempdima{\linewidth+\SX at overhang}%
+        \@tempdima=\dimexpr\linewidth+\SX at overhang %
         \if at tempswa\@tempdima=.5\@tempdima\fi%
         \edef\SX at width{\the\@tempdima}%
       \fi
@@ -221,17 +227,15 @@
         \long\def\SX at frame##1{##1}%
       \else
         \let\SX at frame\ResultBox
-        \setlength\@tempdima{\SX at width-2\ResultBoxSep-2\ResultBoxRule}%
+        \@tempdima=\dimexpr\SX at width-2\ResultBoxSep-2\ResultBoxRule %
         \edef\SX at width{\the\@tempdima}%
       \fi
       \isSX at odd{\def\@tempa{l}}{\def\@tempa{r}}%
       \makebox[\linewidth][\@tempa]{%
-        \parbox{\linewidth+\SX at overhang}{%
+        \parbox{\dimexpr\linewidth+\SX at overhang}{%
           \let\@addtofilelist\@gobble
           \let\lst at ifdisplaystyle=\iftrue
           \SX at KillAboveCaptionskip\lst at MakeCaption{t}%
-          \let\SX at MakeCaption\lst at MakeCaption
-          \let\lst at MakeCaption\@gobble{}
           \setbox\SX at ResBox\hbox{%
             \fboxsep=\ResultBoxSep
             \fboxrule=\ResultBoxRule
@@ -247,12 +251,11 @@
             {\@latex at error{Parameter `\SX at pos' undefined}\@ehd}%
           {\@nameuse{SX at put@\SX at pos}%
             {\SX at width}{\box\SX at ResBox}{\SX at codeInput}}%
-          \let\lst at MakeCaption\SX at MakeCaption
           \lst at MakeCaption{b}\SX at KillBelowCaptionskip
         }%
       }%
     \endtrivlist
-    \ifx\SX at float\relax\else\expandafter\lst at endfloat\fi
+    \ifx\lst at float\relax\else\expandafter\lst at endfloat\fi
     \gdef\SX@@explpreset{}%
   \endgroup
 }
@@ -354,6 +357,12 @@
           \def\SX at tempb##1{\scalebox{\SX at scaled}{##1}}%
         \fi
       \fi
+      \let\SX at lst@Init=\lst at Init
+      \def\@xfloat##1[##2]{\@float at HH{##1}[H]}%
+      \def\lst at Init{%
+        \let\lst at float=\relax
+        \SX at lst@Init
+      }
       \SX at tempb{\SX at tempa{\SX at codefile}}\par
     \endgroup
   \else
@@ -370,7 +379,7 @@
     \fi
     \SX at Info
     \expandafter\lstinputlisting\expandafter[\SX@@explpreset,nolol=true,%
-      caption={},belowskip=\z@,aboveskip=\z@]{\SX at codefile}%
+      caption={},belowskip=\z@,aboveskip=\z@,float=false]{\SX at codefile}%
   \endgroup
 }%
 \newcommand*\LTXinputExample[2][]{%



More information about the tex-live-commits mailing list.