From b294a44f24410094addc2c6d6cc4a17471bb567e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Sep 2019 21:19:52 +0000 Subject: listings (11sep19) git-svn-id: svn://tug.org/texlive/trunk@52079 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/listings/listings.dtx | 115 +++++++++++++++------ 1 file changed, 83 insertions(+), 32 deletions(-) (limited to 'Master/texmf-dist/source/latex/listings/listings.dtx') diff --git a/Master/texmf-dist/source/latex/listings/listings.dtx b/Master/texmf-dist/source/latex/listings/listings.dtx index 2a9216744ab..c63ef2ffab3 100644 --- a/Master/texmf-dist/source/latex/listings/listings.dtx +++ b/Master/texmf-dist/source/latex/listings/listings.dtx @@ -96,13 +96,15 @@ %\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,abovecaptionskip,^^A -% belowcaptionskip,label,title,caption,\string\lstlistingname,boxpos,float,^^A +% literate,basicstyle,print,firstline,lastline,linerange,nolol,captionpos,^^A +% abovecaptionskip,^^A +% belowcaptionskip,label,title,caption,\string\lstlistingname,^^A +% \string\lstlistingnamestyle,boxpos,float,^^A % floatplacement,aboveskip,belowskip,everydisplay,showlines,emptylines,gobble,name,^^A % \string\lstname,\string\lstlistlistingname,\string\lstlistoflistings,^^A % \string\lstnewenvironment,\string\lstinline,\string\lstinputlisting,lstlisting,^^A % \string\lstloadaspects,\string\lstset,\string\thelstlisting,\string\lstaspectfiles,^^A -% inputencoding,delim,moredelim,deletedelim,upquote,numberbychapter,^^A +% inputencoding,inputpath,delim,moredelim,deletedelim,upquote,numberbychapter,^^A % \string\lstMakeShortInline,\string\lstDeleteShortInline} %\lstisaspect[doc]{lstsample,lstxsample}^^A environment %\lstisaspect[experimental]{includerangemarker,rangebeginprefix,rangebeginsuffix,^^A @@ -131,10 +133,13 @@ % Hoffmann became the maintainer of the \packagename{listings} % package in 2013; see the Preface for details.}~ % % \textless\lstemail\textgreater} -% \date{2019/02/27\enspace\enspace Version 1.8b\ \box\abstractbox} +% \date{2019/09/10\enspace\enspace Version 1.8c\ \box\abstractbox} % \def\lstemail{\href{mailto:j.hoffmann@fh-aachen.de}{\texttt{j.hoffmann(at)fh-aachen.de}}} % \ifhyper -% \hypersetup{pdfsubject=Package guide,pdfauthor=Jobst Hoffmann } +% \hypersetup{pdftitle=The Listings Package, +% pdfsubject=Package guide, +% pdfauthor=Jobst Hoffmann ,% +% pdfkeywords={source code formatter, programming languages}} % \fi % % \csname @twocolumntrue\endcsname @@ -1843,7 +1848,8 @@ % \item % There is one question `you' haven't asked all the last pages: who is to % blame. Carsten Heinz wrote the guides, coded the \packagename{listings} -% package and wrote some language drivers. Brooks Moses currently maintains +% package and wrote some language drivers. Brooks Moses took over the +% maintaining for several years, Jobst Hoffmann currently maintains % the package. Other people defined more languages % or contributed their ideas; many others made bug reports, but only the first % bug finder is listed. @@ -1870,6 +1876,7 @@ % Moreover we wish to thank % \begin{quote} % \hyphenpenalty=10000\relax \rightskip=0pt plus \linewidth +% \lstthanks{Nasser~M.~Abbasi}{nma@12000.org}, % \lstthanks{Bj{\o}rn~{\AA}dlandsvik}{bjorn@imr.no}, % \lstthanks{Omair-Inam~Abdul-Matin}{-}, % \lstthanks{Gaurav~Aggarwal}{gaurav@ics.uci.edu}, @@ -1883,6 +1890,7 @@ % \lstthanks{Michael~Bachmann}{-}, % \lstthanks{Luca~Balzerani}{-}, % \lstthanks{Peter~Bartke}{bartke@inf.fu-berlin.de} (big thankyou), ^^A beta tester +% \lstthanks{Jean-Yves~Baudais}{Jean-Yves.Baudais@insa-rennes.fr}, % \lstthanks{Heiko~Bauke}{-}, % \lstthanks{Oliver~Baum}{oli.baum@web.de}, % \lstthanks{Ralph~Becket}{rbeck@microsoft.com}, @@ -1892,6 +1900,7 @@ % \lstthanks{Javier~Bezos}{javier.bezos@bancoval.es}, % \lstthanks{Olaf~Trygve~Berglihn}{olafb@pvv.org}, % ^^A {1999/11/29}{3-char comment delimiter don't work (Python)} +% \lstthanks{Karl~Berry}{karl@freefriends.org}, % \lstthanks{Geraint~Paul~Bevan}{geraint@users.sf.net}, % \lstthanks{Peter~Biechele}{peter.biechele@physik.uni-freiburg.de}, % \lstthanks{Beat~Birkhofer}{beat@birkhofer.ch}, @@ -1919,6 +1928,7 @@ % \lstthanks{Norbert~Eisinger}{Norbert.Eisinger@informatik.uni-muenchen.de}, % \lstthanks{Brian~Elmegaard}{-}, % \lstthanks{Jon~Ericson}{Jon.Ericson@jpl.nasa.gov}, +% \lstthanks{Luc~Van~Eycken}{Luc.VanEycken@esat.kuleuven.be} % \lstthanks{Thomas~Esser}{te@dbs.uni-hannover.de}, % \lstthanks{Chris~Edwards}{edwch00p@infoscience.otago.ac.nz}, % \lstthanks{David~John~Evans}{Matrix.Software@dial.pipex.com}, @@ -1972,6 +1982,7 @@ % \lstthanks{Rene~H.~Larsen}{rhl@traceroute.dk}, % \lstthanks{Olivier~Lecarme}{ol@i3s.unice.fr}, % \lstthanks{Thomas~Leduc}{Thomas.Leduc@lsv.ens-cachan.fr}, +% \lstthanks{Qing~Lee}{-}, % \lstthanks{Dr.~Peter~Leibner}{Peter.Leibner@sta.siemens.de}, % \lstthanks{Thomas~Leonhardt}{leonhardt@informatik.tu-darmstadt.de} % (big thankyou), ^^A beta tester @@ -2004,6 +2015,7 @@ % \lstthanks{Michael~Piefel}{piefel@informatik.hu-berlin.de}, % \lstthanks{Michael~Piotrowski}{mxp@linguistik.uni-erlangen.de}, % \lstthanks{Manfred~Piringer}{sz0490@rrze.uni-erlangen.de}, +% \lstthanks{Ivo~Pletikosi\'c}{ivo.pletikosic@gmail.com}, % \lstthanks{Vincent~Poirriez}{Vincent.Poirriez@univ-valenciennes.fr}, % \lstthanks{Adam~Prugel-Bennett}{apb@ecs.soton.ac.uk}, % \lstthanks{Ralf~Quast}{rquast@hs.uni-hamburg.de}, @@ -2026,6 +2038,7 @@ % \lstthanks{Walter~Schmidt}{wschmi@arcor.de}, % \lstthanks{Christian~Schneider}{-}, % \lstthanks{Jochen~Schneider}{jschneider@ds3.etech.haw-hamburg.de}, +% \lstthanks{Sven~Schreiber}{svetosch@gmx.net}, % \lstthanks{Benjamin~Schubert}{benjamin.schubert@berlin.de}, % \lstthanks{Sebastian~Schubert}{-}, % \lstthanks{Uwe~Siart}{uwe.siart@ei.tum.de}, @@ -2689,7 +2702,7 @@ % \item[0.20] \rkeyname{caption}|={|\oarg{short}\meta{caption text}|}| % % The caption is made of \cs{lstlistingname} followed by a running -% number, a seperator, and \meta{caption text}. Either the caption text +% number, a separator, and \meta{caption text}. Either the caption text % or, if present, \meta{short} will be used for the list of listings. % % \item[0.21] \rkeyname{label}|=|\meta{name} @@ -2714,6 +2727,15 @@ % % The caption label for listings. % +% \item[,{{}},data] \rcmdname\lstlistingnamestyle +% +% customizes the style of the caption label for program listings in a +% 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 +% \cite{Sommerfeldt:caption}. +% % \item[0.20,\arabic{lstlisting},data] \rcmdname\thelstlisting % % prints the running number of the caption. @@ -3465,7 +3487,7 @@ % \end{table} % % -% \paragraph{Strings} +% \paragraph{Strings}\label{uStrings} % \begin{syntax} % \item[0.12] % \rkeyname{string}|=|\oarg{\alternative{b,d,m,bd,s}}\marg{delimiter @@ -3645,6 +3667,7 @@ % Moreover, you might want to adjust % \icmdname\lstlistlistingname, % \icmdname\lstlistingname, +% \icmdname\lstlistingnamestyle, % \ikeyname{defaultdialect}, % \icmdname\lstalias, or % \icmdname\lstalias @@ -4390,13 +4413,17 @@ % \StopEventually{% % \begin{thebibliography}{MDB01} % +% \bibitem[DS13]{DanielSchubert:mdframed} +% Marco Daniel and Elke Schubert. +% \newblock{The \textsf{mdframed} package}, 2013. +% % \bibitem[Fai11]{Fairbairns:moreverb} % Robin Fairbairns. % \newblock{The \textsf{moreverb} package}, 2011. % -% \bibitem[DS13]{DanielSchubert:mdframed} -% Marco Daniel and Elke Schubert. -% \newblock{The \textsf{mdframed} package}, 2013. +% \bibitem[Som11]{Sommerfeldt:captions} +% Axel Sommerfeldt. +% \newblock{Customizing captions of floating environments}, 2011. % \end{thebibliography} % \setcounter{IndexColumns}{2}\PrintIndex} % @@ -5816,7 +5843,7 @@ % \part{Implementation} % % -% \CheckSum{12377} +% \CheckSum{12380} %^^A %^^A Don't index TeX-primitives. %^^A @@ -5960,8 +5987,8 @@ % All files will have same date and version. % \begin{macrocode} %<*kernel|misc|doc> -\def\filedate{2019/02/27} -\def\fileversion{1.8b} +\def\filedate{2019/09/10} +\def\fileversion{1.8c} % % \end{macrocode} % What we need and who we are. @@ -9751,7 +9778,8 @@ % \end{macrocode} % % \begin{macro}{\lst@stringtypes} -% is the list of \ldots\space string types? +% is the list of \ldots\space string types? The several valid string +% types are defined on page~\pageref{uStrings}. % \begin{macrocode} \gdef\lst@stringtypes{d,b,m,bd,db,s} % \end{macrocode} @@ -13607,8 +13635,16 @@ % \end{lstkey}\end{lstkey}\end{lstkey}\end{macro} % 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. +% line ranges with numbers and range markers. It uses some more keys: % +% \begin{lstkey}{linerange} +% \begin{lstkey}{rangeprefix} +% \begin{lstkey}{rangesuffix} +% \begin{lstkey}{rangebeginprefix} +% \begin{lstkey}{rangebeginsuffix} +% \begin{lstkey}{rangeendprefix} +% \begin{lstkey}{rangeendsuffix} +% \begin{lstkey}{includerangemarker} % First, the options that control the line-range handling. % \begin{macrocode} \lst@Key{linerange}\relax{\lstKV@OptArg[]{#1}{% @@ -13689,6 +13725,9 @@ % \begin{macrocode} \lst@AddToHookExe{DeInit}{\global\let\lst@DefRange\@empty} % \end{macrocode} +% \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 @@ -13865,6 +13904,7 @@ % % \begin{macro}{\thelstlisting} % \begin{macro}{\lstlistingname} +% \begin{macro}{\lstlistingnamestyle} % \begin{lstkey}{numberbychapter} % \ldots\space and how the caption numbers look like. I switched to % |\@ifundefined| (instead of |\ifx| |\@undefined|) after an error report from @@ -13888,6 +13928,7 @@ % \end{macrocode} % \begin{macrocode} \lst@UserCommand\lstlistingname{Listing} +\lst@UserCommand\lstlistingnamestyle{} % \end{macrocode} % \begin{macrocode} \lst@Key{numberbychapter}{true}[t]{\lstKV@SetIf{#1}\lst@ifnumberbychapter} @@ -13895,6 +13936,7 @@ % \end{lstkey} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\lst@MakeCaption} % Before defining this macro, we ensure that some other control sequences @@ -13930,11 +13972,13 @@ % replacement text was used directly in |\lst@MakeCaption|. A |\noindent| has % been moved elsewhere and became |\@parboxrestore| after a bug report from % \lsthelper{Frank~Mittelbach}{2004/02/13}{Re: Info: Inkompatibilit\"at -% zwischen caption und listings}. +% zwischen caption und listings}. \lsthelper{Karl Berry}{bold "listings +% 1"?} asked for the ability of customizing the label. So +% |\lstlistingnamestyle| was introduced in front of |\lstlistingname|. % \begin{macrocode} \def\fnum@lstlisting{% - \lstlistingname - \ifx\lst@@caption\@empty\else~\thelstlisting\fi}% + {\lstlistingnamestyle\lstlistingname + \ifx\lst@@caption\@empty\else~\thelstlisting\fi}}% % \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} @@ -14198,7 +14242,7 @@ \vspace\lst@aboveskip \fi \fi -% \end{macrocode} +% \end{macrocode} ^^A$ to make emacs font locking happy % Moved |\vspace| after |\par|---or we can get an empty line atop listings. % Bug reported by \lsthelper{Jim~Hefferon}{1999/08/27}{empty line before % listings with |\lstinputlisting|}. @@ -14589,7 +14633,7 @@ \lsthk@TextStyle \@ifnextchar\bgroup{% % \end{macrocode} -% \lsthelper{Luc~Van~Eycken}{2014/01/22}{Luc.VanEycken@esat.kuleuven.be} +% \lsthelper{Luc~Van~Eycken}{2014/01/22}{\rcmdname\lstinline{} in alignments} % reported, that the experimental implementation of |\lstinline| with % braces instead of characters surrounding the source code resulted in an % error if used in a tabular environment. He found that this error comes @@ -14599,7 +14643,7 @@ %\begin{verbatim} % \ifnum`{=0}\fi% %\end{verbatim} -% remedies the wrong behaviour. But \lsthelper{Qing Lee}{2014/06/28}{-} +% remedies the wrong behaviour. But \lsthelper{Qing~Lee}{2014/06/28}{-} % pointed out, that this breaks code like the one showed in % \ref{uListingsArguments} on \pageref{uListingsArguments} and proposed % another solution which in turn broke the code needed by Luc: @@ -15280,16 +15324,18 @@ }{% % \end{macrocode} % There is a problem with vertical space below a listing as pointed out by -% \lsthelper{Jean-Yves~Baudais}{2016/03/11}{some vertical space problem}. A -% similar problem arises with a listing beginning at the top of a -% |\paragraph| or at the beginning of an |example| environment. Jean-Yves -% provided a solution---|\let\if@nobreak\iffalse|---as has been discussed -% on |fr.comp.text.tex|. The assumption, that the problem vanishes if there -% is a top rule at the beginning of the listing or if |\leavevmode| -% introduces the listing, was wrong as \lsthelper{Karl -% Berry}{karl@freefriends.org}{2018/10/26} and \lsthelper{Sven -% Schreiber}{svetosch@gmx.net}{2018/10/23} reported independently, so the -% proposed code goes into the second part of the environment definition +% \lsthelper{Jean-Yves~Baudais}{2016/03/11}{some +% vertical space problem}. A similar problem arises with a listing +% beginning at the top of a |\paragraph| or at the beginning of an +% |example| environment. Jean-Yves provided a +% solution---|\let\if@nobreak\iffalse|---as has been discussed on +% |fr.comp.text.tex|. The assumption, that the problem vanishes if there is +% a top rule at the beginning of the listing or if |\leavevmode| introduces +% the listing, was wrong as +% \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 % \begin{macrocode} \let\if@nobreak\iffalse% \csname\@lst @SaveFirstNumber\endcsname% @@ -16924,6 +16970,11 @@ % \item[1.7] 2018/09/02 % \item some new or updated language definitions. % \item several error corrections. +% \item[1.8] from 2019/02/27 on +% \item corrected and activated the option |inputpath|. +% \item some new or updated language definitions. +% \item several error corrections. +% \item introduced |\lstlistingnamestyle|. % \end{itemize} % \endgroup % -- cgit v1.2.3