texlive[69163] Master/texmf-dist: minted (18dec23)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 18 21:57:13 CET 2023


Revision: 69163
          https://tug.org/svn/texlive?view=revision&revision=69163
Author:   karl
Date:     2023-12-18 21:57:13 +0100 (Mon, 18 Dec 2023)
Log Message:
-----------
minted (18dec23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/minted/minted.pdf
    trunk/Master/texmf-dist/source/latex/minted/minted.dtx
    trunk/Master/texmf-dist/tex/latex/minted/minted.sty

Modified: trunk/Master/texmf-dist/doc/latex/minted/minted.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/minted/minted.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/minted/minted.dtx	2023-12-18 20:56:39 UTC (rev 69162)
+++ trunk/Master/texmf-dist/source/latex/minted/minted.dtx	2023-12-18 20:57:13 UTC (rev 69163)
@@ -31,12 +31,12 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{minted}
 %<*package>
-    [2023/09/12 v2.8 Yet another Pygments shim for LaTeX]
+    [2023/12/18 v2.9 Yet another Pygments shim for LaTeX]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
 \EnableCrossrefs
-\CodelineIndex
+%\CodelineIndex
 %\DisableCrossrefs
 %\RecordChanges
 %\OnlyDescription
@@ -110,9 +110,8 @@
     \g at addto@macro\changestext{\end{itemize}}%
 }
 \newcommand{\PrintChangelog}{%
-    \section*{Version History}%
-    \addcontentsline{toc}{section}{Version History}
-    \label{sec:version-history}
+    \section{Changelog}%
+    \label{sec:changelog}
     \begin{description}%
     \changestext
     \end{description}%
@@ -204,12 +203,12 @@
 
 \begin{document}
 \DocInput{minted.dtx}
-\PrintIndex
+% \PrintIndex
 \end{document}
 %</driver>
 % \fi
 %
-% \CheckSum{2565}
+% \CheckSum{2572}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -230,6 +229,12 @@
 %
 %
 %
+% \begin{changelog}{v2.9}{2023/12/18}
+% \item This is expected to be the last release of \pkg{minted} v2.x.  If so, it will then become the new package \Verb{minted2} for backward compatibility.
+% \item Added new option \Verb{ignorelexererrors}.  When lexer errors are shown in highlighted output (default), they are typically displayed as red boxes that surround the relevant text.  When lexer errors are ignored, the literal text that caused lexer errors is shown but there is no indication that it caused errors (\#374).
+% \item There is now a warning if \pkg{fvextra} version is less than 1.5.
+% \end{changelog}
+%
 % \begin{changelog}{v2.8}{2023/09/12}
 % \item Under non-Windows operating systems, detect executables with \Verb{command -v} rather than \Verb{which} to provide better cross-platform support (\#345).
 % \item Added new package option \Verb{inputlanglinenos}.  This extends the existing \Verb{langlinenos} to cover \Verb{\inputminted} as well (\#361).
@@ -302,7 +307,7 @@
 % \item \texttt{fvextra} brings the new options \texttt{highlightcolor} and \texttt{highlightlines}, which allow single lines or ranges of lines to be highlighted based on line number (\#124).
 % \item \texttt{fvextra} brings the new options \texttt{numberfirstline}, \texttt{stepnumberfromfirst}, and \texttt{stepnumberoffsetvalues} that provide better control over line numbering when \texttt{stepnumber} is not 1.
 % \item Fixed a bug from v2.2.2 that prevented \texttt{upquote} from working.
-% \end{changelog} 
+% \end{changelog}
 %
 %
 % \begin{changelog}{v2.2.2}{2016/06/21}
@@ -723,7 +728,7 @@
 %
 % \DescribeMacro{\mintinline}
 % Code can be typeset inline:
-% 
+%
 % \begin{example}
 %   X\mintinline{python}{print(x**2)}X
 % \end{example}
@@ -815,7 +820,7 @@
 % \subsection*{Customizing the \texttt{listing} environment}
 % By default, the |listing| environment is created using the \texpkg{float} package.  In that case, the |\listingscaption| and |\listoflistingscaption| macros described below may be used to customize the caption and list of listings.  If \texpkg{minted} is loaded with the |newfloat| option, then the |listing| environment will be created with the more powerful \href{http://www.ctan.org/pkg/newfloat}{\texpkg{newfloat}} package instead.  \texpkg{newfloat} is part of \href{http://www.ctan.org/pkg/caption}{\texpkg{caption}}, which provides many options for customizing captions.
 %
-% When \texpkg{newfloat} is used to create the |listing| environment, customization should be achieved using \texpkg{newfloat}'s |\SetupFloatingEnvironment| command.  For example, the string ``Listing'' in the caption could be changed to ``Program code'' using 
+% When \texpkg{newfloat} is used to create the |listing| environment, customization should be achieved using \texpkg{newfloat}'s |\SetupFloatingEnvironment| command.  For example, the string ``Listing'' in the caption could be changed to ``Program code'' using
 %\begin{verbatim}
 %\SetupFloatingEnvironment{listing}{name=Program code}
 %\end{verbatim}
@@ -887,7 +892,7 @@
 % Use a frozen (static) cache created with the |finalizecache| option.  When |frozencache| is on, |-shell-escape| is not needed, and Python and Pygments are not required.  In addition, any external files accessed through |\inputminted| are no longer necessary.
 %
 % \textbf{This option must be used with care.  A document \emph{must} be in final form, as far as \texpkg{minted} is concerned, \emph{before} \texttt{frozencache} is turned on, and the document \emph{must} have been compiled with \texttt{finalizecache}.   When this option is on, \texpkg{minted} content cannot be modified, except by editing the cache files directly.  Changing any \texpkg{minted} settings that require Pygments or Python is not possible.  If \texpkg{minted} content is incorrectly modified after \texttt{frozencache} is turned on, \texpkg{minted} \emph{cannot} detect the modification.}
-% 
+%
 % If you are using |frozencache|, and want to verify that \texpkg{minted} settings or content have not been modified in an invalid fashion, you can test the cache using the following procedure.
 % \begin{enumerate}
 % \item Obtain a copy of the cache used with |frozencache|.
@@ -1175,7 +1180,7 @@
 %
 %   This is not compatible with \texttt{draft} mode.  A complete list of Pygments tokens is available at \url{http://pygments.org/docs/tokens/}.  If the breaks provided by \texttt{breakbytoken} occur in unexpected locations, it may indicate a bug or shortcoming in the Pygments lexer for the language.
 %
-%   \item[breakbytokenanywhere (boolean) (false)] 
+%   \item[breakbytokenanywhere (boolean) (false)]
 %   Like \texttt{breakbytoken}, but also allows line breaks between immediately adjacent tokens, not just between tokens that are separated by spaces.  Using \texttt{breakbytokenanywhere} with \texttt{breakanywhere} is redundant.
 %
 % \item[breakindent (dimension) (\meta{breakindentnchars})]
@@ -1186,7 +1191,7 @@
 % \item[breakindentnchars (integer) (0)]
 % This allows |breakindent| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
-%   \item[breaklines (boolean) (false)] 
+%   \item[breaklines (boolean) (false)]
 %     Automatically break long lines in \texttt{minted} environments and \texttt{\string\mint} commands, and wrap longer lines in \texttt{\string\mintinline}.
 %
 % By default, automatic breaks occur at space characters.  Use \texttt{breakanywhere} to enable breaking anywhere; use \texttt{breakbytoken}, \texttt{breakbytokenanywhere}, \texttt{breakbefore}, and \texttt{breakafter} for more fine-tuned breaking.  Using \texttt{escapeinside} to escape to \LaTeX\ and then insert a manual break is also an option.  For example, use \texttt{escapeinside=||}, and then insert \texttt{|\textbackslash\textbackslash|} at the appropriate point.  (Note that \texttt{escapeinside} does not work within strings.)
@@ -1273,7 +1278,7 @@
 %
 %
 % \item[breaksymbolsepleft (dimension) (\meta{breaksymbolsepleftnchars})]
-% The separation between the |breaksymbolleft| and the adjacent text. 
+% The separation between the |breaksymbolleft| and the adjacent text.
 %
 % \item[breaksymbolsepleftnchars (integer) (2)]
 % Allows |breaksymbolsepleft| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
@@ -1373,7 +1378,7 @@
 %     firstnumber=11]{python}
 %   def all(iterable):
 %       for i in iterable:
-%           if not i: 
+%           if not i:
 %               return False
 %       return True
 %   \end{minted}
@@ -1406,6 +1411,20 @@
 %     The color of the frame.
 %   \item[samepage (boolean) (false)]
 %     Forces the whole listing to appear on the same page, even if it doesn't fit.
+%   \item[ignorelexererrors (boolean) (false)]
+%     When lexer errors are shown in highlighted output (default), they are typically displayed as red boxes that surround the relevant text.  When lexer errors are ignored, the literal text that caused lexer errors is shown but there is no indication that it caused errors.
+%
+%   \begin{longexample}
+%   \begin{minted}{python}
+%   variable = !!!
+%   \end{minted}
+%   \end{longexample}
+%
+%   \begin{longexample}
+%   \begin{minted}[ignorelexererrors=true]{python}
+%   variable = !!!
+%   \end{minted}
+%   \end{longexample}
 %   \item[showspaces (boolean) (false)]
 %     Enables visible spaces: \verb*/visible spaces/.
 %   \item[showtabs (boolean) (false)]
@@ -1619,7 +1638,7 @@
 % \item \textbf{The \texpkg{caption} package produces an error when \texttt{\string\captionof} and other commands are used in combination with \texpkg{minted}.}
 % Load the \texpkg{caption} package with the option |compatibility=false|.  Or better yet, use \texpkg{minted}'s |newfloat| package option, which provides better \texpkg{caption} compatibility.
 %
-% \item \textbf{I need a listing environment that supports page breaks.}  The built-in listing environment is a standard float; it doesn't support page breaks.  You will probably want to define a new environment for long floats.  For example, 
+% \item \textbf{I need a listing environment that supports page breaks.}  The built-in listing environment is a standard float; it doesn't support page breaks.  You will probably want to define a new environment for long floats.  For example,
 %\begin{verbatim}
 %\usepackage{caption}
 %\newenvironment{longlisting}{\captionsetup{type=listing}}{}
@@ -1642,8 +1661,7 @@
 %
 %
 %
-% \section*{Acknowledgements}
-% \addcontentsline{toc}{section}{Acknowledgements}
+% \section{Acknowledgements}
 %
 % \textbf{Konrad Rudolph:}  Special thanks to Philipp Stephani and the rest of the guys from \texttt{comp.text.tex} and \texttt{tex.stackexchange.com}.
 %
@@ -1672,7 +1690,7 @@
 %    \begin{macrocode}
 \RequirePackage{keyval}
 \RequirePackage{kvoptions}
-\RequirePackage{fvextra}
+\RequirePackage{fvextra}[2022/11/30]
 \RequirePackage{ifthen}
 \IfFileExists{shellesc.sty}
  {\RequirePackage{shellesc}
@@ -1826,7 +1844,7 @@
 %    \begin{macrocode}
 \ProcessKeyvalOptions*
 \ifthenelse{\boolean{minted at newfloat}}{\RequirePackage{newfloat}}{\RequirePackage{float}}
-\ifcsname tikzifexternalizing\endcsname 
+\ifcsname tikzifexternalizing\endcsname
   \tikzifexternalizing{\minted at drafttrue\minted at cachefalse}{}
 \else
   \ifcsname tikzexternalrealjob\endcsname
@@ -1852,7 +1870,7 @@
 %
 %
 % \subsection{Input, caching, and temp files}
-% 
+%
 % \begin{macro}{\minted at input}
 % We need a wrapper for |\input|.  In most cases, |\input| failure will be due to attempts to use |\inputminted| with files that don't exist, but we also want to give informative error messages when |outputdir| is needed or incompatible build tools are used.
 %    \begin{macrocode}
@@ -1859,8 +1877,8 @@
 \newcommand{\minted at input}[1]{%
   \IfFileExists{#1}%
    {\input{#1}}%
-   {\PackageError{minted}{Missing Pygments output; \string\inputminted\space 
-     was^^Jprobably given a file that does not exist--otherwise, you may need 
+   {\PackageError{minted}{Missing Pygments output; \string\inputminted\space
+     was^^Jprobably given a file that does not exist--otherwise, you may need
      ^^Jthe outputdir package option, or may be using an incompatible build
      tool,^^Jor may be using frozencache with a missing file}%
     {This could be caused by using -output-directory or -aux-directory
@@ -2028,7 +2046,7 @@
 %    \begin{macrocode}
     \DeleteFile{\minted at jobname.aex}%
     \ShellEscape{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
-      do set > \minted at jobname.aex <nul: /p 
+      do set > \minted at jobname.aex <nul: /p
       x=\string^\@percentchar \string~$PATH:i>> \minted at jobname.aex}%
     %$ <- balance syntax highlighting
     \immediate\openin\minted at appexistsfile\minted at jobname.aex
@@ -2509,13 +2527,13 @@
 %
 %
 % \begin{macro}{\minted at generate@PYGdef}
-% Generate Pygments style definition with |pygmentize| if a cached version does not exist.  Load the style definition into a global macro of the form 
+% Generate Pygments style definition with |pygmentize| if a cached version does not exist.  Load the style definition into a global macro of the form
 %\begin{Verbatim}
 %\csname minted at PYGdef@<style>\endcsname
 %\end{Verbatim}
 % to allow styles to be defined later.  Styles are not defined globally to avoid naming issues with style names that involve punctuation characters and numbers.  Rather, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix.
 %
-% Takes a single argument that is the detokenized style name.  Getting the detokenized style name here requires expansion (|\edef|) in an earlier macro (currently |\minted at defstyle|) to convert |\minted at get@opt{style}{default}| into detokenized text.  The |style| value is always wrapped in |\detokenize| when it is set, so expansion automatically detokenizes.  Detokenization can be important depending on active characters.  Expansion is important because the style name may be used with caching, so we need the current value retrieved by |\minted at get@opt|, not the value at the end of the document when cache data is written to the |.aux| file.  
+% Takes a single argument that is the detokenized style name.  Getting the detokenized style name here requires expansion (|\edef|) in an earlier macro (currently |\minted at defstyle|) to convert |\minted at get@opt{style}{default}| into detokenized text.  The |style| value is always wrapped in |\detokenize| when it is set, so expansion automatically detokenizes.  Detokenization can be important depending on active characters.  Expansion is important because the style name may be used with caching, so we need the current value retrieved by |\minted at get@opt|, not the value at the end of the document when cache data is written to the |.aux| file.
 %
 % Certain catcodes are required when loading Pygments style definitions from file.
 % \begin{itemize}
@@ -2546,7 +2564,7 @@
        {Missing style definition for #1 with frozencache}}%
      {}%
     \ShellEscape{%
-      \MintedPygmentize\space -S #1 -f latex -P commandprefix=PYG 
+      \MintedPygmentize\space -S #1 -f latex -P commandprefix=PYG
       > \minted at pygstylepath@save
     }%
    }%
@@ -2562,7 +2580,7 @@
        {Outdated style definition for #1 with frozencache}}%
      {}%
     \ShellEscape{%
-      \MintedPygmentize\space -S #1 -f latex -P commandprefix=PYG 
+      \MintedPygmentize\space -S #1 -f latex -P commandprefix=PYG
       > \minted at pygstylepath@save
     }%
     \CatchFileDef{\minted at tmp@filecontents}%
@@ -2575,8 +2593,8 @@
     \fi
   \fi
   \expandafter\global\expandafter\let\csname minted at PYGdef@#1\endcsname%
-    \minted at tmp@filecontents    
-  \endgroup  
+    \minted at tmp@filecontents
+  \endgroup
 }
 %    \end{macrocode}
 % \end{macro}
@@ -2593,7 +2611,8 @@
   \csname minted at PYGdef@\minted at style\endcsname
   \minted at patch@PYGZsq
   \minted at patch@PYGZhy
-}
+  \ifthenelse{\equal{\minted at get@opt{ignorelexererrors}{true}}{true}}%
+   {\let\PYG at tok@err\relax}{}}
 \ifthenelse{\boolean{minted at draft}}{\renewcommand{\minted at defstyle}[1]{}}{}
 %    \end{macrocode}
 % \end{macro}
@@ -2628,9 +2647,9 @@
 }
 %    \end{macrocode}
 % \end{macro}
-% 
 %
 %
+%
 % \begin{macro}{\minted at def@opt at switch}
 % And we need a switch version.
 %
@@ -2825,6 +2844,11 @@
 \minted at def@opt at switch{autogobble}
 %    \end{macrocode}
 %
+% Whether lexer errors are shown.
+%    \begin{macrocode}
+\minted at def@opt at switch{ignorelexererrors}
+%    \end{macrocode}
+%
 % \begin{macro}{\minted at encoding}
 % When working with encoding, we will need access to the current encoding.  That may be done via |\minted at get@opt|, but it is more convenient to go ahead and define a shortcut with an appropriate default
 %    \begin{macrocode}
@@ -2841,10 +2865,10 @@
 % Define a custom version of \texpkg{framed}'s |snugshade*| that takes a color as argument.  This avoids the need to redefine |shadecolor|.
 %    \begin{macrocode}
 \newenvironment{minted at snugshade*}[1]{%
-  \def\FrameCommand##1{\hskip\@totalleftmargin 
+  \def\FrameCommand##1{\hskip\@totalleftmargin
     \colorbox{#1}{##1}%
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
-  \MakeFramed{\advance\hsize-\width 
+  \MakeFramed{\advance\hsize-\width
     \@totalleftmargin\z@ \linewidth\hsize
     \advance\labelsep\fboxsep
     \@setminipage}%
@@ -2999,7 +3023,7 @@
         \ifAppExists
           \expandafter\global\expandafter\let%
             \csname minted at MintedPython@\MintedPython\endcsname\relax
-        \else      
+        \else
           \TestAppExists{\minted at altpython}%
           \ifAppExists
             \expandafter\global\expandafter\let%
@@ -3069,7 +3093,7 @@
       \ifwindows
         \@percentchar\detokenize{a}%
       \else
-        \detokenize{`}kpsewhich \minted at codefile\space 
+        \detokenize{`}kpsewhich \minted at codefile\space
           \detokenize{||} \minted at codefile\detokenize{`}%
       \fi
     \else
@@ -3146,7 +3170,7 @@
       \ifwindows
         \detokenize{for /f "usebackq tokens=*" }\@percentchar\detokenize{a in (`kpsewhich} #1\detokenize{`) do}\space
       \fi
-    \fi    
+    \fi
     \MintedPython\detokenize{ -c "import sys; import os;
     import textwrap;
     from io import open;
@@ -3231,7 +3255,7 @@
 % \end{macro}
 %
 % \begin{macro}{\minted at langlinenosoff}
-% 
+%
 %    \begin{macrocode}
 \newcommand{\minted at langlinenosoff}{%
   \setcounter{minted at lang\minted at lang}{\value{FancyVerbLine}}%
@@ -3538,7 +3562,7 @@
     \def\minted at shortname{#2}%
   \else
     \def\minted at shortname{#1}%
-  \fi    
+  \fi
   \expandafter\newmint at i\expandafter{\minted at shortname}{#2}{#3}}
 \def\newmint at i#1#2#3{%
   \expandafter\newcommand\csname#1\endcsname{%

Modified: trunk/Master/texmf-dist/tex/latex/minted/minted.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/minted/minted.sty	2023-12-18 20:56:39 UTC (rev 69162)
+++ trunk/Master/texmf-dist/tex/latex/minted/minted.sty	2023-12-18 20:57:13 UTC (rev 69163)
@@ -27,10 +27,10 @@
 %% and the derived file minted.sty.
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{minted}
-    [2023/09/12 v2.8 Yet another Pygments shim for LaTeX]
+    [2023/12/18 v2.9 Yet another Pygments shim for LaTeX]
 \RequirePackage{keyval}
 \RequirePackage{kvoptions}
-\RequirePackage{fvextra}
+\RequirePackage{fvextra}[2022/11/30]
 \RequirePackage{ifthen}
 \IfFileExists{shellesc.sty}
  {\RequirePackage{shellesc}
@@ -550,7 +550,8 @@
   \csname minted at PYGdef@\minted at style\endcsname
   \minted at patch@PYGZsq
   \minted at patch@PYGZhy
-}
+  \ifthenelse{\equal{\minted at get@opt{ignorelexererrors}{true}}{true}}%
+   {\let\PYG at tok@err\relax}{}}
 \ifthenelse{\boolean{minted at draft}}{\renewcommand{\minted at defstyle}[1]{}}{}
 \newcommand{\minted at patch@PYGZsq}{%
   \ifcsname PYGZsq\endcsname
@@ -716,6 +717,7 @@
 \minted at def@optfv{fontencoding}
 \minted at def@opt{bgcolor}
 \minted at def@opt at switch{autogobble}
+\minted at def@opt at switch{ignorelexererrors}
 \newcommand{\minted at encoding}{\minted at get@opt{encoding}{UTF8}}
 \newenvironment{minted at snugshade*}[1]{%
   \def\FrameCommand##1{\hskip\@totalleftmargin



More information about the tex-live-commits mailing list.