From d2809b2028ad011468161045e74d908f59e65022 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 21 Feb 2024 21:09:54 +0000 Subject: listings (21feb24) git-svn-id: svn://tug.org/texlive/trunk@70045 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/listings/listings-devel.pdf | Bin 1454263 -> 1451811 bytes Master/texmf-dist/doc/latex/listings/listings.pdf | Bin 1031323 -> 1026570 bytes Master/texmf-dist/doc/latex/listings/lstdrvrs.pdf | Bin 752443 -> 755742 bytes Master/texmf-dist/source/latex/listings/Makefile | 12 +- .../texmf-dist/source/latex/listings/listings.dtx | 376 +++++++++++++-------- .../texmf-dist/source/latex/listings/listings.ins | 10 + .../texmf-dist/source/latex/listings/lstdrvrs.dtx | 46 ++- .../texmf-dist/source/latex/listings/lstdrvrs.ins | 2 +- .../texmf-dist/tex/latex/listings/listings-acm.prf | 2 +- .../tex/latex/listings/listings-bash.prf | 2 +- .../tex/latex/listings/listings-fortran.prf | 2 +- .../tex/latex/listings/listings-hansl.prf | 2 +- .../texmf-dist/tex/latex/listings/listings-lua.prf | 2 +- .../tex/latex/listings/listings-python.prf | 2 +- Master/texmf-dist/tex/latex/listings/listings.cfg | 2 +- Master/texmf-dist/tex/latex/listings/listings.sty | 205 +++++------ Master/texmf-dist/tex/latex/listings/lstdoc.sty | 4 +- Master/texmf-dist/tex/latex/listings/lstlang1.sty | 10 +- Master/texmf-dist/tex/latex/listings/lstlang2.sty | 32 +- Master/texmf-dist/tex/latex/listings/lstlang3.sty | 2 +- Master/texmf-dist/tex/latex/listings/lstmisc.sty | 12 +- Master/texmf-dist/tex/latex/listings/lstpatch.sty | 14 + 22 files changed, 448 insertions(+), 291 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/listings/lstpatch.sty diff --git a/Master/texmf-dist/doc/latex/listings/listings-devel.pdf b/Master/texmf-dist/doc/latex/listings/listings-devel.pdf index 4febb79f4ed..77335799e18 100644 Binary files a/Master/texmf-dist/doc/latex/listings/listings-devel.pdf and b/Master/texmf-dist/doc/latex/listings/listings-devel.pdf differ diff --git a/Master/texmf-dist/doc/latex/listings/listings.pdf b/Master/texmf-dist/doc/latex/listings/listings.pdf index bf8ad68ce94..6c0b7ece78d 100644 Binary files a/Master/texmf-dist/doc/latex/listings/listings.pdf and b/Master/texmf-dist/doc/latex/listings/listings.pdf differ diff --git a/Master/texmf-dist/doc/latex/listings/lstdrvrs.pdf b/Master/texmf-dist/doc/latex/listings/lstdrvrs.pdf index 2bf416063a6..c0a320d0958 100644 Binary files a/Master/texmf-dist/doc/latex/listings/lstdrvrs.pdf and b/Master/texmf-dist/doc/latex/listings/lstdrvrs.pdf differ diff --git a/Master/texmf-dist/source/latex/listings/Makefile b/Master/texmf-dist/source/latex/listings/Makefile index 49750393d34..58c4c25478c 100644 --- a/Master/texmf-dist/source/latex/listings/Makefile +++ b/Master/texmf-dist/source/latex/listings/Makefile @@ -2,10 +2,10 @@ # # This file generates files required to use the listings package. # -# $Id$ +# Time-stamp: <2024-02-15 20:02:38 ax006ho> # # (c) 2007 Brooks Moses -# (c) 2013-2018 Jobst Hoffmann +# (c) 2013- Jobst Hoffmann # # This file is distributed under the terms of the LaTeX Project Public # License from CTAN archives in directory macros/latex/base/lppl.txt. @@ -36,7 +36,7 @@ DISTRIBUTION_FILES = ../$(PACKAGE)/$(PACKAGE).pdf \ ../$(PACKAGE)/README \ ../$(PACKAGE)/Makefile \ ../$(PACKAGE)/lstdrvrs.dtx \ - ../$(PACKAGE)/lstdrvrs.pdf + ../$(PACKAGE)/lstdrvrs.pdf PACKAGE_FILES = $(subst ../$(PACKAGE)/,,$(DISTRIBUTION_FILES)) STY_FILES = listings.cfg listings.sty lstmisc.sty \ lstlang0.sty lstlang1.sty lstlang2.sty @@ -59,7 +59,7 @@ listings.sty: listings.ins listings.dtx lstdrvrs.dtx $(TEX) $< listings.pdf: listings.sty - echo "\PassOptionsToClass{a4paper}{article}" > ltxdoc.cfg + echo "\PassOptionsToClass{a4paper}{ltxdoc}" > ltxdoc.cfg $(LATEX) ${<:.sty=.dtx} $(MAKEINDEX) -s gind.ist ${@:.pdf=} $(LATEX) ${<:.sty=.dtx} @@ -67,7 +67,7 @@ listings.pdf: listings.sty rm -f ltxdoc.cfg listings-devel.pdf: listings.sty - echo "\PassOptionsToClass{a4paper}{article}" > ltxdoc.cfg + echo "\PassOptionsToClass{a4paper}{ltxdoc}" > ltxdoc.cfg echo "\AtBeginDocument{\AlsoImplementation}" >> ltxdoc.cfg $(LATEX) -jobname=${@:.pdf=} ${<:.sty=.dtx} $(MAKEINDEX) -s gind.ist ${@:.pdf=} @@ -76,7 +76,7 @@ listings-devel.pdf: listings.sty rm -f ltxdoc.cfg lstdrvrs.pdf: lstdrvrs.dtx - echo "\PassOptionsToClass{a4paper}{article}" > ltxdoc.cfg + echo "\PassOptionsToClass{a4paper}{ltxdoc}" > ltxdoc.cfg $(LATEX) ${<:.sty=.dtx} $(MAKEINDEX) -s gind.ist lstdrvrs $(LATEX) ${<:.sty=.dtx} diff --git a/Master/texmf-dist/source/latex/listings/listings.dtx b/Master/texmf-dist/source/latex/listings/listings.dtx index c507ab5fc10..c336295db5c 100644 --- a/Master/texmf-dist/source/latex/listings/listings.dtx +++ b/Master/texmf-dist/source/latex/listings/listings.dtx @@ -40,10 +40,12 @@ \DisableCrossrefs \OnlyDescription -\usepackage{lstdoc,textcomp} +\usepackage{lstdoc} % the basic support package for generating + % the documentation of this package +\usepackage{textcomp} % needed for upquote apostrophes \usepackage{mdframed} % frames for external files \usepackage{moreverb} % writing external files -\usepackage{xcolor} % because of colouring the background +\usepackage{xcolor} % because of coloring the background \makeindex @@ -115,7 +117,7 @@ %^^A ============================================= %^^A %\newbox\abstractbox -%\setbox\abstractbox=\vbox{ +%\setbox\abstractbox=\vbox{% % \begin{abstract} % The \packagename{listings} package is a source code printer for \LaTeX. % You can typeset stand alone files as well as listings with an environment @@ -125,7 +127,7 @@ % language isn't already supported, you can make your own definition. % \end{abstract}} % -% \title{\vspace*{-2\baselineskip}The \textsf{Listings} Package} +% \title{\vspace*{-2\baselineskip}The \packagename{Listings} Package} % \author{Copyright 1996--2004, Carsten Heinz% % \\ Copyright 2006--2007, Brooks Moses % \\ Copyright 2013--, Jobst Hoffmann @@ -133,7 +135,7 @@ % Hoffmann became the maintainer of the \packagename{listings} % package in 2013; see the Preface for details.}~ % % \textless\lstemail\textgreater} -% \date{2023/02/27\enspace\enspace Version 1.9\ \box\abstractbox} +% \date{2024/02/21\enspace\enspace Version 1.10\ \box\abstractbox} % \def\lstemail{\href{mailto:j.hoffmann@fh-aachen.de}{\texttt{j.hoffmann(at)fh-aachen.de}}} % \ifhyper % \hypersetup{pdftitle=The Listings Package, @@ -2628,9 +2630,10 @@ % \item[1.1,false] % \rkeyname{upquote}|=|\meta{\alternative{true,false}}\label{uoption:upquote} % -% determines whether the left and right quote are printed |`'| or -% \texttt{\textasciigrave\textquotesingle}. This key requires the -% \packagename{textcomp} package if true. +% determines whether the left and right quote are printed |`'| (false) or +% \texttt{\textasciigrave\textquotesingle} (true). This key requires the +% \packagename{textcomp} package if true, for more information have a +% look at page \pageref{sec:upquote}. % % \item[0.12,8] \rkeyname{tabsize}|=|\meta{number} % @@ -2790,8 +2793,12 @@ % \item[0.16] \rcmdname\lstlistoflistings % % prints a list of listings. Each entry is with descending priority -% either the short caption, the caption, the file name or the name of the -% listing, see also the key \keyname{name} in section \ref{rLineNumbers}. +% either the short caption, the caption, the file name, or the name of +% the listing, see also the key \keyname{name} in section +% \ref{rLineNumbers}. From version v1.10 of this package on the list of +% listings can be prepared by means of the \packagename{tocbasic} package +% \cite[Chapter 15]{Kohm:scrguide}, for more information have a look at +% page \pageref{sec:tocbasic}. % % \item[1.0] \rkeyname{nolol}|=|\meta{\alternative{true,false}}\syntaxor\rkeyname{nolol} % @@ -2811,7 +2818,7 @@ % simple way, something like |\small|, |\bfseries| or a combination % of several commands. If there is a need for a complete % customization of the label (justification, fonts, margins, \ldots), -% one should use the \textsf{caption} package by A.~Sommerfeldt +% one should use the \packagename{caption} package by A.~Sommerfeldt % \cite{Sommerfeldt:caption}. % % \item[0.20,\arabic{lstlisting},data] \rcmdname\thelstlisting @@ -3259,7 +3266,7 @@ % Expand that list yourself and mail me about new items. % % -% \subsection{Interface to \textsf{fancyvrb}} +% \subsection{Interface to \packagename{fancyvrb}} % % The \packagename{fancyvrb} package---fancy verbatims---from Timothy van Zandt % provides macros for reading, writing and typesetting verbatim code. It has @@ -3924,7 +3931,7 @@ % \end{TODO} % % -% \subsection{\textsf{LGrind} definitions}\label{rLGrindDefinitions} +% \subsection{\packagename{LGrind} definitions}\label{rLGrindDefinitions} % % Yes, it's a nasty idea to steal language definitions from other programs. % Nevertheless, it's possible for the \packagename{LGrind} definition @@ -4487,28 +4494,69 @@ % make pdf-devel\end{verbatim} % gives the same result---it is called \texttt{listings-devel.pdf}. % +% +% \subsubsection*{How to copy and paste from a document} +% \label{sec:upquote} +% If you want to provide a document containing listings formatted by this +% package (\packagename{listings}) as source for copy and paste, you should +% be sure to set the key |upquote| to |true| and have +% |\usepackage{textcomp}| in the preamble of the document. Otherwise the +% pair |`'| of curly quotation marks is associated with Unicode positions +% U+2018 and U+2019 \cite{CovingtonMittelbachKuhn:upquote}. These +% characters are seldom used as delimiters in modern programming languages. +% +% +% \subsubsection*{How to change the layout of the list of listings} +% \label{sec:tocbasic} +% If you put the command |\lstlistoflistings| into your document, the list +% of listings is automatically generated and printed at that point. If you +% are using the standard \LaTeX{} classes the list is prepared by +% |\addtocontents| commands or a variation, if you also load the package +% \packagename{float}. In both cases the layout is the one defined by +% L. Lamport. +% +% If you want to change the layout of this list, you can use the package +% \packagename{tocbasic} as described in \cite[Chapter +% 15.3]{Kohm:scrguide}. \packagename{tocbasic} is automatically loaded, if +% you are using one of the KOMA classes. +% +% % \makeatletter %^^A \def\index@prologue{\section*{Index}\markboth{Index}{Index}} % \def\index@prologue{\part{Index}\markboth{Index}{Index}} % \makeatother %^^A \StopEventually{\lstcheckreference\setcounter{IndexColumns}{2}\PrintIndex} % \StopEventually{% +% \nocite{MF23} % \begin{thebibliography}{MDB01} % +% \bibitem[CMK12]{CovingtonMittelbachKuhn:upquote} +% Michael A. Covington, Frank Mittelbach and Markus G. Kuhn. +% \newblock{\packagename{upquote} -- upright-quote and grave-accent glyphs +% in verbatim}, 2012. +% % \bibitem[DS13]{DanielSchubert:mdframed} % Marco Daniel and Elke Schubert. -% \newblock{The \textsf{mdframed} package}, 2013. +% \newblock{The \packagename{mdframed} package}, 2013. % % \bibitem[Fai11]{Fairbairns:moreverb} % Robin Fairbairns. -% \newblock{The \textsf{moreverb} package}, 2011. +% \newblock{The \packagename{moreverb} package}, 2011. +% +% \bibitem[Koh23]{Kohm:scrguide} +% Markus Kohm. +% \newblock{KOMA-Script -- The Guide}, 2023. +% +% \bibitem[MF23]{MittelbachFischer:companion} +% Frank Mittelbach and Ulrike Fischer. +% \newblock{The \LaTeX-Companion} Part I and II, 2023. % % \bibitem[Mi04]{Mittelbach:companion} % Frank Mittelbach, Michel Goossens, Johannes Braams, % David P. Carlisle, and Chris Rowley. % \newblock{The \LaTeX-Companion}, 2004. % -% \bibitem[Som11]{Sommerfeldt:captions} +% \bibitem[Som11]{Sommerfeldt:caption} % Axel Sommerfeldt. % \newblock{Customizing captions of floating environments}, 2011. % \end{thebibliography} @@ -5930,7 +5978,7 @@ % \part{Implementation} % % -% \CheckSum{12388} +% \CheckSum{12409} %^^A %^^A Don't index TeX-primitives. %^^A @@ -6074,8 +6122,8 @@ % All files will have same date and version. % \begin{macrocode} %<*kernel|misc|doc> -\def\filedate{2023/02/27} -\def\fileversion{1.9} +\def\filedate{2024/02/21} +\def\fileversion{1.10} % % \end{macrocode} % What we need and who we are. @@ -6102,13 +6150,13 @@ %<*misc> \ProvidesFile{lstmisc.sty} [\filedate\space\fileversion\space(Carsten Heinz)] -\lst@CheckVersion\fileversion +\lst@CheckVersion\fileversion% {\typeout{^^J% ***^^J% *** This file requires `listings.sty' version \fileversion.^^J% - *** You have a serious problem, so I'm exiting ...^^J% + *** You have a serious problem, so I'm exiting...^^J% ***^^J}% - \batchmode \@@end} + \batchmode\@@end} % % \end{macrocode} % or by the dummy patch. @@ -7205,7 +7253,7 @@ % \end{macro} % % -% \subsection{Interfacing with \textsf{keyval}} +% \subsection{Interfacing with \packagename{keyval}} % % The \packagename{keyval} package passes the value via the one and only % paramater |#1| to the definition part of the key macro. The following @@ -8155,7 +8203,7 @@ % \begin{macro}{\lst@DoNewLines} % First we take care of |\lst@maxempty| and then of the remaining empty lines. % \begin{macrocode} -\def\lst@DoNewLines{ +\def\lst@DoNewLines{% \@whilenum\lst@newlines>\lst@maxempty \do {\lst@ifpreservenumber \lsthk@OnEmptyLine @@ -8885,6 +8933,7 @@ \lst@ProcessOther {"5C}{\lst@ttfamily{\char92}\textbackslash} \lst@ProcessOther {"5E}\textasciicircum \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}\textunderscore} + % or \char"5F \lst@ProcessOther {"60}{\lst@ifupquote \textasciigrave \else \char96\relax \fi} \lst@ProcessOther {"7B}{\lst@ttfamily{\char123}\textbraceleft} @@ -10622,7 +10671,7 @@ % Same as |\lst@CDefX| but we both make |#1| active and assign a new catcode. % \begin{macrocode} \gdef\lst@ActiveCDefX#1{\lst@ActiveCDefX@#1} -\gdef\lst@ActiveCDefX@#1#2#3{ +\gdef\lst@ActiveCDefX@#1#2#3{% \catcode`#1\active\lccode`\~=`#1% \lowercase{\lst@CDefIt~}{#2}{#3}{}} % \end{macrocode} @@ -13226,7 +13275,7 @@ % of background color to the left of the margin is now drawn before the left % side of the frame is drawn, so that they overlap correctly in Acrobat. % -% \begin{macro}{\lst@frameMakeVBox} +% \begin{macro}{\lst@frameMakeBoxV} % \begin{macrocode} \gdef\lst@frameMakeBoxV#1#2#3{% \setbox#1\hbox{% @@ -13711,6 +13760,7 @@ % % % \section{Typesetting a listing} +% \label{sec:typesetting-listing} % % \begingroup % \begin{macrocode} @@ -13743,7 +13793,22 @@ % \end{lstkey} % \end{lstkey} % \end{lstkey} +% +% \begin{lstkey}{nolol} +% is just another key with an obvious meaning here. We'll use it below, +% of course. +% \begin{macrocode} +\lst@Key{nolol}{false}[t]{\lstKV@SetIf{#1}\lst@ifnolol} +\def\lst@nololtrue{\let\lst@ifnolol\iftrue} +\let\lst@ifnolol\iffalse % init +% \end{macrocode} +% \end{lstkey} % \end{macro} +% +% +% \subsection{Dealing with lineranges} +% \label{sec:lineranges} +% % The following code is just copied from the current development version, and % from the |lstpatch.sty| file that Carsten left in version 1.3b for doing % line ranges with numbers and range markers. It uses some more keys: @@ -13794,7 +13859,7 @@ % \end{macrocode} % Splitting the comma separated list of pairs is done by % \begin{macrocode} -\def\lst@GLI#1,#2\@nil{% +\def\lst@GLI#1,#2\@nil{% GLI: get line interval % \end{macrocode} % The list is split into two parts: the first element (\#1) of the list and % the rest of the list (\#2) which is stored in |\lst@linerange| to be @@ -13911,21 +13976,23 @@ % \begin{macrocode} \def\lst@DefRangeB#1#2{\lst@DefRangeB@#1#2} \def\lst@DefRangeB@#1#2#3#4{% - \lst@CDef{#1{#2}{#3}}#4{}% - {\lst@ifincluderangemarker - \lst@LeaveMode - \let#1#4% - \lst@DefRangeEnd - \lst@InitLstNumber - \else - \@tempcnta\lst@lineno \advance\@tempcnta\@ne - \edef\lst@firstline{\the\@tempcnta\relax}% - \gdef\lst@OnceAtEOL{\let#1#4\lst@DefRangeEnd}% - \lst@InitLstNumber - \fi - \global\let\lst@DefRange\lst@DefRangeEnd - \lst@CArgEmpty}% - \@empty} + \lst@CDef{#1{#2}{#3}}#4{}{% + \lst@ifincluderangemarker + \lst@LeaveMode + \let#1#4% + \lst@DefRangeEnd + \lst@InitLstNumber + \else + \@tempcnta\lst@lineno \advance\@tempcnta\@ne + \edef\lst@firstline{\the\@tempcnta\relax}% + \gdef\lst@OnceAtEOL{\let#1#4\lst@DefRangeEnd}% + \lst@InitLstNumber + \fi + \global\let\lst@DefRange\lst@DefRangeEnd + \lst@CArgEmpty% + }% + \@empty% +} % \end{macrocode} % \end{macro} % @@ -13935,33 +14002,34 @@ % feature does not work with firstnumber}. % \begin{macrocode} \def\lstpatch@labels{% -\gdef\lst@SetFirstNumber{% + \gdef\lst@SetFirstNumber{% \ifx\lst@firstnumber\@undefined \@tempcnta 0\csname\@lst no@\lst@intname\endcsname\relax \ifnum\@tempcnta=\z@ \else \lst@nololtrue \advance\@tempcnta\lst@advancenumber \edef\lst@firstnumber{\the\@tempcnta\relax}% - \fi - \fi}% + \fi% + \fi% + }% } \def\lst@InitLstNumber{% - \global\c@lstnumber\lst@firstnumber - \global\advance\c@lstnumber\lst@advancenumber - \global\advance\c@lstnumber-\lst@advancelstnum - \ifx \lst@firstnumber\c@lstnumber - \global\advance\c@lstnumber-\lst@advancelstnum - \fi% + \global\c@lstnumber\lst@firstnumber + \global\advance\c@lstnumber\lst@advancenumber + \global\advance\c@lstnumber-\lst@advancelstnum + \ifx \lst@firstnumber\c@lstnumber + \global\advance\c@lstnumber-\lst@advancelstnum + \fi% % \end{macrocode} % \lsthelper{Byron~K.~Boulton}{2013/11/21}{line numbers off by one} % reported, that the line numbers are off by one, if they are displayed when % a linerange is given by patterns and |includerangemarker=false| is % set. Adding this test corrects this behaviour. % \begin{macrocode} - \lst@ifincluderangemarker\else% - \global\advance\c@lstnumber by 1% - \fi% - } + \lst@ifincluderangemarker\else% + \global\advance\c@lstnumber by 1% + \fi% +} % \end{macrocode} % % The end-marker is defined if and only if it's not empty. The definition is @@ -13970,28 +14038,28 @@ % version of |\lst@MProcessListing| above. % \begin{macrocode} \def\lst@DefRangeEnd{% - \ifx\lst@rangeend\@empty\else - \expandafter\lst@CArgX\lst@rangeend\relax\lst@DefRangeE - \fi} + \ifx\lst@rangeend\@empty\else + \expandafter\lst@CArgX\lst@rangeend\relax\lst@DefRangeE + \fi} \def\lst@DefRangeE#1#2{\lst@DefRangeE@#1#2} \def\lst@DefRangeE@#1#2#3#4{% - \lst@CDef{#1#2{#3}}#4{}% - {\let#1#4% - \edef\lst@lastline{\the\lst@lineno\relax}% - \lst@DefRangeE@@}% - \@empty} + \lst@CDef{#1#2{#3}}#4{}% + {\let#1#4% + \edef\lst@lastline{\the\lst@lineno\relax}% + \lst@DefRangeE@@}% + \@empty} \def\lst@DefRangeE@@#1\@empty{% - \lst@ifincluderangemarker - #1\lst@XPrintToken - \fi - \lst@LeaveModeToPmode - \lst@BeginDropInput{\lst@Pmode}} + \lst@ifincluderangemarker + #1\lst@XPrintToken + \fi + \lst@LeaveModeToPmode + \lst@BeginDropInput{\lst@Pmode}} \def\lst@LeaveModeToPmode{% - \ifnum\lst@mode=\lst@Pmode - \expandafter\lsthk@EndGroup - \else - \expandafter\egroup\expandafter\lst@LeaveModeToPmode - \fi} + \ifnum\lst@mode=\lst@Pmode + \expandafter\lsthk@EndGroup + \else + \expandafter\egroup\expandafter\lst@LeaveModeToPmode + \fi} % \end{macrocode} % % Sometimes it is good to have two or more excerpts of one program numbered @@ -14056,15 +14124,6 @@ \fi\fi} % \end{macrocode} % -% \begin{lstkey}{nolol} -% is just a key here. We'll use it below, of course. -% \begin{macrocode} -\lst@Key{nolol}{false}[t]{\lstKV@SetIf{#1}\lst@ifnolol} -\def\lst@nololtrue{\let\lst@ifnolol\iftrue} -\let\lst@ifnolol\iffalse % init -% \end{macrocode} -% \end{lstkey} -% % % \subsection{Floats, boxes and captions} % @@ -14114,7 +14173,7 @@ % the counter should be reset at each chapter before the counter is defined, % using the |numberbychapter| key. % \begin{macrocode} -\AtBeginDocument{ +\AtBeginDocument{% \@ifundefined{thechapter}{\let\lst@ifnumberbychapter\iffalse}{} \lst@ifnumberbychapter \newcounter{lstlisting}[chapter] @@ -14182,6 +14241,13 @@ \ifx\lst@@caption\@empty\else~\thelstlisting\fi}% } % \end{macrocode} +% Hardcoding the extension makes it hard to use a different one, e.g., for the +% appendix. \lsthelper{Markus Kohm}{2023/09/05}{extended listings also +% actively supporting tocbasic} suggested to define and use |\ext@lstlisting| +% instead. +% \begin{macrocode} +\def\ext@lstlisting{lol} +% \end{macrocode} % Captions are set only for display style listings -- thanks to % \lsthelper{Peter~L\"offler}{2004/04/24}{pdfTeX warning (dest): name{figure.1} % has been referenced but does not exist} for reporting the bug and to @@ -14215,11 +14281,11 @@ \ifx\lst@caption\@empty \ifx\lst@intname\@empty \else \def\lst@temp{ }% \ifx\lst@intname\lst@temp \else - \addcontentsline{lol}{lstlisting}\lst@name + \addcontentsline{\ext@lstlisting}{lstlisting}\lst@name \fi\fi \fi \else - \addcontentsline{lol}{lstlisting}% + \addcontentsline{\ext@lstlisting}{lstlisting}% {\protect\numberline{\thelstlisting}\lst@@caption}% \fi \fi @@ -14269,8 +14335,10 @@ % Axel proposed the first definition. The other two are default definitions. % They may be adjusted to make \packagename{listings} compatible with other % packages and classes. +% Markus proposed to also define |\@captype|, so his +% |\raggedlstlistingcaption| could be used. % \begin{macrocode} -\def\lst@makecaption{\@makecaption} +\def\lst@makecaption{\def\@captype{lstlisting}\@makecaption} \def\lst@maketitle{\@makecaption\lst@title@dropdelim} \def\lst@title@dropdelim#1{\ignorespaces} % \end{macrocode} @@ -14599,20 +14667,20 @@ % interval to input or not. % \begin{macrocode} \def\lst@MProcessListing{% - \lst@XPrintToken \lst@EOLUpdate \lsthk@InitVarsBOL - \global\advance\lst@lineno\@ne - \ifnum \lst@lineno>\lst@lastline - \lst@ifdropinput \lst@LeaveMode \fi - \ifx\lst@linerange\@empty - \expandafter\expandafter\expandafter\lst@EndProcessListing - \else - \lst@interrange - \lst@GetLineInterval - \expandafter\expandafter\expandafter\lst@SkipToFirst - \fi - \else - \expandafter\lst@BOLGobble - \fi} + \lst@XPrintToken \lst@EOLUpdate \lsthk@InitVarsBOL + \global\advance\lst@lineno\@ne + \ifnum \lst@lineno>\lst@lastline + \lst@ifdropinput \lst@LeaveMode \fi + \ifx\lst@linerange\@empty + \expandafter\expandafter\expandafter\lst@EndProcessListing + \else + \lst@interrange + \lst@GetLineInterval + \expandafter\expandafter\expandafter\lst@SkipToFirst + \fi + \else + \expandafter\lst@BOLGobble + \fi} % \end{macrocode} % \end{macro} % @@ -14745,16 +14813,18 @@ % \begin{macrocode} \lst@UserCommand\lstlistoflistings{\bgroup \let\contentsname\lstlistlistingname - \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}% + \let\lst@temp\@starttoc + \def\@starttoc##1{\lst@temp{\ext@lstlisting}}% \tableofcontents \egroup} % \end{macrocode} -% For KOMA-script classes, we define it a la KOMA thanks to a bug report by +% For \packagename{KOMA}-script classes, we define it a la \packagename{KOMA} +% thanks to a bug report by % \lsthelper{Tino~Langer}{2003/11/01}{koma-script's listsleft option does not % affect lol}. \lsthelper{Markus~Kohm}{2006/08/12}{koma-script support is % broken} suggested a much-improved version of this, which also works with % the \packagename{float} package. The following few comments are from Markus. % -% Make use of |\float@listhead| if defined (e.g. using float or KOMA-Script) +% Make use of |\float@listhead| if defined (e.g. using float) % \begin{macrocode} \@ifundefined{float@listhead}{}{% \renewcommand*{\lstlistoflistings}{% @@ -14775,7 +14845,7 @@ % needed), |\parfillskip| to 0pt plus 1fil (should be!). % \begin{macrocode} \parskip\z@\parindent\z@\parfillskip \z@ \@plus 1fil% - \@starttoc{lol}% + \@starttoc{\ext@lstlisting}% % \end{macrocode} % Switch back to twocolumn (see above). % \begin{macrocode} @@ -14786,6 +14856,16 @@ }% } % \end{macrocode} +% Make use of package tocbasic if loaded: +% \begin{macrocode} +\AtBeginDocument{% + \@ifpackageloaded{tocbasic}{% + \addtotoclist[float]{\ext@lstlisting}% + \renewcommand*{\lstlistoflistings}{\listoftoc[{\lstlistlistingname}]{lol}}% + \DeclareTOCStyleEntry[level=1,numwidth=2.3em,indent=1.5em]{default}{lstlisting}% + }{}% +} +% \end{macrocode} % \end{macro} % % \begin{macro}{\float@addtolists} @@ -14804,12 +14884,15 @@ % to Markus for the advice. % \begin{macrocode} \AtBeginDocument{% - \@ifundefined{float@addtolists}% - {\gdef\float@addtolists#1{\addtocontents{lol}{#1}}}% - {\let\orig@float@addtolists\float@addtolists - \gdef\float@addtolists#1{% - \addtocontents{lol}{#1}% - \orig@float@addtolists{#1}}}% + \@ifundefined{KOMAClassName}{% + \@ifundefined{float@addtolists}{% + \gdef\float@addtolists#1{\addtocontents{\ext@lstlisting}{#1}}% + }{% + \let\orig@float@addtolists\float@addtolists + \gdef\float@addtolists#1{% + \addtocontents{\ext@lstlisting}{#1}% + \orig@float@addtolists{#1}}}% + }{}% }% % \end{macrocode} % \end{macro} @@ -14851,16 +14934,16 @@ % \ref{uListingsArguments} on \pageref{uListingsArguments} and proposed % another solution which in turn broke the code needed by Luc: %\begin{verbatim} -% % \renewcommand\lstinline[1][]{% -% % \leavevmode\bgroup % \hbox\bgroup --> \bgroup -% % \def\lst@boxpos{b}% -% % \lsthk@PreSet\lstset{flexiblecolumns,#1}% -% % \lsthk@TextStyle -% % \ifnum\iffalse{\fi`}=\z@\fi -% % \@ifnextchar\bgroup{% -% % \ifnum`{=\z@}\fi% -% % \afterassignment\lst@InlineG \let\@let@token}{% -% % \ifnum`{=\z@}\fi\lstinline@}} +% \renewcommand\lstinline[1][]{% +% \leavevmode\bgroup % \hbox\bgroup --> \bgroup +% \def\lst@boxpos{b}% +% \lsthk@PreSet\lstset{flexiblecolumns,#1}% +% \lsthk@TextStyle +% \ifnum\iffalse{\fi`}=\z@\fi +% \@ifnextchar\bgroup{% +% \ifnum`{=\z@}\fi% +% \afterassignment\lst@InlineG \let\@let@token}{% +% \ifnum`{=\z@}\fi\lstinline@}} %\end{verbatim} % So finally the old code comes back and the people, who need a % |\lstinline| with braces, should use the workaround from section @@ -15449,23 +15532,24 @@ % This is a derivation of \LaTeX's |\@xargdef|. We expand the submacro's name, % use |\gdef| instead of |\def|, and hard code a kind of |\@protected@testopt|. % \begin{macrocode} -\def\lstenv@xargdef#1{ - \expandafter\lstenv@xargdef@\csname\string#1\endcsname#1} +\def\lstenv@xargdef#1{% + \expandafter\lstenv@xargdef@\csname\string#1\endcsname#1} \def\lstenv@xargdef@#1#2[#3][#4]#5{% \@ifdefinable#2{% - \gdef#2{% - \ifx\protect\@typeset@protect - \expandafter\lstenv@testopt - \else - \@x@protect#2% - \fi - #1% - {#4}}% - \@yargdef - #1% - \tw@ - {#3}% - {#5}}} + \gdef#2{% + \ifx\protect\@typeset@protect + \expandafter\lstenv@testopt + \else + \@x@protect#2% + \fi + #1% + {#4}}% + \@yargdef% + #1% + \tw@% + {#3}% + {#5}}% +} % \end{macrocode} % \end{macro} % @@ -15763,7 +15847,7 @@ % \end{macro} % % -% \subsection{Extensions to \textsf{doc}} +% \subsection{Extensions to \packagename{doc}} % % \begin{macro}{\m@cro@} % We need a slight modification of \packagename{doc}'s internal macro. @@ -16453,7 +16537,7 @@ % \end{aspect} % % -% \subsection{\textsf{fancyvrb}} +% \subsection{\packagename{fancyvrb}} % % \lsthelper{Denis~Girou}{1998/07/26}{fancyvrb} asked whether % \packagename{fancyvrb} and \packagename{listings} could work together. @@ -16711,7 +16795,7 @@ % \endgroup % % -% \subsection{\textsf{LGrind}} +% \subsection{\packagename{LGrind}} % % \begin{aspect}{lgrind} % \begin{macro}{\lst@LGGetNames} @@ -16969,7 +17053,7 @@ % \end{aspect} % % -% \subsection{\textsf{hyperref}} +% \subsection{\packagename{hyperref}} % % \begin{aspect}{hyper} % \begin{macrocode} @@ -17074,10 +17158,10 @@ % is wrong. So we reset the catcodes to the correct values before loading % the files: % \begin{macrocode} +%\lst@ReportAllocs \lst@RestoreCatcodes% \InputIfFileExists{listings.cfg}{}{} \InputIfFileExists{lstlocal.cfg}{}{} -%\lst@ReportAllocs % \end{macrocode} % \begin{macrocode} % @@ -17204,10 +17288,22 @@ % \item the configuration files |listings.cfg| and |lstlocal.cfg| are read % with the correct catcode % \item some documentation and layout enhancements. +% \item[1.10] from 2024/02/15 on +% \item usage of |tocbasic| if loaded to improve compatibility with +% KOMA-Script and also enhance functionality. % \end{itemize} % \endgroup % % % \Finale % +% \begin{macrocode} +%<*dev/null> +% \end{macrocode} +%%% Local Variables: +%%% ispell-local-dictionary: "english" +%%% End: +% \begin{macrocode} +%<*dev/null> +% \end{macrocode} \endinput diff --git a/Master/texmf-dist/source/latex/listings/listings.ins b/Master/texmf-dist/source/latex/listings/listings.ins index aa451ee768b..e869c3695b1 100644 --- a/Master/texmf-dist/source/latex/listings/listings.ins +++ b/Master/texmf-dist/source/latex/listings/listings.ins @@ -22,12 +22,22 @@ % % generate base package % +% the following guards for the conditional inclusion of code are defined: +% - 0.21: code valid before version 0.21 +% - config: code used for producing the listings.cfg file +% - doc: code used for producing the lstdoc.cfg file +% - driver: code used for producing the documentation of listings.dtx +% - info: additional informational code for the development of listings.dtx +% - install: code used for producing the lstdrvrs.ins file +% - kernel: the main code of the listings.sty +% - patch: code used for producing the at the moment unused lstpatch.sty file \generate{ \file{listings.sty}{\from{listings.dtx}{kernel}} \file{lstmisc.sty}{\from{listings.dtx}{misc,0.21}} \file{lstdoc.sty}{\from{listings.dtx}{doc}} \file{lstdrvrs.ins}{\from{lstdrvrs.dtx}{install}} \file{listings.cfg}{\from{lstdrvrs.dtx}{config}} + \file{lstpatch.sty}{\from{listings.dtx}{patch}} \file{ltxdoc.cfg}{\from{listings.dtx}{ltx}} } % diff --git a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx index 1d2f4cc5a2b..02dc1ea88ac 100644 --- a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx +++ b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx @@ -1,6 +1,6 @@ % \iffalse % -% $Id$ +% Time-stamp: <2024-02-17 18:25:08 ax006ho> % %<*driver> \documentclass{ltxdoc} @@ -33,7 +33,7 @@ % \title{Language, Style and Format drivers\\ for \textsf{Listings}\\ % {\large by Carsten Heinz and individual authors:}} % \author{\InputIfFileExists{lstdrvrs.tmp}{}{}} -% \date{2023/02/27\enspace\enspace Version 1.9\ \box\abstractbox} +% \date{2024/02/21\enspace\enspace Version 1.10\ \box\abstractbox} % % \ifhyper % \hypersetup{pdftitle={Language, Style and Format drivers for the @@ -137,7 +137,7 @@ % \endgroup % We mainly define default dialects. % \begin{macrocode} -\ProvidesFile{listings.cfg}[2023/02/27 1.9 listings configuration] +\ProvidesFile{listings.cfg}[2024/02/21 1.10 listings configuration] \def\lstlanguagefiles {lstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty} \lstset{defaultdialect=[R/3 6.10]ABAP, @@ -184,7 +184,7 @@ %<+hansl-prf>\ProvidesFile{listings-hansl.prf} %<+lua-prf>\ProvidesFile{listings-lua.prf} %<+python-prf>\ProvidesFile{listings-python.prf} -%<-config> [2023/02/27 1.9 listings language file] +%<-config> [2024/02/21 1.10 listings language file] % \end{macrocode} % % @@ -1743,7 +1743,13 @@ CO_MAX, CO_MIN, CO_SUM, CO_REDUCE, ATOMIC_ADD, ATOMIC_AND, ATOMIC_OR, ATOMIC_XOR, ATOMIC_FETCH_ADD, ATOMIC_FETCH_AND, ATOMIC_FETCH_OR, ATOMIC_FETCH_XOR, ATOMIC_FETCH_CAS, IEEE_GET_MODES, IEEE_SET_MODES, - IEEE_FMA, IEEE_SIGNBIT, IEEE_INT, IEEE_REM, IEEE_MAX_NUM, IEEE_MAX_NUM_MAG, IEEE_MIN_NUM, IEEE_MAX_NUM_MAG, IEEE_NEXT_DOWN, IEEE_NEXT_UP, IEEE_SUPPORT_DATATYPE, IEEE_QUIET_EQ, IEEE_QUIET_GE, IEEE_QUIET_GT, IEEE_QUIET_LE, IEEE_QUIET_LT, IEEE_QUIET_NE, IEEE_SIGNALING_EQ, IEEE_SIGNALING_GE, IEEE_SIGNALING_GT, IEEE_SIGNALING_LE, IEEE_SIGNALING_LT, IEEE_SIGNALING_NE}% + IEEE_FMA, IEEE_SIGNBIT, IEEE_INT, IEEE_REM, IEEE_MAX_NUM, + IEEE_MAX_NUM_MAG, + IEEE_MIN_NUM, IEEE_MAX_NUM_MAG, IEEE_NEXT_DOWN, IEEE_NEXT_UP, + IEEE_SUPPORT_DATATYPE, IEEE_QUIET_EQ, IEEE_QUIET_GE, IEEE_QUIET_GT, + IEEE_QUIET_LE, IEEE_QUIET_LT, IEEE_QUIET_NE, IEEE_SIGNALING_EQ, + IEEE_SIGNALING_GE, IEEE_SIGNALING_GT, IEEE_SIGNALING_LE, + IEEE_SIGNALING_LT, IEEE_SIGNALING_NE}% }% % \end{macrocode} % @@ -7917,11 +7923,11 @@ morecomment=[l]!% %% classic rexx listings definition %% by Patrick TJ McPhee %% -\lst@definelanguage{Rexx} - {morekeywords={address,arg,call,do,drop,else,end,exit,if,iterate,% - interpret,leave,nop,numeric,options,otherwise,parse,% - procedure,pull,push,queue,return,say,signal,then,to,% - trace,when},% +\lst@definelanguage{Rexx}{% + morekeywords={address,arg,call,do,drop,else,end,exit,if,interpret,% + iterate,leave,nop,numeric,options,otherwise,parse,% + procedure,pull,push,queue,return,say,select,signal,then,% + to,trace,when},% sensitive=false,% morecomment=[n]{/*}{*/},% morestring=[d]{'},% @@ -7953,18 +7959,18 @@ morecomment=[l]!% external,for,form,fuzz,halt,labels,intermediates,negative,normal,novalue,% on,off,results,scan,scientific,select,source,stream,syntax,until,upper,% value,var,version,while,with},% - ndkeywords={abbrev,abs,address,bitand,bitor,bitxor,center,centre,% + morekeywords=[2]{abbrev,abs,address,bitand,bitor,bitxor,center,centre,% compare,copies,c2d,c2x,datatype,date,delstr,delword,diag,diagrc,% d2c,d2x,errortext,externals,find,format,index,insert,justify,% - lastpos,left,length,linesize,max,min,overlay,pos,queued,random,% - reverse,rigth,sign,sourceline,space,storage,strip,substr,subword,% - symbol,time,translate,trunc,userid,value,verify,word,wordindex,% - wordlength,words,xrange,x2c,x2d},% + lastpos,left,length,linein,lineout,lines,linesize,max,min,overlay,% + pos,queued,random,reverse,rigth,sign,sourceline,space,storage,% + strip,substr,subword,symbol,time,translate,trunc,userid,value,verify,% + word,wordindex,wordlength,words,xrange,x2c,x2d},% + morekeywords=[3]{result,rc,self,sigl,super},% sensitive=false,% morestring=[d]",% morestring=[d]',% morecomment=[s]{/*}{*/},% - alsoletter={:},% }[keywords,comments,strings]% % \end{macrocode} % \begin{macrocode} @@ -7983,8 +7989,12 @@ morecomment=[l]!% %% %% ooREXX keywords (http://www.oorexx.org/) \lst@definelanguage[]{OORexx}[VM/XA]{Rexx}{% - morekeywords={::class, ::method, ::attribute},% -} + morekeywords={::annotate, ::attribute, ::class, ::constant, ::method,% + ::options, ::requires, ::resource, ::routine,% + forward, guard, local, loop, raise, strict,% + },% + alsoletter={:},% +}[keywords,comments,strings] % \end{macrocode} % \begin{macrocode} % diff --git a/Master/texmf-dist/source/latex/listings/lstdrvrs.ins b/Master/texmf-dist/source/latex/listings/lstdrvrs.ins index a6ab075f364..2489a4deb40 100644 --- a/Master/texmf-dist/source/latex/listings/lstdrvrs.ins +++ b/Master/texmf-dist/source/latex/listings/lstdrvrs.ins @@ -56,7 +56,7 @@ } \endbatchfile - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \endinput %% %% End of file `lstdrvrs.ins'. diff --git a/Master/texmf-dist/tex/latex/listings/listings-acm.prf b/Master/texmf-dist/tex/latex/listings/listings-acm.prf index 336b353ed2c..e7fd45af68d 100644 --- a/Master/texmf-dist/tex/latex/listings/listings-acm.prf +++ b/Master/texmf-dist/tex/latex/listings/listings-acm.prf @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{listings-acm.prf} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \usepackage[rgb, x11names]{xcolor} \definecolor{Comments}{rgb}{0.00,0.50,0.00} diff --git a/Master/texmf-dist/tex/latex/listings/listings-bash.prf b/Master/texmf-dist/tex/latex/listings/listings-bash.prf index 88eb4b51124..765a2da9e23 100644 --- a/Master/texmf-dist/tex/latex/listings/listings-bash.prf +++ b/Master/texmf-dist/tex/latex/listings/listings-bash.prf @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{listings-bash.prf} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \usepackage[rgb, x11names]{xcolor} \lstset{% diff --git a/Master/texmf-dist/tex/latex/listings/listings-fortran.prf b/Master/texmf-dist/tex/latex/listings/listings-fortran.prf index b54138e885c..d6f6f298a5b 100644 --- a/Master/texmf-dist/tex/latex/listings/listings-fortran.prf +++ b/Master/texmf-dist/tex/latex/listings/listings-fortran.prf @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{listings-fortran.prf} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \usepackage[rgb, x11names]{xcolor} \lstset{% diff --git a/Master/texmf-dist/tex/latex/listings/listings-hansl.prf b/Master/texmf-dist/tex/latex/listings/listings-hansl.prf index 86006d672c4..c4511d59929 100644 --- a/Master/texmf-dist/tex/latex/listings/listings-hansl.prf +++ b/Master/texmf-dist/tex/latex/listings/listings-hansl.prf @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{listings-hansl.prf} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \usepackage[rgb, x11names]{xcolor} \lstdefinestyle{hanslbw}{% diff --git a/Master/texmf-dist/tex/latex/listings/listings-lua.prf b/Master/texmf-dist/tex/latex/listings/listings-lua.prf index 7c58d150681..dbdda8dcdb6 100644 --- a/Master/texmf-dist/tex/latex/listings/listings-lua.prf +++ b/Master/texmf-dist/tex/latex/listings/listings-lua.prf @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{listings-lua.prf} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \usepackage[rgb, x11names]{xcolor} \lstdefinestyle{Lua}{% language=[5.2]Lua, diff --git a/Master/texmf-dist/tex/latex/listings/listings-python.prf b/Master/texmf-dist/tex/latex/listings/listings-python.prf index a9e33f26c02..9990947994e 100644 --- a/Master/texmf-dist/tex/latex/listings/listings-python.prf +++ b/Master/texmf-dist/tex/latex/listings/listings-python.prf @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{listings-python.prf} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \usepackage{xcolor} \usepackage{textcomp} diff --git a/Master/texmf-dist/tex/latex/listings/listings.cfg b/Master/texmf-dist/tex/latex/listings/listings.cfg index 0818e556cfd..f1a7a9651e0 100644 --- a/Master/texmf-dist/tex/latex/listings/listings.cfg +++ b/Master/texmf-dist/tex/latex/listings/listings.cfg @@ -21,7 +21,7 @@ %% Send comments and ideas on the package, error reports and additional %% programming languages to Jobst Hoffmann at . %% -\ProvidesFile{listings.cfg}[2023/02/27 1.9 listings configuration] +\ProvidesFile{listings.cfg}[2024/02/21 1.10 listings configuration] \def\lstlanguagefiles {lstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty} \lstset{defaultdialect=[R/3 6.10]ABAP, diff --git a/Master/texmf-dist/tex/latex/listings/listings.sty b/Master/texmf-dist/tex/latex/listings/listings.sty index 1070e8a713e..172b369c4ac 100644 --- a/Master/texmf-dist/tex/latex/listings/listings.sty +++ b/Master/texmf-dist/tex/latex/listings/listings.sty @@ -16,8 +16,8 @@ %% Send comments and ideas on the package, error reports and additional %% programming languages to Jobst Hoffmann at . %% -\def\filedate{2023/02/27} -\def\fileversion{1.9} +\def\filedate{2024/02/21} +\def\fileversion{1.10} \NeedsTeXFormat{LaTeX2e} \AtEndOfPackage{\ProvidesPackage{listings} [\filedate\space\fileversion\space(Carsten Heinz)]} @@ -721,7 +721,7 @@ \advance\@tempcnta\@ne \edef\lst@maxempty{\the\@tempcnta\relax}% \let\lst@ifpreservenumber\lst@if} -\def\lst@DoNewLines{ +\def\lst@DoNewLines{% \@whilenum\lst@newlines>\lst@maxempty \do {\lst@ifpreservenumber \lsthk@OnEmptyLine @@ -933,6 +933,7 @@ \lst@ProcessOther {"5C}{\lst@ttfamily{\char92}\textbackslash} \lst@ProcessOther {"5E}\textasciicircum \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}\textunderscore} + % or \char"5F \lst@ProcessOther {"60}{\lst@ifupquote \textasciigrave \else \char96\relax \fi} \lst@ProcessOther {"7B}{\lst@ttfamily{\char123}\textbraceleft} @@ -1405,6 +1406,9 @@ \def\lst@lastline{9999999\relax} \let\lst@linerange\@empty } +\lst@Key{nolol}{false}[t]{\lstKV@SetIf{#1}\lst@ifnolol} +\def\lst@nololtrue{\let\lst@ifnolol\iftrue} +\let\lst@ifnolol\iffalse % init \lst@Key{linerange}\relax{\lstKV@OptArg[]{#1}{% \def\lst@interrange{##1}\def\lst@linerange{##2,}}} \lst@Key{consecutivenumbers}{true}[t]{% @@ -1427,7 +1431,7 @@ \lst@GetLineInterval% }% \def\lst@GetLineInterval{\expandafter\lst@GLI\lst@linerange\@nil} -\def\lst@GLI#1,#2\@nil{% +\def\lst@GLI#1,#2\@nil{% GLI: get line interval \def\lst@linerange{#2}\lst@GLI@#1--\@nil% } \def\lst@GLI@#1-#2-#3\@nil{% @@ -1478,66 +1482,69 @@ \lst@AddToHookExe{DeInit}{\global\let\lst@DefRange\@empty} \def\lst@DefRangeB#1#2{\lst@DefRangeB@#1#2} \def\lst@DefRangeB@#1#2#3#4{% - \lst@CDef{#1{#2}{#3}}#4{}% - {\lst@ifincluderangemarker - \lst@LeaveMode - \let#1#4% - \lst@DefRangeEnd - \lst@InitLstNumber - \else - \@tempcnta\lst@lineno \advance\@tempcnta\@ne - \edef\lst@firstline{\the\@tempcnta\relax}% - \gdef\lst@OnceAtEOL{\let#1#4\lst@DefRangeEnd}% - \lst@InitLstNumber - \fi - \global\let\lst@DefRange\lst@DefRangeEnd - \lst@CArgEmpty}% - \@empty} + \lst@CDef{#1{#2}{#3}}#4{}{% + \lst@ifincluderangemarker + \lst@LeaveMode + \let#1#4% + \lst@DefRangeEnd + \lst@InitLstNumber + \else + \@tempcnta\lst@lineno \advance\@tempcnta\@ne + \edef\lst@firstline{\the\@tempcnta\relax}% + \gdef\lst@OnceAtEOL{\let#1#4\lst@DefRangeEnd}% + \lst@InitLstNumber + \fi + \global\let\lst@DefRange\lst@DefRangeEnd + \lst@CArgEmpty% + }% + \@empty% +} \def\lstpatch@labels{% -\gdef\lst@SetFirstNumber{% + \gdef\lst@SetFirstNumber{% \ifx\lst@firstnumber\@undefined \@tempcnta 0\csname\@lst no@\lst@intname\endcsname\relax \ifnum\@tempcnta=\z@ \else \lst@nololtrue \advance\@tempcnta\lst@advancenumber \edef\lst@firstnumber{\the\@tempcnta\relax}% - \fi - \fi}% + \fi% + \fi% + }% } \def\lst@InitLstNumber{% - \global\c@lstnumber\lst@firstnumber - \global\advance\c@lstnumber\lst@advancenumber - \global\advance\c@lstnumber-\lst@advancelstnum - \ifx \lst@firstnumber\c@lstnumber - \global\advance\c@lstnumber-\lst@advancelstnum - \fi% - \lst@ifincluderangemarker\else% - \global\advance\c@lstnumber by 1% - \fi% - } + \global\c@lstnumber\lst@firstnumber + \global\advance\c@lstnumber\lst@advancenumber + \global\advance\c@lstnumber-\lst@advancelstnum + \ifx \lst@firstnumber\c@lstnumber + \global\advance\c@lstnumber-\lst@advancelstnum + \fi% + \lst@ifincluderangemarker\else% + \global\advance\c@lstnumber by 1% + \fi% +} \def\lst@DefRangeEnd{% - \ifx\lst@rangeend\@empty\else - \expandafter\lst@CArgX\lst@rangeend\relax\lst@DefRangeE - \fi} + \ifx\lst@rangeend\@empty\else + \expandafter\lst@CArgX\lst@rangeend\relax\lst@DefRangeE + \fi} \def\lst@DefRangeE#1#2{\lst@DefRangeE@#1#2} \def\lst@DefRangeE@#1#2#3#4{% - \lst@CDef{#1#2{#3}}#4{}% - {\let#1#4% - \edef\lst@lastline{\the\lst@lineno\relax}% - \lst@DefRangeE@@}% - \@empty} + \lst@CDef{#1#2{#3}}#4{}% + {\let#1#4% + \edef\lst@lastline{\the\lst@lineno\relax}% + \lst@DefRangeE@@}% + \@empty} \def\lst@DefRangeE@@#1\@empty{% - \lst@ifincluderangemarker - #1\lst@XPrintToken - \fi - \lst@LeaveModeToPmode - \lst@BeginDropInput{\lst@Pmode}} + \lst@ifincluderangemarker + #1\lst@XPrintToken + \fi + \lst@LeaveModeToPmode + \lst@BeginDropInput{\lst@Pmode}} \def\lst@LeaveModeToPmode{% - \ifnum\lst@mode=\lst@Pmode - \expandafter\lsthk@EndGroup - \else - \expandafter\egroup\expandafter\lst@LeaveModeToPmode - \fi} + \ifnum\lst@mode=\lst@Pmode + \expandafter\lsthk@EndGroup + \else + \expandafter\egroup\expandafter\lst@LeaveModeToPmode + \fi} \def\lst@DisplayConsecutiveNumbersOrNot{% \lst@ifconsecutivenumbers\else% \c@lstnumber=\numexpr-1+\lst@lineno @@ -1576,9 +1583,6 @@ \ifnum`#1>47\relax \ifnum`#1>57\relax\else \let\lst@next\@firstoftwo \fi\fi} -\lst@Key{nolol}{false}[t]{\lstKV@SetIf{#1}\lst@ifnolol} -\def\lst@nololtrue{\let\lst@ifnolol\iftrue} -\let\lst@ifnolol\iffalse % init \lst@Key{captionpos}{t}{\def\lst@captionpos{#1}} \lst@Key{abovecaptionskip}\smallskipamount{% \def\lst@abovecaption{#1}} @@ -1592,7 +1596,7 @@ \lst@AddToHookExe{TextStyle} {\let\lst@caption\@empty \let\lst@@caption\@empty \let\lst@title\@empty \let\lst@label\@empty} -\AtBeginDocument{ +\AtBeginDocument{% \@ifundefined{thechapter}{\let\lst@ifnumberbychapter\iffalse}{} \lst@ifnumberbychapter \newcounter{lstlisting}[chapter] @@ -1626,6 +1630,7 @@ {\lstlistingnamestyle\lstlistingname \ifx\lst@@caption\@empty\else~\thelstlisting\fi}% } +\def\ext@lstlisting{lol} \def\lst@MakeCaption#1{% \lst@ifdisplaystyle \ifx #1t \allowbreak% @@ -1640,11 +1645,11 @@ \ifx\lst@caption\@empty \ifx\lst@intname\@empty \else \def\lst@temp{ }% \ifx\lst@intname\lst@temp \else - \addcontentsline{lol}{lstlisting}\lst@name + \addcontentsline{\ext@lstlisting}{lstlisting}\lst@name \fi\fi \fi \else - \addcontentsline{lol}{lstlisting}% + \addcontentsline{\ext@lstlisting}{lstlisting}% {\protect\numberline{\thelstlisting}\lst@@caption}% \fi \fi @@ -1666,7 +1671,7 @@ \endgroup}{}% \fi \fi} -\def\lst@makecaption{\@makecaption} +\def\lst@makecaption{\def\@captype{lstlisting}\@makecaption} \def\lst@maketitle{\@makecaption\lst@title@dropdelim} \def\lst@title@dropdelim#1{\ignorespaces} \AtBeginDocument{% @@ -1828,20 +1833,20 @@ \fi} \def\lst@EOLUpdate{\lsthk@EOL \lsthk@InitVarsEOL} \def\lst@MProcessListing{% - \lst@XPrintToken \lst@EOLUpdate \lsthk@InitVarsBOL - \global\advance\lst@lineno\@ne - \ifnum \lst@lineno>\lst@lastline - \lst@ifdropinput \lst@LeaveMode \fi - \ifx\lst@linerange\@empty - \expandafter\expandafter\expandafter\lst@EndProcessListing - \else - \lst@interrange - \lst@GetLineInterval - \expandafter\expandafter\expandafter\lst@SkipToFirst - \fi - \else - \expandafter\lst@BOLGobble - \fi} + \lst@XPrintToken \lst@EOLUpdate \lsthk@InitVarsBOL + \global\advance\lst@lineno\@ne + \ifnum \lst@lineno>\lst@lastline + \lst@ifdropinput \lst@LeaveMode \fi + \ifx\lst@linerange\@empty + \expandafter\expandafter\expandafter\lst@EndProcessListing + \else + \lst@interrange + \lst@GetLineInterval + \expandafter\expandafter\expandafter\lst@SkipToFirst + \fi + \else + \expandafter\lst@BOLGobble + \fi} \let\lst@EndProcessListing\endinput \lst@Key{gobble}{0}{\def\lst@gobble{#1}} \def\lst@BOLGobble{% @@ -1887,7 +1892,8 @@ \lst@UserCommand\lstlistlistingname{Listings} \lst@UserCommand\lstlistoflistings{\bgroup \let\contentsname\lstlistlistingname - \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}% + \let\lst@temp\@starttoc + \def\@starttoc##1{\lst@temp{\ext@lstlisting}}% \tableofcontents \egroup} \@ifundefined{float@listhead}{}{% \renewcommand*{\lstlistoflistings}{% @@ -1901,7 +1907,7 @@ }% \float@listhead{\lstlistlistingname}% \parskip\z@\parindent\z@\parfillskip \z@ \@plus 1fil% - \@starttoc{lol}% + \@starttoc{\ext@lstlisting}% \@ifundefined{@restonecoltrue}{}{% \if@restonecol\twocolumn\fi }% @@ -1909,12 +1915,22 @@ }% } \AtBeginDocument{% - \@ifundefined{float@addtolists}% - {\gdef\float@addtolists#1{\addtocontents{lol}{#1}}}% - {\let\orig@float@addtolists\float@addtolists - \gdef\float@addtolists#1{% - \addtocontents{lol}{#1}% - \orig@float@addtolists{#1}}}% + \@ifpackageloaded{tocbasic}{% + \addtotoclist[float]{\ext@lstlisting}% + \renewcommand*{\lstlistoflistings}{\listoftoc[{\lstlistlistingname}]{lol}}% + \DeclareTOCStyleEntry[level=1,numwidth=2.3em,indent=1.5em]{default}{lstlisting}% + }{}% +} +\AtBeginDocument{% + \@ifundefined{KOMAClassName}{% + \@ifundefined{float@addtolists}{% + \gdef\float@addtolists#1{\addtocontents{\ext@lstlisting}{#1}}% + }{% + \let\orig@float@addtolists\float@addtolists + \gdef\float@addtolists#1{% + \addtocontents{\ext@lstlisting}{#1}% + \orig@float@addtolists{#1}}}% + }{}% }% \newcommand\lstinline[1][]{% \leavevmode\bgroup % \hbox\bgroup --> \bgroup @@ -2201,23 +2217,24 @@ \let\lst@arg\@empty \lst@XConvert{end}\{\}\@nil \expandafter\@tempa\lst@arg \let\lst@insertargs\@empty -\def\lstenv@xargdef#1{ - \expandafter\lstenv@xargdef@\csname\string#1\endcsname#1} +\def\lstenv@xargdef#1{% + \expandafter\lstenv@xargdef@\csname\string#1\endcsname#1} \def\lstenv@xargdef@#1#2[#3][#4]#5{% \@ifdefinable#2{% - \gdef#2{% - \ifx\protect\@typeset@protect - \expandafter\lstenv@testopt - \else - \@x@protect#2% - \fi - #1% - {#4}}% - \@yargdef - #1% - \tw@ - {#3}% - {#5}}} + \gdef#2{% + \ifx\protect\@typeset@protect + \expandafter\lstenv@testopt + \else + \@x@protect#2% + \fi + #1% + {#4}}% + \@yargdef% + #1% + \tw@% + {#3}% + {#5}}% +} \long\def\lstenv@testopt#1#2{% \@ifnextchar[{\catcode\active5\relax \lstenv@testopt@#1}% {#1[{#2}]}} diff --git a/Master/texmf-dist/tex/latex/listings/lstdoc.sty b/Master/texmf-dist/tex/latex/listings/lstdoc.sty index 00dfb8ee9d9..c5927734e15 100644 --- a/Master/texmf-dist/tex/latex/listings/lstdoc.sty +++ b/Master/texmf-dist/tex/latex/listings/lstdoc.sty @@ -6,8 +6,8 @@ %% %% listings.dtx (with options: `doc') %% -\def\filedate{2023/02/27} -\def\fileversion{1.9} +\def\filedate{2024/02/21} +\def\fileversion{1.10} \ProvidesPackage{lstdoc} [\filedate\space\fileversion\space(Carsten Heinz)] \let\lstdoc@currversion\fileversion diff --git a/Master/texmf-dist/tex/latex/listings/lstlang1.sty b/Master/texmf-dist/tex/latex/listings/lstlang1.sty index c46f0f92db5..7cb1435295f 100644 --- a/Master/texmf-dist/tex/latex/listings/lstlang1.sty +++ b/Master/texmf-dist/tex/latex/listings/lstlang1.sty @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{lstlang1.sty} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] %% %% ACSL definition (c) 2000 by Andreas Matthias %% @@ -319,7 +319,13 @@ CO_MAX, CO_MIN, CO_SUM, CO_REDUCE, ATOMIC_ADD, ATOMIC_AND, ATOMIC_OR, ATOMIC_XOR, ATOMIC_FETCH_ADD, ATOMIC_FETCH_AND, ATOMIC_FETCH_OR, ATOMIC_FETCH_XOR, ATOMIC_FETCH_CAS, IEEE_GET_MODES, IEEE_SET_MODES, - IEEE_FMA, IEEE_SIGNBIT, IEEE_INT, IEEE_REM, IEEE_MAX_NUM, IEEE_MAX_NUM_MAG, IEEE_MIN_NUM, IEEE_MAX_NUM_MAG, IEEE_NEXT_DOWN, IEEE_NEXT_UP, IEEE_SUPPORT_DATATYPE, IEEE_QUIET_EQ, IEEE_QUIET_GE, IEEE_QUIET_GT, IEEE_QUIET_LE, IEEE_QUIET_LT, IEEE_QUIET_NE, IEEE_SIGNALING_EQ, IEEE_SIGNALING_GE, IEEE_SIGNALING_GT, IEEE_SIGNALING_LE, IEEE_SIGNALING_LT, IEEE_SIGNALING_NE}% + IEEE_FMA, IEEE_SIGNBIT, IEEE_INT, IEEE_REM, IEEE_MAX_NUM, + IEEE_MAX_NUM_MAG, + IEEE_MIN_NUM, IEEE_MAX_NUM_MAG, IEEE_NEXT_DOWN, IEEE_NEXT_UP, + IEEE_SUPPORT_DATATYPE, IEEE_QUIET_EQ, IEEE_QUIET_GE, IEEE_QUIET_GT, + IEEE_QUIET_LE, IEEE_QUIET_LT, IEEE_QUIET_NE, IEEE_SIGNALING_EQ, + IEEE_SIGNALING_GE, IEEE_SIGNALING_GT, IEEE_SIGNALING_LE, + IEEE_SIGNALING_LT, IEEE_SIGNALING_NE}% }% \lst@definelanguage[08]{Fortran}[03]{Fortran}{% morekeywords={ALL, BLOCK, CODIMENSION, CONCURRENT, CONTIGUOUS, CRITICAL,% diff --git a/Master/texmf-dist/tex/latex/listings/lstlang2.sty b/Master/texmf-dist/tex/latex/listings/lstlang2.sty index e76590cb44a..3b2358b6fd3 100644 --- a/Master/texmf-dist/tex/latex/listings/lstlang2.sty +++ b/Master/texmf-dist/tex/latex/listings/lstlang2.sty @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{lstlang2.sty} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] %% %% Abap definition by Knut Lickert %% @@ -1614,11 +1614,11 @@ %% classic rexx listings definition %% by Patrick TJ McPhee %% -\lst@definelanguage{Rexx} - {morekeywords={address,arg,call,do,drop,else,end,exit,if,iterate,% - interpret,leave,nop,numeric,options,otherwise,parse,% - procedure,pull,push,queue,return,say,signal,then,to,% - trace,when},% +\lst@definelanguage{Rexx}{% + morekeywords={address,arg,call,do,drop,else,end,exit,if,interpret,% + iterate,leave,nop,numeric,options,otherwise,parse,% + procedure,pull,push,queue,return,say,select,signal,then,% + to,trace,when},% sensitive=false,% morecomment=[n]{/*}{*/},% morestring=[d]{'},% @@ -1632,24 +1632,28 @@ external,for,form,fuzz,halt,labels,intermediates,negative,normal,novalue,% on,off,results,scan,scientific,select,source,stream,syntax,until,upper,% value,var,version,while,with},% - ndkeywords={abbrev,abs,address,bitand,bitor,bitxor,center,centre,% + morekeywords=[2]{abbrev,abs,address,bitand,bitor,bitxor,center,centre,% compare,copies,c2d,c2x,datatype,date,delstr,delword,diag,diagrc,% d2c,d2x,errortext,externals,find,format,index,insert,justify,% - lastpos,left,length,linesize,max,min,overlay,pos,queued,random,% - reverse,rigth,sign,sourceline,space,storage,strip,substr,subword,% - symbol,time,translate,trunc,userid,value,verify,word,wordindex,% - wordlength,words,xrange,x2c,x2d},% + lastpos,left,length,linein,lineout,lines,linesize,max,min,overlay,% + pos,queued,random,reverse,rigth,sign,sourceline,space,storage,% + strip,substr,subword,symbol,time,translate,trunc,userid,value,verify,% + word,wordindex,wordlength,words,xrange,x2c,x2d},% + morekeywords=[3]{result,rc,self,sigl,super},% sensitive=false,% morestring=[d]",% morestring=[d]',% morecomment=[s]{/*}{*/},% - alsoletter={:},% }[keywords,comments,strings]% %% %% ooREXX keywords (http://www.oorexx.org/) \lst@definelanguage[]{OORexx}[VM/XA]{Rexx}{% - morekeywords={::class, ::method, ::attribute},% -} + morekeywords={::annotate, ::attribute, ::class, ::constant, ::method,% + ::options, ::requires, ::resource, ::routine,% + forward, guard, local, loop, raise, strict,% + },% + alsoletter={:},% +}[keywords,comments,strings] \lst@definelanguage{Ruby}% {morekeywords={__FILE__,__LINE__,BEGIN,END,alias,and,begin,break,% case,class,def,defined?,do,else,elsif,end,ensure,false,for,% diff --git a/Master/texmf-dist/tex/latex/listings/lstlang3.sty b/Master/texmf-dist/tex/latex/listings/lstlang3.sty index 9d5b43d1db6..fdff27f5a59 100644 --- a/Master/texmf-dist/tex/latex/listings/lstlang3.sty +++ b/Master/texmf-dist/tex/latex/listings/lstlang3.sty @@ -22,7 +22,7 @@ %% programming languages to Jobst Hoffmann at . %% \ProvidesFile{lstlang3.sty} - [2023/02/27 1.9 listings language file] + [2024/02/21 1.10 listings language file] \lst@definelanguage[68]{Algol}% {morekeywords={abs,and,arg,begin,bin,bits,bool,by,bytes,case,channel,% char,co,comment,compl,conj,divab,do,down,elem,elif,else,empty,% diff --git a/Master/texmf-dist/tex/latex/listings/lstmisc.sty b/Master/texmf-dist/tex/latex/listings/lstmisc.sty index 36960591299..8b0bc5fe04a 100644 --- a/Master/texmf-dist/tex/latex/listings/lstmisc.sty +++ b/Master/texmf-dist/tex/latex/listings/lstmisc.sty @@ -16,17 +16,17 @@ %% Send comments and ideas on the package, error reports and additional %% programming languages to Jobst Hoffmann at . %% -\def\filedate{2023/02/27} -\def\fileversion{1.9} +\def\filedate{2024/02/21} +\def\fileversion{1.10} \ProvidesFile{lstmisc.sty} [\filedate\space\fileversion\space(Carsten Heinz)] -\lst@CheckVersion\fileversion +\lst@CheckVersion\fileversion% {\typeout{^^J% ***^^J% *** This file requires `listings.sty' version \fileversion.^^J% - *** You have a serious problem, so I'm exiting ...^^J% + *** You have a serious problem, so I'm exiting...^^J% ***^^J}% - \batchmode \@@end} + \batchmode\@@end} \lst@BeginAspect{writefile} \newtoks\lst@WFtoken % global \lst@AddToHook{InitVarsBOL}{\global\lst@WFtoken{}} @@ -304,7 +304,7 @@ \fi \fi \fi} \lst@NewMode\lst@TeXLmode \gdef\lst@ActiveCDefX#1{\lst@ActiveCDefX@#1} -\gdef\lst@ActiveCDefX@#1#2#3{ +\gdef\lst@ActiveCDefX@#1#2#3{% \catcode`#1\active\lccode`\~=`#1% \lowercase{\lst@CDefIt~}{#2}{#3}{}} \gdef\lst@Escape#1#2#3#4{% diff --git a/Master/texmf-dist/tex/latex/listings/lstpatch.sty b/Master/texmf-dist/tex/latex/listings/lstpatch.sty new file mode 100644 index 00000000000..1b0b3ef7a59 --- /dev/null +++ b/Master/texmf-dist/tex/latex/listings/lstpatch.sty @@ -0,0 +1,14 @@ +%% +%% This is file `lstpatch.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% listings.dtx (with options: `patch') +%% +\ProvidesFile{lstpatch.sty} + [\filedate\space\fileversion\space(Carsten Heinz)] +\lst@CheckVersion\lst@version{} +\endinput +%% +%% End of file `lstpatch.sty'. -- cgit v1.2.3