You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
tex-compiler/texmf-dist/tex/latex/lwarp/lwarp-listings.sty

156 lines
4.8 KiB

%%
%% This is file `lwarp-listings.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx (with options: `listings')
%% This is a generated file.
%% Copyright 2016-2020 Brian Dunn
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
\begin{warpHTML}
\LWR@ProvidesPackagePass{listings}[2018/09/02]
\lst@column@flexible
\let\LWR@origlst@Init\lst@Init
\let\LWR@origlst@DeInit\lst@DeInit
\let\LWR@origlsthkEveryPar\lsthk@EveryPar
\renewcommand{\l@lstlisting}[2]{\hypertocfloat{1}{lstlisting}{lol}{#1}{#2}}
\def\lstset@#1{\endgroup%
\setkeys{lst}{%
#1%
,literate=%
{<}{\HTMLentity{lt}}{4}%
{>}{\HTMLentity{gt}}{4}%
{\&}{\HTMLentity{amp}}{5}%
}%
}
\renewcommand{\lst@Init}[1]{%
\LWR@traceinfo{lst@Init}%
\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@forcenewpage%
\LWR@atbeginverbatim{1.5}{programlisting}%
\let\lsthk@EveryPar\LWR@origlsthkEveryPar%
\else%
\ifbool{LWR@verbtags}{\LWR@htmltag{span class="inlineprogramlisting"}}{}%
\fi%
}
\renewcommand*{\lst@DeInit}{%
\lst@ifdisplaystyle%
\let\lsthk@EveryPar\relax%
\LWR@afterendverbatim{0}%
\let\lsthk@EveryPar\LWR@origlsthkEveryPar%
\else%
\ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}%
\fi%
\LWR@origlst@DeInit%
}
\def\lst@MakeCaption#1{%
\LWR@traceinfo{MAKING CAPTION at #1}%
\lst@ifdisplaystyle
\LWR@traceinfo{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
\ifx\lst@@caption\@empty
\ifx\lst@caption\@empty
\ifx\lst@intname\@empty \else \def\lst@temp{ }%
\ifx\lst@intname\lst@temp \else
\LWR@traceinfo{addcontents lst@name: -\lst@name-}%
\fi\fi
\fi
\else
\LWR@traceinfo{addcontents lst@@caption: -\lst@@caption-}%
\addcontentsline{lol}{lstlisting}%
{\protect\numberline{\thelstlisting}%
{\protect\ignorespaces \LWR@isolate{\lst@@caption} \protect\relax}}%
\fi
\fi
\fi
\ifx\lst@caption\@empty\else
\LWR@traceinfo{lst@caption not empty-}%
\lst@IfSubstring #1\lst@captionpos
{\begingroup
\LWR@traceinfo{at the selected position}%
\ifx\lst@title\@empty
\LWR@stoppars%
\lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption}
\else
\LWR@traceinfo{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
\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.}%
\endgroup}{}%
\fi
\LWR@traceinfo{end of making a listings display caption}%
\else
\LWR@traceinfo{INLINE}%
\fi
\LWR@traceinfo{DONE WITH CAPTION at #1}%
}
\renewcommand{\lst@maketitle}[1]{%
\LWR@isolate{#1}%
}%
\lst@Key{numbers}{none}{%
\let\lst@PlaceNumber\@empty
\lstKV@SwitchCases{#1}%
{none:\\%
left:\def\lst@PlaceNumber{%
\LWR@orignormalfont%
\lst@numberstyle{\thelstnumber}\kern\lst@numbersep%
}\\%
right:\def\lst@PlaceNumber{\LWR@origrlap{\LWR@orignormalfont
\kern 6in \kern\lst@numbersep
\lst@numberstyle{\thelstnumber}}}%
}{\PackageError{lwarp-listings}{Numbers #1 unknown}\@ehc}}
\end{warpHTML}
\endinput
%%
%% End of file `lwarp-listings.sty'.