diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty | 186 |
1 files changed, 138 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty index 50ac55f4648..0c0d68f97d4 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty @@ -38,37 +38,102 @@ } \renewcommand{\lst@Init}[1]{% \LWR@traceinfo{lst@Init}% -\lst@ifdisplaystyle% - \LWR@forcenewpage% -\fi% -\renewcommand*{\@captype}{lstlisting}% -\let\lst@aboveskip\z@\let\lst@belowskip\z@% -\gdef\lst@boxpos{t}% -\let\lst@frame\@empty - \let\lst@frametshape\@empty - \let\lst@framershape\@empty - \let\lst@framebshape\@empty - \let\lst@framelshape\@empty -\lstframe@\lst@frameround ffff\relax% -\lst@multicols\@empty% -\LWR@origlst@Init{#1}\relax% -\def\lst@framelr{}% -\LWR@traceinfo{finished origlst@Init}% -\lst@ifdisplaystyle% - \LWR@traceinfo{About to create verbatim.}% - \let\lsthk@EveryPar\relax% - \LWR@atbeginverbatim{programlisting}% +\lst@ifdisplaystyle% lwarp + \LWR@forcenewpage% lwarp +\fi% lwarp +\let\lst@ifmathescape\iffalse% lwarp +\let\lst@DefEsc\relax% lwarp +\def\lst@escapebegin{}% lwarp +\def\lst@escapeend{}% lwarp +\renewcommand*{\@captype}{lstlisting}% lwarp + \let\lst@aboveskip\z@\let\lst@belowskip\z@% lwarp + \gdef\lst@boxpos{t}% lwarp + \let\lst@frame\@empty% lwarp + \let\lst@frametshape\@empty% lwarp + \let\lst@framershape\@empty% lwarp + \let\lst@framebshape\@empty% lwarp + \let\lst@framelshape\@empty% lwarp + \lstframe@\lst@frameround ffff\relax% lwarp + \lst@multicols\@empty% lwarp + \begingroup% + \ifx\lst@float\relax\else% + \edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}% + \expandafter\@tempa% + \fi% + \ifx\lst@multicols\@empty\else% + \edef\lst@next{\noexpand\multicols{\lst@multicols}}% + \expandafter\lst@next% + \fi% + \ifhmode\ifinner \lst@boxtrue \fi\fi% + \lst@ifbox% + \lsthk@BoxUnsafe% + \hbox to\z@\bgroup% + $\if t\lst@boxpos \vtop% + \else \if b\lst@boxpos \vbox% + \else \vcenter \fi\fi% + \bgroup \par\noindent% + \else% + \lst@ifdisplaystyle% + \lst@EveryDisplay% + \par\penalty-50\relax% + \vspace\lst@aboveskip% + \fi% + \fi% + \normalbaselines% + \abovecaptionskip\lst@abovecaption\relax% + \belowcaptionskip\lst@belowcaption\relax% + \lst@MakeCaption t% +\LWR@traceinfo{lst@Init: defining current label !\@currentlabel!}% + \let\LWR@listings@currentlabel\@currentlabel% lwarp +\LWR@traceinfo{lst@Init: defining current label !\cref@currentlabel!}% + \let\LWR@listings@cref@currentlabel\cref@currentlabel% lwarp +\LWR@traceinfo{lst@Init: preinit and init}% + \lsthk@PreInit \lsthk@Init% + \let\@currentlabel\LWR@listings@currentlabel% lwarp + \let\cref@currentlabel\LWR@listings@cref@currentlabel% lwarp +\LWR@traceinfo{lst@Init: M}% + \lst@ifdisplaystyle + \global\let\lst@ltxlabel\@empty + \if@inlabel + \lst@ifresetmargins + \leavevmode + \else + \xdef\lst@ltxlabel{\the\everypar}% + \lst@AddTo\lst@ltxlabel{% + \global\let\lst@ltxlabel\@empty + \everypar{\lsthk@EveryLine\lsthk@EveryPar}}% + \fi + \fi + \everypar\expandafter{\lst@ltxlabel + \lsthk@EveryLine\lsthk@EveryPar}% + \else + \everypar{} + \let\lst@NewLine\@empty + \fi +\LWR@traceinfo{lst@Init: P}% + \lsthk@InitVars \lsthk@InitVarsBOL + \lst@Let{13}\lst@MProcessListing + \let\lst@Backslash#1% + \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}% + \lst@InitFinalize% +\LWR@traceinfo{lst@Init: S}% +\def\lst@framelr{}% lwarp +\LWR@traceinfo{lst@Init: finished origlst@Init}% +\lst@ifdisplaystyle% lwarp + \LWR@traceinfo{lst@Init: About to create verbatim.}% lwarp + \let\lsthk@EveryPar\relax% lwarp + \LWR@atbeginverbatim{programlisting}% lwarp - \let\lsthk@EveryPar\LWR@origlsthkEveryPar% -\else% - \ifbool{LWR@verbtags}{\LWR@htmltag{% - span class=\textquotedbl{}inlineprogramlisting\textquotedbl% - }}{}% -\fi% -\LWR@traceinfo{lst@Init done}% + \let\lsthk@EveryPar\LWR@origlsthkEveryPar% lwarp +\else% lwarp + \ifbool{LWR@verbtags}{\LWR@htmltag{% lwarp + span class=\textquotedbl{}inlineprogramlisting\textquotedbl% lwarp + }}{}% lwarp +\fi% lwarp +\LWR@traceinfo{lst@Init: done}% } - \renewcommand*{\lst@DeInit}{% +\LWR@traceinfo{lst@DeInit}% \lst@ifdisplaystyle% \let\lsthk@EveryPar\relax% \LWR@afterendverbatim% @@ -76,19 +141,44 @@ \else% \ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}% \fi% -\LWR@origlst@DeInit% + \lst@XPrintToken \lst@EOLUpdate + \global\advance\lst@newlines\m@ne + \lst@ifshowlines + \lst@DoNewLines + \else + \setbox\@tempboxa\vbox{\lst@DoNewLines}% + \fi + \lst@ifdisplaystyle \par\removelastskip \fi + \lsthk@ExitVars\everypar{}\lsthk@DeInit\normalbaselines\normalcolor + \lst@MakeCaption b% + \lst@ifbox + \egroup $\hss \egroup + \vrule\@width\lst@maxwidth\@height\z@\@depth\z@ + \else + \lst@ifdisplaystyle + \par\penalty-50\vspace\lst@belowskip + \fi + \fi + \ifx\lst@multicols\@empty\else + \def\lst@next{\global\let\@checkend\@gobble + \endmulticols + \global\let\@checkend\lst@@checkend} + \expandafter\lst@next + \fi + \ifx\lst@float\relax\else + \expandafter\lst@endfloat + \fi + \endgroup +\LWR@traceinfo{lst@DeInit done}% } - \def\lst@MakeCaption#1{% -\LWR@traceinfo{MAKING CAPTION at #1}% +\LWR@traceinfo{lst@MakeCaption at #1}% \lst@ifdisplaystyle -\LWR@traceinfo{making a listings display caption}% +\LWR@traceinfo{lst@MakeCaption: making a listings display caption}% \ifx #1t% \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else \expandafter\refstepcounter \fi {lstlisting}% -\LWR@traceinfo{About to assign label: !\lst@label!}% -\LWR@traceinfo{Finished assigning the label.}% \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl \global\let\lst@name\lst@arg \global\let\lstname\lst@name \lst@ifnolol\else @@ -98,12 +188,12 @@ \else \def\lst@temp{ }% \ifx\lst@intname\lst@temp \else -\LWR@traceinfo{addcontents lst@name: -\lst@name-}% +\LWR@traceinfo{lst@MakeCaption: addcontents lst@name: -\lst@name-}% \fi \fi \fi \else -\LWR@traceinfo{addcontents lst@@caption: -\lst@@caption-}% +\LWR@traceinfo{lst@MakeCaption: addcontents lst@@caption: -\lst@@caption-}% \addcontentsline{lol}{lstlisting}% {\protect\numberline{\thelstlisting}% {\protect\ignorespaces \LWR@isolate{\lst@@caption} \protect\relax}}% @@ -111,34 +201,34 @@ \fi \fi \ifx\lst@caption\@empty\else -\LWR@traceinfo{lst@caption not empty-}% +\LWR@traceinfo{lst@MakeCaption: lst@caption not empty-}% \lst@IfSubstring #1\lst@captionpos {\begingroup -\LWR@traceinfo{at the selected position}% +\LWR@traceinfo{lst@MakeCaption: at the selected position}% \ifx\lst@title\@empty - \LWR@stoppars% + \LWR@stoppars% lwarp \lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption} \else -\LWR@traceinfo{Making title: \lst@title}% +\LWR@traceinfo{lst@MakeCaption: Making title: \lst@title}% \begin{BlockClass}{lstlistingtitle}% lwarp \lst@maketitle\lst@title% lwarp \end{BlockClass}% lwarp - \fi -\LWR@traceinfo{About to assign label: !\lst@label!}% - \ifx\lst@label\@empty\else + \fi% +\LWR@traceinfo{lst@MakeCaption: About to assign label: !\lst@label!}% + \ifx\lst@label\@empty\else% \leavevmode% gets rid of bad space factor error \GetTitleStringExpand{\lst@caption}% \edef\LWR@lntemp{\GetTitleStringResult}% \edef\@currentlabelname{\detokenize\expandafter{\LWR@lntemp}}% -\label{\lst@label}\fi -\LWR@traceinfo{Finished assigning the label.}% +\label{\lst@label}\fi% +\LWR@traceinfo{lst@MakeCaption: Finished assigning the label.}% \endgroup}{}% \fi -\LWR@traceinfo{end of making a listings display caption}% +\LWR@traceinfo{lst@MakeCaption: end of making a listings display caption}% \else -\LWR@traceinfo{INLINE}% +\LWR@traceinfo{lst@MakeCaption: INLINE}% \fi -\LWR@traceinfo{DONE WITH CAPTION at #1}% +\LWR@traceinfo{lst@MakeCaption: done at #1}% } \renewcommand{\lst@maketitle}[1]{% |