summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/listings
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-26 03:02:49 +0000
committerNorbert Preining <norbert@preining.info>2020-03-26 03:02:49 +0000
commit2bd4f7f317b392c32ce18c70d03fd5ba9ddd9e6d (patch)
tree1031fd1abadb4f1ac0a0f2e904a911a36278cb50 /macros/latex/contrib/listings
parente32477e40d853a81951c9811f8554455dbff4014 (diff)
CTAN sync 202003260302
Diffstat (limited to 'macros/latex/contrib/listings')
-rw-r--r--macros/latex/contrib/listings/Makefile3
-rw-r--r--macros/latex/contrib/listings/README2
-rw-r--r--macros/latex/contrib/listings/listings-devel.pdfbin1142824 -> 1150640 bytes
-rw-r--r--macros/latex/contrib/listings/listings.dtx124
-rw-r--r--macros/latex/contrib/listings/listings.pdfbin744403 -> 750616 bytes
-rw-r--r--macros/latex/contrib/listings/lstdrvrs.dtx6
-rw-r--r--macros/latex/contrib/listings/lstdrvrs.pdfbin565021 -> 565192 bytes
7 files changed, 115 insertions, 20 deletions
diff --git a/macros/latex/contrib/listings/Makefile b/macros/latex/contrib/listings/Makefile
index 5792254ad4..49750393d3 100644
--- a/macros/latex/contrib/listings/Makefile
+++ b/macros/latex/contrib/listings/Makefile
@@ -36,9 +36,10 @@ DISTRIBUTION_FILES = ../$(PACKAGE)/$(PACKAGE).pdf \
../$(PACKAGE)/README \
../$(PACKAGE)/Makefile \
../$(PACKAGE)/lstdrvrs.dtx \
- ../$(PACKAGE)/lstdrvrs.ins \
../$(PACKAGE)/lstdrvrs.pdf
PACKAGE_FILES = $(subst ../$(PACKAGE)/,,$(DISTRIBUTION_FILES))
+STY_FILES = listings.cfg listings.sty lstmisc.sty \
+ lstlang0.sty lstlang1.sty lstlang2.sty
.SUFFIXES: # Delete the default suffixes
.SUFFIXES: .dtx .ins .pdf .sty # Define our own suffix list
diff --git a/macros/latex/contrib/listings/README b/macros/latex/contrib/listings/README
index a6f0849c16..5c4a4f0628 100644
--- a/macros/latex/contrib/listings/README
+++ b/macros/latex/contrib/listings/README
@@ -3,7 +3,7 @@ Listings package
Copyright 1996--2004 Carsten Heinz (the package)
Copyright 1996--2007 individual authors (language drivers)
Copyright 2006--2007 Brooks Moses (continued maintenance)
-Copyright 2013--2019 Jobst Hoffmann (continued maintenance)
+Copyright 2013--2020 Jobst Hoffmann (continued maintenance)
Released under the LaTeX Project Public License 1.3c or later
diff --git a/macros/latex/contrib/listings/listings-devel.pdf b/macros/latex/contrib/listings/listings-devel.pdf
index 72c41df9a6..bece208f87 100644
--- a/macros/latex/contrib/listings/listings-devel.pdf
+++ b/macros/latex/contrib/listings/listings-devel.pdf
Binary files differ
diff --git a/macros/latex/contrib/listings/listings.dtx b/macros/latex/contrib/listings/listings.dtx
index c63ef2ffab..1874a17849 100644
--- a/macros/latex/contrib/listings/listings.dtx
+++ b/macros/latex/contrib/listings/listings.dtx
@@ -22,7 +22,7 @@
%
% The listings package and its drivers 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.
+% 1.3c 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.3c or later is part of all distributions of LaTeX
@@ -96,8 +96,8 @@
%\lstisaspect[kernel]{basewidth,fontadjust,columns,flexiblecolumns,identifierstyle,^^A
% tabsize,showtabs,tab,showspaces,keepspaces,formfeed,SelectCharTable,^^A
% MoreSelectCharTable,extendedchars,alsoletter,alsodigit,alsoother,excludedelims,^^A
-% literate,basicstyle,print,firstline,lastline,linerange,nolol,captionpos,^^A
-% abovecaptionskip,^^A
+% literate,basicstyle,print,firstline,lastline,linerange,^^A
+% consecutivenumbers,nolol,captionpos,abovecaptionskip,^^A
% belowcaptionskip,label,title,caption,\string\lstlistingname,^^A
% \string\lstlistingnamestyle,boxpos,float,^^A
% floatplacement,aboveskip,belowskip,everydisplay,showlines,emptylines,gobble,name,^^A
@@ -133,7 +133,7 @@
% Hoffmann became the maintainer of the \packagename{listings}
% package in 2013; see the Preface for details.}~ %
% \textless\lstemail\textgreater}
-% \date{2019/09/10\enspace\enspace Version 1.8c\ \box\abstractbox}
+% \date{2020/03/24\enspace\enspace Version 1.8d\ \box\abstractbox}
% \def\lstemail{\href{mailto:j.hoffmann@fh-aachen.de}{\texttt{j.hoffmann(at)fh-aachen.de}}}
% \ifhyper
% \hypersetup{pdftitle=The Listings Package,
@@ -727,7 +727,7 @@
% \paragraph{Distribution and modification}
% The \packagename{listings} package and its drivers 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.
+% either version 1.3c of this license or (at your option) any later version.
% The latest version of this license is in
% \href{http://www.latex-project.org/lppl.txt}{http://www.latex-project.org/lppl.txt}
% and version 1.3c or later is part of all distributions of LaTeX version
@@ -1106,6 +1106,58 @@
% \end{lstsample}
% The next |Test| listing goes on with line number {\makeatletter\lstno@Test},
% no matter whether there are other listings in between.
+%
+% You can also select the lines to be printed, the options
+% `\ikeyname{linerange}' and `\ikeyname{consecutivenumbers}' are your
+% friend. In a presentation for example you don't need comments for your
+% programs, so you prefer the line numbers being consecutively numbered,
+% but the results should reflect the behaviour of the program---you omit
+% parts of the lengthy output. So
+% you may have the following program and its results.
+% \begin{lstsample}[name]{\lstset{numbers=left,numberstyle=\tiny,stepnumber=1,numbersep=5pt}}{}
+% \begin{lstlisting}[name=Test,
+% language={[ansi]C},
+% linerange={1-4,6-7,10-14,
+% 17-19,21-22},
+% firstnumber=1]
+% #include <stdio.h>
+% #include <stdlib.h>
+%
+% int main(int argc,char* argv[]){
+% /* declaring variables */
+% int i;
+% int limit;
+%
+% /* checking arguments */
+% if ( argc > 1 ) {
+% limit = atoi(argv[1]);
+% } else {
+% limit = 100;
+% }
+%
+% /* counting lines */
+% for (i = 1;i <= limit;i++) {
+% printf("Line no. %3.0d\n", i);
+% }
+%
+% return 0;
+% }
+%
+% \end{lstlisting}
+% And these are the results:
+% \begin{lstlisting}[language={},
+% linerange={1-2,6-7},
+% consecutivenumbers=false]
+% Line no. 1
+% Line no. 2
+% Line no. 3
+% Line no. 4
+% Line no. 5
+% Line no. 6
+% Line no. 7
+% \end{lstlisting}
+% \end{lstsample}
+%
% \begin{advise}
% \item Okay. And how can I get decreasing line numbers?
% \advisespace
@@ -2294,6 +2346,16 @@
% listing are displayed. The intervals must be sorted and must not
% intersect.
%
+% \item[1.8, true]
+% \rkeyname{consecutivenumbers}|=|\meta{\alternative{true,false}}^^A
+% \syntaxor\rkeyname{consecutivenumbers}\label{uoption:consecutivenumbers}
+%
+% can be used on individual listings only. Its use makes sense only if
+% also \rkeyname{linerange} is used. The default (true) value means that
+% the line numbering for \emph{all} lineranges happens to be consecutively,
+% e\,g. 1, 2, 3,\ldots. If it is set to false, different ranges get
+% their own numbering (see sec. \ref{uLineNumbers}).
+%
% \item[0.20,false]
% \rkeyname{showlines}|=|\meta{\alternative{true,false}}\syntaxor\rkeyname{showlines}
%
@@ -2640,7 +2702,7 @@
% the number corresponding to the first input line.
%
% \texttt{last} continues the numbering of the most recent listing and
-% \meta{number} sets it to the number.
+% \meta{number} sets it to the (logical) number.
%
% \item[1.0] \rkeyname{name}|=|\meta{name}
%
@@ -3984,6 +4046,10 @@
% \item[1.2,true] \rkeyname{includerangemarker}|=|\meta{\alternative{true,false}}
%
% shows or hides the markers in the output.
+%
+% \textbf{Remark:} If |firstnumber| is set, it refers to
+% the line which contains the marker. So if one wants to start a range with
+% the number 1, one has to set |includerangemarker=false, firstnumber=0|.
% \end{syntax}
% \begin{lstsample}{\lstset{rangeprefix=\{\ ,rangesuffix=\ \}}}{}
% \begin{lstlisting}%
@@ -4357,7 +4423,7 @@
% \end{advise}
% First of all, you'll need Metafont source files for bold typewriter, e.g.~
% \texttt{cmbtt8.mf}, \texttt{cmbtt9.mf} and \texttt{cmbtt10.mf} from
-% \href{ftp://ftp.dante.de/tex-archive/fonts/cm/mf-extra/bold}
+% \href{http://mirror.ctan.org/fonts/cm/mf-extra/bold}
% {CTAN/fonts/cm/mf-extra/bold}.
% Secondly you have to create \texttt{.tfm}-files, i.e.~run the Metafont
% program on these sources. This is possibly done automatically when you use
@@ -5843,7 +5909,7 @@
% \part{Implementation}
%
%
-% \CheckSum{12380}
+% \CheckSum{12394}
%^^A
%^^A Don't index TeX-primitives.
%^^A
@@ -5987,8 +6053,8 @@
% All files will have same date and version.
% \begin{macrocode}
%<*kernel|misc|doc>
-\def\filedate{2019/09/10}
-\def\fileversion{1.8c}
+\def\filedate{2020/03/24}
+\def\fileversion{1.8d}
%</kernel|misc|doc>
% \end{macrocode}
% What we need and who we are.
@@ -8775,7 +8841,15 @@
\lst@ProcessOther {"27}{\lst@ifupquote \textquotesingle
\else \char39\relax \fi}
\lst@ProcessOther {"2A}{\lst@ttfamily*\textasteriskcentered}
- \lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{$-$}}
+% \end{macrocode}
+% \lsthelper{Ulrike~Fischer}{2020/02/19}{Inkompabilität von breqn/flexisym
+% mit listings} pointed out the incompatibility between
+% \packagename{flexisym} and \packagename{listings}: \packagename{flexisym}
+% changes the math code while \packagename{listings} changes the
+% meaning. So the minus character vanishes. Replacing the original |$-$| by
+% |\textminus| should remedy the problem.
+% \begin{macrocode}
+ \lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{\textminus}}
\lst@ProcessOther {"3C}{\lst@ttfamily<\textless}
\lst@ProcessOther {"3E}{\lst@ttfamily>\textgreater}
\lst@ProcessOther {"5C}{\lst@ttfamily{\char92}\textbackslash}
@@ -13638,6 +13712,7 @@
% line ranges with numbers and range markers. It uses some more keys:
%
% \begin{lstkey}{linerange}
+% \begin{lstkey}{consecutivenumbers}
% \begin{lstkey}{rangeprefix}
% \begin{lstkey}{rangesuffix}
% \begin{lstkey}{rangebeginprefix}
@@ -13649,6 +13724,9 @@
% \begin{macrocode}
\lst@Key{linerange}\relax{\lstKV@OptArg[]{#1}{%
\def\lst@interrange{##1}\def\lst@linerange{##2,}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
\lst@Key{rangeprefix}\relax{\def\lst@rangebeginprefix{#1}%
\def\lst@rangeendprefix{#1}}
\lst@Key{rangesuffix}\relax{\def\lst@rangebeginsuffix{#1}%
@@ -13727,7 +13805,7 @@
% \end{macrocode}
% \end{lstkey}\end{lstkey}\end{lstkey}
% \end{lstkey}\end{lstkey}\end{lstkey}
-% \end{lstkey}\end{lstkey}
+% \end{lstkey}\end{lstkey}\end{lstkey}
%
% Actually defining the marker (via |\lst@GLI@|, |\lst@DefRange|,
% |\lst@CArgX| as seen above) is similar to |\lst@DefDelimB|---except that
@@ -14738,7 +14816,9 @@
% package, which is part of |doc.dtx| from the Standard \LaTeX\ documentation
% package, version 2006/02/02 v2.1d. Portions of it are thus copyright
% 1993--2006 by The \LaTeX3 Project and copyright 1989--1999 by Frank
-% Mittelbach.
+% Mittelbach. \lsthelper{Denis~Bitouz\'e}{2020/03/21}
+% {Typos in error messages} used the Corona crisis to have look at the
+% error messages and found some typos.
%
% \begin{macro}{\lstMakeShortInline}
% \begin{macro}{\lstMakeShortInline@}
@@ -15023,11 +15103,21 @@
% We just look whether to drop more lines or to leave the mode which restores
% the definition of chr(13) and chr(10).
% \begin{macrocode}
+ \lst@Key{consecutivenumbers}{true}[t]{\lstKV@SetIf{#1}\lst@ifconsecutivenumbers}
+ \def\lst@DisplayConsecutiveNumbersOrNot{%
+ \lst@ifconsecutivenumbers\typeout{consecutive:}\else%
+ \typeout{non-consecutive:}
+ \c@lstnumber=\numexpr-1+\lst@lineno %\relax % this enforces the
+ %displayed line numbers to always be the
+ %input line numbers
+ \fi%
+}
\def\lst@MSkipToFirst{%
\global\advance\lst@lineno\@ne
\ifnum \lst@lineno=\lst@firstline
\lst@LeaveMode \global\lst@newlines\z@
\lsthk@InitVarsBOL
+ \lst@DisplayConsecutiveNumbersOrNot
\expandafter\lst@BOLGobble
\fi}
% \end{macrocode}
@@ -15335,9 +15425,13 @@
% \lsthelper{Karl~Berry}{2018/10/26}{listings 1.7 \rcmdname\leavevmode -> blank line} and
% \lsthelper{Sven~Schreiber}{2018/10/23}{Geändertes Verhalten in der neuen listings-Version} reported
% independently, so the proposed code goes into the second part of the
-% environment definition
+% environment definition. \lsthelper{Enrico Gregorio}{2019/05/04}{Is it a
+% listings package bug?} answered on
+% \url{https://tex.stackexchange.com/questions/489121/is-it-a-listings-package-bug}
+% that the previous solution |\let\if@nobreak\iffalse| is wrong because it
+% is a local assignment, but a globally setting is needed.
% \begin{macrocode}
- \let\if@nobreak\iffalse%
+ \@nobreakfalse
\csname\@lst @SaveFirstNumber\endcsname%
}
% \end{macrocode}
diff --git a/macros/latex/contrib/listings/listings.pdf b/macros/latex/contrib/listings/listings.pdf
index 0a6b5f5fb3..4d827f4980 100644
--- a/macros/latex/contrib/listings/listings.pdf
+++ b/macros/latex/contrib/listings/listings.pdf
Binary files differ
diff --git a/macros/latex/contrib/listings/lstdrvrs.dtx b/macros/latex/contrib/listings/lstdrvrs.dtx
index 69c0af8b85..f710ef02ae 100644
--- a/macros/latex/contrib/listings/lstdrvrs.dtx
+++ b/macros/latex/contrib/listings/lstdrvrs.dtx
@@ -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{2019/09/10\enspace\enspace Version 1.8c\ \box\abstractbox}
+% \date{2020/03/24\enspace\enspace Version 1.8d\ \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}[2019/09/10 1.8c listings configuration]
+\ProvidesFile{listings.cfg}[2020/03/24 1.8d 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> [2019/09/10 1.8c listings language file]
+%<-config> [2020/03/24 1.8d listings language file]
% \end{macrocode}
%
%
diff --git a/macros/latex/contrib/listings/lstdrvrs.pdf b/macros/latex/contrib/listings/lstdrvrs.pdf
index 9abb3a1d00..baac9f4b03 100644
--- a/macros/latex/contrib/listings/lstdrvrs.pdf
+++ b/macros/latex/contrib/listings/lstdrvrs.pdf
Binary files differ