diff options
author | Karl Berry <karl@freefriends.org> | 2017-02-21 23:44:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-02-21 23:44:01 +0000 |
commit | 91c9b5dc1e480401f79c7ea64bd98754e1eab170 (patch) | |
tree | 0490daeb741da832d4791aef4d848c3adf39621b /Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty | |
parent | 28867ba53359e0e24d60b4189f4625553a5e76a0 (diff) |
lwarp (10feb17)
git-svn-id: svn://tug.org/texlive/trunk@43292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty new file mode 100644 index 00000000000..e75a56e1671 --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-listings.sty @@ -0,0 +1,207 @@ +%% +%% 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 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} + +\let\LWR@origlst@Init\lst@Init +\let\LWR@origlst@DeInit\lst@DeInit + +\let\LWR@origlsthkEveryPar\lsthk@EveryPar + +\renewcommand{\l@lstlisting}[2]{\hypertocfloat{1}{toclstlisting}{#1}{#2}} +\renewcommand{\lst@Init}[1]{% +\LWR@traceinfo{lst@Init}% +\renewcommand*{\@captype}{lstlisting}% +\LWR@origlst@Init{#1}% +\LWR@traceinfo{finished origlst@Init}% +\lst@ifdisplaystyle% +\LWR@traceinfo{About to create verbatim.}% +\let\lsthk@EveryPar\relax% +\LWR@atbeginverbatim{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% +\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 \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 + \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}% +} +\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{\rlap{\LWR@orignormalfont + \kern\VerbatimHTMLWidth \kern\lst@numbersep + \lst@numberstyle{\thelstnumber}}}% + }{\PackageError{Listings}{Numbers #1 unknown}\@ehc}} + +\end{warpHTML} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\endinput +%% +%% End of file `lwarp-listings.sty'. |