texlive[65252] Master/texmf-dist: minted (12dec22)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 12 22:01:06 CET 2022


Revision: 65252
          http://tug.org/svn/texlive?view=revision&revision=65252
Author:   karl
Date:     2022-12-12 22:01:06 +0100 (Mon, 12 Dec 2022)
Log Message:
-----------
minted (12dec22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/minted/minted.pdf
    trunk/Master/texmf-dist/source/latex/minted/minted.dtx
    trunk/Master/texmf-dist/source/latex/minted/minted.ins
    trunk/Master/texmf-dist/tex/latex/minted/minted.sty
    trunk/Master/texmf-dist/tex/latex/minted/minted1.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	2022-12-12 21:00:50 UTC (rev 65251)
+++ trunk/Master/texmf-dist/source/latex/minted/minted.dtx	2022-12-12 21:01:06 UTC (rev 65252)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2013-2021 by Geoffrey M. Poore <gpoore at gmail.com>
+% Copyright (C) 2013-2022 by Geoffrey M. Poore <gpoore at gmail.com>
 % Copyright (C) 2010-2011 by Konrad Rudolph <konrad_rudolph at madrat.net>
 % ---------------------------------------------------------------------------
 % This work may be distributed and/or modified under the
@@ -31,7 +31,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{minted}
 %<*package>
-    [2021/12/24 v2.6 Yet another Pygments shim for LaTeX]
+    [2022/12/12 v2.7 Yet another Pygments shim for LaTeX]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -55,6 +55,7 @@
 \usepackage{multicol}
 \usepackage{hyperref}
 
+\newcommand{\env}[1]{\texttt{#1}}
 
 \makeatletter
 % The typesetting for macrocode doesn't use \@noligs, which upquote modifies.
@@ -198,6 +199,8 @@
 \setlength{\parindent}{0pt}
 \addtolength{\parskip}{0.5\baselineskip}
 
+\def\warn{\textcolor{red}{\large\textbf{\textsf{WARNING}}}}
+
 \begin{document}
 \DocInput{minted.dtx}
 \PrintIndex
@@ -205,7 +208,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{2593}
+% \CheckSum{2548}
 %
 % \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
@@ -226,6 +229,18 @@
 %
 %
 %
+% \begin{changelog}{v2.7}{2022/12/12}
+% \item Reimplemented \texttt{\string\mintinline} to use \texttt{fvextra}'s argument reading and processing macros, and to use \texttt{fvextra}'s \texttt{\string\Verb} internally.  \texttt{\string\mintinline} now works with all line breaking options supported by \texttt{fvextra}'s \texttt{\string\Verb}, including \texttt{breakanywhere} (\#329, \#340).  It now gives better results when used inside other commands, since it uses \texttt{fvextra}'s retokenization macros.  It is now compatible with \texttt{hyperref} for PDF strings such as bookmarks.
+% \item Reimplemented \texttt{\string\newmintinline} based on new \texttt{\string\mintinline}.
+% \item Reimplemented \texttt{\string\mint} to use \texttt{fvextra}'s argument reading and processing macros.  It now gives better results when used inside other commands, since it uses \texttt{fvextra}'s retokenization macros.  Fixed a bug that caused a continued paragraph after \texttt{\string\mint} to be indented (\#218).
+% \item Reimplemented \texttt{\string\newmint} based on new \texttt{\string\mint}.  Commands created with \texttt{\string\newmint} can now use curly braces as delimiters, just like \texttt{\string\mint} (\#254).
+% \item Settings passed to \Verb{pygmentize} as command-line options are now quoted.  This prevents \Verb{escapeinside} characters from being interpreted as special shell characters (\#179, \#262).
+% \item Fixed bug with \texttt{autogobble} that produced incorrect dedent when using \texttt{lastline} with the lines beyond \texttt{lastline} having less indentation than the selected range (\#326).
+% \item Fixed unintended line breaks after hyphens under LuaTeX (\#263).
+% \item Added warning to documentation of \Verb{\inputminted} regarding filenames and shell command execution (\#338).
+% \end{changelog}
+%
+%
 % \begin{changelog}{v2.6}{2021/12/24}
 % \item \texttt{autogobble} automatically uses \texttt{python} or \texttt{python3} executables, depending on availability, instead of requiring \texttt{python}.  A custom executable can be specified by redefining \texttt{\string\MintedPython} (\#277, \#287).
 % \item Fixed \texttt{autogobble} compatibility with \texttt{fancyvrb} 4.0+ (\#315, \#316).
@@ -318,7 +333,7 @@
 %
 %
 % \begin{changelog}{v2.0}{2015/01/31}
-% \item Added the compatibility package \texttt{minted1}, which provides the \pkg{minted} 1.7 code.  This may be loaded when 1.7 compatibility is required.  This package works with other packages that \texttt{\string\RequirePackage\{minted\}}, so long as it is loaded first.
+% \item Added the compatibility package \texttt{minted1}, which provides the \texpkg{minted} 1.7 code.  This may be loaded when 1.7 compatibility is required.  This package works with other packages that \texttt{\string\RequirePackage\{minted\}}, so long as it is loaded first.
 % \item Moved all old \texttt{\string\changes} into \texttt{changelog}.
 % \end{changelog}
 %
@@ -345,7 +360,7 @@
 % \item Improved behavior of \texttt{\string\mint} and \texttt{\string\mintinline} in \texttt{draft} mode.
 % \item The \texttt{\string\mint} command now has the additional capability to take code delimited by paired curly braces \texttt{\{\}}.
 % \item It is now possible to set options only for \texttt{\string\mintinline} using the new \texttt{\string\setmintedinline} command.  Inline options override options specified via \texttt{\string\setminted}.
-% \item Completely rewrote option handling.  \pkg{fancyvrb} options are now handled on the \LaTeX\ side directly, rather than being passed to Pygments and then returned.  This makes caching more efficient, since code is no longer rehighlighted just because \pkg{fancyvrb} options changed.
+% \item Completely rewrote option handling.  \texpkg{fancyvrb} options are now handled on the \LaTeX\ side directly, rather than being passed to Pygments and then returned.  This makes caching more efficient, since code is no longer rehighlighted just because \texpkg{fancyvrb} options changed.
 % \item Fixed buffer size error caused by using \texttt{cache} with a very large number of files (\#61).
 % \item Fixed \texttt{autogobble} bug that caused failure under some operating systems.
 % \item Added support for \texttt{escapeinside} (requires Pygments 2.0+; \#38).
@@ -435,10 +450,10 @@
 %
 % \GetFileInfo{minted.sty}
 %
-% \newcommand\pkg[1]{\textsf{#1}}
-% \newcommand\app[1]{\textsf{#1}}
+% \newcommand{\texpkg}[1]{\textsf{#1}}
+% \newcommand{\app}[1]{\textsf{#1}}
 %
-% \title{The \textcolor{minted at mint}{\pkg{minted}} package:\\Highlighted source code in \LaTeX}
+% \title{The \textcolor{minted at mint}{\texpkg{minted}} package:\\Highlighted source code in \LaTeX}
 % \author{Geoffrey M.\ Poore \\ \url{gpoore at gmail.com} \\ \href{https://github.com/gpoore/minted}{\texttt{github.com/gpoore/minted}} \\ ~\\ Originally created and maintained (2009--2013) by \\ Konrad Rudolph}
 % \date{\fileversion~from \filedate}
 %
@@ -445,7 +460,7 @@
 % \maketitle
 %
 % \begin{abstract}
-%   \noindent\pkg{minted} is a package that facilitates expressive syntax highlighting
+%   \noindent\texpkg{minted} is a package that facilitates expressive syntax highlighting
 %   using the powerful \app{Pygments} library. The package also provides options to
 %   customize the highlighted source code output.
 % \end{abstract}
@@ -473,7 +488,7 @@
 %
 %
 %
-% \pkg{minted} is a package that allows formatting source code in \LaTeX.
+% \texpkg{minted} is a package that allows formatting source code in \LaTeX.
 % For example:
 % \begin{VerbatimOut}[gobble=1]{minted.doc.out}
 %   \begin{minted}{<language>}
@@ -485,12 +500,12 @@
 % will highlight a piece of code in a chosen language.
 % The appearance can be customized with a number of options and color schemes.
 %
-% Unlike some other packages, most notably \pkg{listings}, \pkg{minted} requires
+% Unlike some other packages, most notably \texpkg{listings}, \texpkg{minted} requires
 % the installation of additional software, \app{Pygments}.
 % This may seem like a disadvantage, but there are also significant advantages.
 %
 % \app{Pygments} provides superior syntax highlighting compared to conventional packages.
-% For example, \pkg{listings} basically only highlights strings, comments and keywords.
+% For example, \texpkg{listings} basically only highlights strings, comments and keywords.
 % \app{Pygments}, on the other hand, can be completely customized to highlight any kind of token the
 % source language might support.
 % This might include special formatting sequences inside strings, numbers, different kinds of
@@ -528,21 +543,21 @@
 % If you don't have Python installed, you can download it from the \href{http://www.python.org/download/}{Python website} or
 % use your operating system's package manager.
 %
-% Some Python distributions include \pkg{Pygments} (see some of the options under ``Alternative Implementations'' on the Python site).  Otherwise, you will need to install \pkg{Pygments} manually. This may  be done by installing \href{http://pypi.python.org/pypi/setuptools}{\app{setuptools}}, which facilitates the distribution of Python applications.  You can then install \app{Pygments} using the following command:
+% Some Python distributions include \texpkg{Pygments} (see some of the options under ``Alternative Implementations'' on the Python site).  Otherwise, you will need to install \texpkg{Pygments} manually. This may  be done by installing \href{http://pypi.python.org/pypi/setuptools}{\app{setuptools}}, which facilitates the distribution of Python applications.  You can then install \app{Pygments} using the following command:
 % \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
 %   \$ sudo easy_install Pygments
 % \end{Verbatim}
-% Under Windows, you will not need the |sudo|, but may need to run the command prompt as administrator.  \pkg{Pygments} may also be installed with |pip|:
+% Under Windows, you will not need the |sudo|, but may need to run the command prompt as administrator.  \texpkg{Pygments} may also be installed with |pip|:
 % \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
 %   \$ pip install Pygments
 % \end{Verbatim}
 %
-% If you already have \app{Pygments} installed, be aware that the latest version is recommended (at least 1.4 or later).  Some features, such as |escapeinside|, will only work with 2.0+.  \pkg{minted} may work with versions as early as 1.2, but there are no guarantees.
+% If you already have \app{Pygments} installed, be aware that the latest version is recommended (at least 1.4 or later).  Some features, such as |escapeinside|, will only work with 2.0+.  \texpkg{minted} may work with versions as early as 1.2, but there are no guarantees.
 %
 %
 % \subsection{Required packages}
 %
-% \pkg{minted} requires that the following packages be available and reasonably up to date on your system.  All of these ship with recent \TeX\ distributions.
+% \texpkg{minted} requires that the following packages be available and reasonably up to date on your system.  All of these ship with recent \TeX\ distributions.
 %
 % \begin{multicols}{3}
 % \begingroup
@@ -573,10 +588,10 @@
 % \end{multicols}
 %
 %
-% \subsection{Installing \pkg{minted}}
+% \subsection{Installing \texpkg{minted}}
 % \label{sec:installing:installing}
 %
-% You can probably install \pkg{minted} with your \TeX\ distribution's package manager.  Otherwise, or if you want the absolute latest version, you can install it manually by following the directions below.
+% You can probably install \texpkg{minted} with your \TeX\ distribution's package manager.  Otherwise, or if you want the absolute latest version, you can install it manually by following the directions below.
 %
 % You may download |minted.sty| from the
 % \href{https://github.com/gpoore/minted}{project's homepage}.  We have to install the file so that \TeX\ is able to find it.
@@ -590,7 +605,7 @@
 % \subsection{Preliminary}
 % \label{sec:basic:preliminary}
 %
-% Since \pkg{minted} makes calls to the outside world (that is, \app{Pygments}), you need to tell the
+% Since \texpkg{minted} makes calls to the outside world (that is, \app{Pygments}), you need to tell the
 % \LaTeX{} processor about this by passing it the |-shell-escape| option or it won't allow such calls.
 % In effect, instead of calling the processor like this:
 % \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
@@ -610,7 +625,7 @@
 %
 % \subsubsection*{Working with OS X}
 %
-% If you are using \pkg{minted} with some versions/configurations of OS X, and are using caching with a large number of code blocks ($>256$), you may receive an error like
+% If you are using \texpkg{minted} with some versions/configurations of OS X, and are using caching with a large number of code blocks ($>256$), you may receive an error like
 %\begin{Verbatim}
 %OSError: [Errno 24] Too many open files:
 %\end{Verbatim}
@@ -620,7 +635,7 @@
 %
 % \subsection{A minimal complete example}
 %
-% The following file |minimal.tex| shows the basic usage of \pkg{minted}.
+% The following file |minimal.tex| shows the basic usage of \texpkg{minted}.
 %
 % \begin{VerbatimOut}[gobble=1]{minted.doc.out}
 %   \documentclass{article}
@@ -656,7 +671,7 @@
 % \subsection{Formatting source code}
 %
 % \DescribeEnv{minted}
-% Using \pkg{minted} is straightforward. For example, to highlight some Python source code we might use
+% Using \texpkg{minted} is straightforward. For example, to highlight some Python source code we might use
 % the following code snippet (result on the right):
 %
 % \begin{example}
@@ -694,15 +709,17 @@
 %   X\mintinline{python}{print(x**2)}X
 % \end{example}
 %
-% The syntax is  \cmd\mintinline\oarg{options}\marg{language}\meta{delim}\meta{code}\meta{delim}.  The delimiters can be a pair of characters, as for \cmd\mint.  They can also be a matched pair of curly braces, |{}|.
+% The syntax is  \cmd\mintinline\oarg{options}\marg{language}\meta{delim}\meta{code}\meta{delim}.  The delimiters can be a single repeated character, just like for \cmd{\verb}.  They can also be a pair of curly braces, |{}|.  Curly braces are required when \cmd{\mintinline} is used in a movable argument, such as in a \cmd{\section}.
 %
-% The command has been carefully crafted so that in most cases it will function correctly when used inside other commands.\footnote{For example, \mintinline{latex}{\mintinline} works in footnotes!  The main exception is when the code contains the percent \texttt{\%} or hash \texttt{\#} characters, or unmatched curly braces.}
+% \cmd{\mintinline} has been carefully crafted so that in most cases it will function correctly when used inside other commands.  The main exception is when the code contains the percent \texttt{\%} or hash \texttt{\#} characters, or unmatched curly braces.  For example, \cmd{\mintinline} works in \cmd{\footnote} and \cmd{\section}!  The code typesetting for \cmd{\mintinline} is based on \texpkg{fvextra}'s \cmd{\Verb}.  See the \href{https://github.com/gpoore/fvextra/}{\texpkg{fvextra} documentation on \cmd{\Verb}} for details about functionality and limitations.
 %
 % \DescribeMacro{\inputminted}
 % Finally, there's the |\inputminted| command to read and format whole files.
 % Its syntax is \cmd\inputminted\oarg{options}\marg{language}\marg{filename}.
 %
+% \warn:  \meta{filename} is used to generate a shell command for highlighing the file.  Due to limitations in the design of \texpkg{minted} and limitations with TeX as a programming language, there is currently no escaping or sanitization of the filename as part of this process.  Providing a malformed filename can execute arbitrary system commands.  For example, providing ``|file.txt; touch file2.txt|'' as \meta{filename} could highlight one file while subsequently creating a new file.  (Issue \href{https://github.com/gpoore/minted/issues/338}{\#338}.)
 %
+%
 % \subsection{Using different styles}
 %
 % \DescribeMacro{\usemintedstyle}
@@ -720,7 +737,7 @@
 %
 %
 % Creating your own styles is also easy. Just follow the instructions provided on the
-% \href{http://pygments.org/docs/styles/#creating-own-styles}{\pkg{Pygments} website}.
+% \href{http://pygments.org/docs/styles/#creating-own-styles}{\texpkg{Pygments} website}.
 %
 %
 % \subsection{Supported languages}
@@ -735,7 +752,7 @@
 % \section{Floating listings}\label{sec:float}
 %
 % \DescribeEnv{listing}
-% \pkg{minted} provides the |listing| environment to wrap around a source code block.  This puts the code into a floating box, with the default placement |tbp| like figures and tables.  You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is, as for the |figure| and |table| environments):
+% \texpkg{minted} provides the |listing| environment to wrap around a source code block.  This puts the code into a floating box, with the default placement |tbp| like figures and tables.  You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is, as for the |figure| and |table| environments):
 % \begin{VerbatimOut}[gobble=1]{minted.doc.out}
 %   \begin{listing}[H]
 %     \mint{cl}/(car (cons 1 '(2)))/
@@ -755,13 +772,13 @@
 % \end{minipage}}
 % \hfill\hfill
 %
-% The default |listing| placement can be modified easily.  When the package option |newfloat=false| (default), the \pkg{float} package is used to create the |listing| environment.  Placement can be modified by redefining |\fps at listing|.  For example,
+% The default |listing| placement can be modified easily.  When the package option |newfloat=false| (default), the \texpkg{float} package is used to create the |listing| environment.  Placement can be modified by redefining |\fps at listing|.  For example,
 %\begin{verbatim}
 %\makeatletter
 %\renewcommand{\fps at listing}{htp}
 %\makeatother
 %\end{verbatim}
-% When |newfloat=true|, the more powerful \pkg{newfloat} package is used to create the |listing| environment.  In that case, \pkg{newfloat} commands are available to customize |listing|:
+% When |newfloat=true|, the more powerful \texpkg{newfloat} package is used to create the |listing| environment.  In that case, \texpkg{newfloat} commands are available to customize |listing|:
 %\begin{verbatim}
 %\SetupFloatingEnvironment{listing}{placement=htp}
 %\end{verbatim}
@@ -775,9 +792,9 @@
 % \end{example}
 %
 % \subsection*{Customizing the \texttt{listing} environment}
-% By default, the |listing| environment is created using the \pkg{float} package.  In that case, the |\listingscaption| and |\listoflistingscaption| macros described below may be used to customize the caption and list of listings.  If \pkg{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}{\pkg{newfloat}} package instead.  \pkg{newfloat} is part of \href{http://www.ctan.org/pkg/caption}{\pkg{caption}}, which provides many options for customizing captions.
+% 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 \pkg{newfloat} is used to create the |listing| environment, customization should be achieved using \pkg{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}
@@ -784,7 +801,7 @@
 % And ``List of Listings'' could be changed to ``List of Program Code'' with %\begin{verbatim}
 %\SetupFloatingEnvironment{listing}{listname=List of Program Code}
 %\end{verbatim}
-% Refer to the \pkg{newfloat} and \pkg{caption} documentation for additional information.
+% Refer to the \texpkg{newfloat} and \texpkg{caption} documentation for additional information.
 %
 % \DescribeMacro{\listingscaption}
 % (Only applies when package option |newfloat| is not used.) The string ``Listing'' in a listing's caption can be changed.
@@ -807,7 +824,7 @@
 %
 % \DescribeMacro{chapter}
 % To control how \LaTeX{} counts the |listing| floats, you can pass either the
-% |section| or |chapter| option when loading the \pkg{minted} package.
+% |section| or |chapter| option when loading the \texpkg{minted} package.
 % For example, the following will cause listings to be counted by chapter:
 %
 % \mint[frame=lines]{latex}/\usepackage[chapter]{minted}/
@@ -814,7 +831,7 @@
 %
 %
 % \DescribeMacro{cache=\meta{boolean} (default:~true)}
-% \pkg{minted} works by saving code to a temporary file, highlighting the code via \app{Pygments} and saving the output to another temporary file, and inputting the output into the \LaTeX\ document.  This process can become quite slow if there are several chunks of code to highlight.  To avoid this, the package provides a |cache| option.  This is on by default.
+% \texpkg{minted} works by saving code to a temporary file, highlighting the code via \app{Pygments} and saving the output to another temporary file, and inputting the output into the \LaTeX\ document.  This process can become quite slow if there are several chunks of code to highlight.  To avoid this, the package provides a |cache| option.  This is on by default.
 %
 % The |cache| option creates a directory |_minted-|\meta{jobname} in the document's root directory (this may be customized with the |cachedir| option).\footnote{The directory is actually named using a ``sanitized'' copy of \meta{jobname}, in which spaces and asterisks have been replaced by underscores, and double quotation marks have been stripped.  If the file name contains spaces, \texttt{\string\jobname} will contain a quote-wrapped name, except under older versions of MiKTeX which used the name with spaces replaced by asterisks.  Using a ``sanitized'' \meta{jobname} is simpler than accomodating the various escaping conventions.}  Files of highlighted code are stored in this directory, so that the code will not have to be highlighted again in the future.  In most cases, caching will significantly speed up document compilation.
 %
@@ -835,7 +852,7 @@
 %
 %
 % \DescribeMacro{finalizecache=\meta{boolean} (default:~false)}
-% In some cases, it may be desirable to use \pkg{minted} in an environment in which |-shell-escape| is not allowed.  A document might be submitted to a publisher or preprint server or used with an online service that does not support |-shell-escape|.  This is possible as long as \pkg{minted} content does not need to be modified.
+% In some cases, it may be desirable to use \texpkg{minted} in an environment in which |-shell-escape| is not allowed.  A document might be submitted to a publisher or preprint server or used with an online service that does not support |-shell-escape|.  This is possible as long as \texpkg{minted} content does not need to be modified.
 %
 % Compiling with the |finalizecache| option prepares the cache for use in an environment without |-shell-escape|.\footnote{Ordinarily, cache files are named using an MD5 hash of highlighting settings and highlighted text.  \texttt{finalizecache} renames cache files using a \texttt{listing<number>.pygtex} scheme.  This makes it simpler to match up document content and cache files, and is also necessary for the XeTeX engine since prior to TeX Live 2016 it lacked the built-in MD5 capabilities that pdfTeX and LuaTeX have.}  Once this has been done, the |finalizecache| option may be swapped for the |frozencache| option, which will then use the frozen (static) cache in the future, without needing |-shell-escape|.
 %
@@ -848,22 +865,22 @@
 % \DescribeMacro{frozencache=\meta{boolean} (default:~false)}
 % 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 \pkg{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, \pkg{minted} content cannot be modified, except by editing the cache files directly.  Changing any \pkg{minted} settings that require Pygments or Python is not possible.  If \pkg{minted} content is incorrectly modified after \texttt{frozencache} is turned on, \pkg{minted} \emph{cannot} detect the modification.}
+% \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 \pkg{minted} settings or content have not been modified in an invalid fashion, you can test the cache using the following procedure.
+% 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|.
 % \item Compile the document in an environment that supports |-shell-escape|, with |finalizecache=true| and |frozencache=false|.  This essentially regenerates the frozen (static) cache.
-% \item Compare the original cache with the newly generated cache.  Under Linux and OS X, you could use |diff|; under Windows, you probably want |fc|.  If \pkg{minted} content and settings have not been modified in an invalid fashion, all files will be identical (assuming that compatible versions of Pygments are used for both caches).
+% \item Compare the original cache with the newly generated cache.  Under Linux and OS X, you could use |diff|; under Windows, you probably want |fc|.  If \texpkg{minted} content and settings have not been modified in an invalid fashion, all files will be identical (assuming that compatible versions of Pygments are used for both caches).
 % \end{enumerate}
 %
 %
 % \DescribeMacro{draft=\meta{boolean} (default:~false)}
-% This uses \pkg{fancyvrb} alone for all typesetting; \app{Pygments} is not used.  This trades syntax highlighting and some other \app{minted} features for faster compiling.  Performance should be essentially the same as using \pkg{fancyvrb} directly; no external temporary files are used.  Note that if you are not changing much code between compiles, the difference in performance between caching and draft mode may be minimal.  Also note that |draft| settings are typically inherited from the document class.
+% This uses \texpkg{fancyvrb} alone for all typesetting; \app{Pygments} is not used.  This trades syntax highlighting and some other \app{minted} features for faster compiling.  Performance should be essentially the same as using \texpkg{fancyvrb} directly; no external temporary files are used.  Note that if you are not changing much code between compiles, the difference in performance between caching and draft mode may be minimal.  Also note that |draft| settings are typically inherited from the document class.
 %
 % Draft mode does not support |autogobble|.  Regular |gobble|, |linenos|, and most other options not related to syntax highlighting will still function in draft mode.
 %
-% Documents can usually be compiled without shell escape in draft mode.  The \pkg{ifplatform} package may issue a warning about limited functionality due to shell escape being disabled, but this may be ignored in almost all cases.  (Shell escape is only really required if you have an unusual system configuration such that the |\ifwindows| macro must fall back to using shell escape to determine the system.  See the \pkg{ifplatform} documentation for more details:  \url{http://www.ctan.org/pkg/ifplatform}.)
+% Documents can usually be compiled without shell escape in draft mode.  The \texpkg{ifplatform} package may issue a warning about limited functionality due to shell escape being disabled, but this may be ignored in almost all cases.  (Shell escape is only really required if you have an unusual system configuration such that the |\ifwindows| macro must fall back to using shell escape to determine the system.  See the \texpkg{ifplatform} documentation for more details:  \url{http://www.ctan.org/pkg/ifplatform}.)
 %
 % If the |cache| option is set, then all existing cache files will be kept while draft mode is on.  This allows caching to be used intermitently with draft mode without requiring that the cache be completely recreated each time.  Automatic cleanup of cached files will resume as soon as draft mode is turned off.  (This assumes that the auxiliary file has not been deleted in the meantime; it contains the cache history and allows automatic cleanup of unused files.)
 %
@@ -873,15 +890,15 @@
 %
 %
 % \DescribeMacro{kpsewhich=\meta{boolean} (default:~false)}
-% This option uses |kpsewhich| to locate files that are to be highlighted.  Some build tools such as |texi2pdf| function by modifying |TEXINPUTS|; in some cases, users may customize |TEXINPUTS| as well.  The |kpsewhich| option allows \pkg{minted} to work with such configurations.
+% This option uses |kpsewhich| to locate files that are to be highlighted.  Some build tools such as |texi2pdf| function by modifying |TEXINPUTS|; in some cases, users may customize |TEXINPUTS| as well.  The |kpsewhich| option allows \texpkg{minted} to work with such configurations.
 %
 % This option may add a noticeable amount of overhead on some systems, or with some system configurations.
 %
-% This option does \emph{not} make \pkg{minted} work with the |-output-directory| and |-aux-directory| command-line options for \LaTeX.  For those, see the |outputdir| package option.
+% This option does \emph{not} make \texpkg{minted} work with the |-output-directory| and |-aux-directory| command-line options for \LaTeX.  For those, see the |outputdir| package option.
 %
 %
 % \DescribeMacro{langlinenos=\meta{boolean} (default:~false)}
-% \pkg{minted} uses the \pkg{fancyvrb} package behind the scenes for the code typesetting.  \pkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified.  For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off.  The |langlinenos| option makes |firstnumber| work for each language individually with all |minted| and |\mint| usages.  For example, consider the code and output below.
+% \texpkg{minted} uses the \texpkg{fancyvrb} package behind the scenes for the code typesetting.  \texpkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified.  For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off.  The |langlinenos| option makes |firstnumber| work for each language individually with all |minted| and |\mint| usages.  For example, consider the code and output below.
 %
 % \begin{VerbatimOut}[gobble=1]{minted.doc.out}
 %   \begin{minted}[linenos]{python}
@@ -911,11 +928,11 @@
 %
 %
 % \DescribeMacro{newfloat=\meta{boolean} (default:~false)}
-% By default, the |listing| environment is created using the \pkg{float} package.  The |newfloat| option creates the environment using \pkg{newfloat} instead.  This provides better integration with the \pkg{caption} package.
+% By default, the |listing| environment is created using the \texpkg{float} package.  The |newfloat| option creates the environment using \texpkg{newfloat} instead.  This provides better integration with the \texpkg{caption} package.
 %
 %
 % \DescribeMacro{outputdir=\meta{directory} (default:~\meta{none})}
-% The |-output-directory| and |-aux-directory| (MiKTeX) command-line options for \LaTeX\ cause problems for \pkg{minted}, because the \pkg{minted} temporary files are saved in |<outputdir>|, but \pkg{minted} still looks for them in the document root directory.  There is no way to access the value of the command-line option so that \pkg{minted} can automatically look in the right place.  But it is possible to allow the output directory to be specified manually as a package option.
+% The |-output-directory| and |-aux-directory| (MiKTeX) command-line options for \LaTeX\ cause problems for \texpkg{minted}, because the \texpkg{minted} temporary files are saved in |<outputdir>|, but \texpkg{minted} still looks for them in the document root directory.  There is no way to access the value of the command-line option so that \texpkg{minted} can automatically look in the right place.  But it is possible to allow the output directory to be specified manually as a package option.
 %
 % The output directory should be specified using an absolute path or a path relative to the document root directory.  Paths should use forward slashes, even under Windows.  Special characters must be escaped, while spaces require quoting and need the entire \meta{directory} to be wrapped in curly braces |{}|.  See |cachedir| above for examples of escaping and quoting.
 %
@@ -922,12 +939,12 @@
 %
 % \DescribeMacro{section}
 % To control how \LaTeX{} counts the |listing| floats, you can pass either the
-% |section| or |chapter| option when loading the \pkg{minted} package.
+% |section| or |chapter| option when loading the \texpkg{minted} package.
 %
 %
 % \subsection{Macro option usage}
 %
-% All \pkg{minted} highlighting commands accept the same set of options.
+% All \texpkg{minted} highlighting commands accept the same set of options.
 % Options are specified as a comma-separated list of |key=value| pairs.
 % For example, we can specify that the lines should be numbered:
 %
@@ -944,7 +961,7 @@
 %
 % An option value of |true| may also be omitted entirely (including the ``|=|'').
 % To customize the display of the line numbers further, override the |\theFancyVerbLine| command.
-% Consult the \pkg{fancyvrb} documentation for details.
+% Consult the \texpkg{fancyvrb} documentation for details.
 %
 % |\mint| accepts the same options:
 %
@@ -994,7 +1011,7 @@
 % \newcommand\appliesto[1]{\textsf{[For #1 only]}}
 %
 % Following is a full list of available options.
-% For more detailed option descriptions please refer to the \pkg{fancyvrb} and \app{Pygments} documentation.
+% For more detailed option descriptions please refer to the \texpkg{fancyvrb} and \app{Pygments} documentation.
 %
 % \begin{optionlist}
 %   \item[autogobble (boolean) (false)]
@@ -1013,11 +1030,11 @@
 %
 %
 % \item[beameroverlays (boolean) (false)]
-% Give the |<| and |>| characters their normal text meanings when used with |escapeinside| and |texcomments|, so that \pkg{beamer} overlays of the form |\only<1>{...}| will work.
+% Give the |<| and |>| characters their normal text meanings when used with |escapeinside| and |texcomments|, so that \texpkg{beamer} overlays of the form |\only<1>{...}| will work.
 %
 %
 %   \item[breakafter (string) (\meta{none})]
-%     Break lines after specified characters, not just at spaces, when \texttt{breaklines=true}.  Does not apply to |\mintinline|.
+%     Break lines after specified characters, not just at spaces, when \texttt{breaklines=true}.
 %
 % For example, \texttt{breakafter=-/} would allow breaks after any hyphens or slashes.  Special characters given to \texttt{breakafter} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
 %
@@ -1039,7 +1056,7 @@
 %     The symbol inserted post-break for breaks inserted by \texttt{breakafter}.
 %
 %   \item[breakanywhere (boolean) (false)]
-%     Break lines anywhere, not just at spaces, when \texttt{breaklines=true}.  Does not apply to |\mintinline|.
+%     Break lines anywhere, not just at spaces, when \texttt{breaklines=true}.
 %
 % \begingroup
 % \fvset{xrightmargin=1em}
@@ -1060,7 +1077,7 @@
 %     When a line is broken, automatically indent the continuation lines to the indentation level of the first line.  When \texttt{breakautoindent} and \texttt{breakindent} are used together, the indentations add.  This  indentation is combined with \texttt{breaksymbolindentleft} to give the total actual left indentation.  Does not apply to \texttt{\string\mintinline}.
 %
 %   \item[breakbefore (string) (\meta{none})]
-%     Break lines before specified characters, not just at spaces, when \texttt{breaklines=true}.  Does not apply to |\mintinline|.
+%     Break lines before specified characters, not just at spaces, when \texttt{breaklines=true}.
 %
 % For example, \texttt{breakbefore=A} would allow breaks before capital A's.  Special characters given to \texttt{breakbefore} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
 %
@@ -1100,7 +1117,7 @@
 %   \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.  Currently, only \texttt{breakbytoken} and \texttt{breakbytokenanywhere} work with |\mintinline|.  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.)
+% 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.)
 %
 % \begin{example}
 %   ...text.
@@ -1112,7 +1129,7 @@
 %
 %     Breaking in \texttt{minted} and \texttt{\string\mint} may be customized in several ways.  To customize the indentation of broken lines, see \texttt{breakindent} and \texttt{breakautoindent}.  To customize the line continuation symbols, use \texttt{breaksymbolleft} and \texttt{breaksymbolright}.  To customize the separation between the continuation symbols and the code, use \texttt{breaksymbolsepleft} and \texttt{breaksymbolsepright}.  To customize the extra indentation that is supplied to make room for the break symbols, use \texttt{breaksymbolindentleft} and \texttt{breaksymbolindentright}.  Since only the left-hand symbol is used by default, it may also be modified using the alias options \texttt{breaksymbol}, \texttt{breaksymbolsep}, and \texttt{breaksymbolindent}.  Note than none of these options applies to \texttt{\string\mintinline}, since they are not relevant in the inline context.
 %
-% An example using these options to customize the \texttt{minted} environment is shown below.  This uses the \texttt{\string\carriagereturn} symbol from the \pkg{dingbat} package.
+% An example using these options to customize the \texttt{minted} environment is shown below.  This uses the \texttt{\string\carriagereturn} symbol from the \texpkg{dingbat} package.
 %
 % \begingroup
 % \fvset{breaklines, xleftmargin=2em, xrightmargin=2em}
@@ -1132,11 +1149,11 @@
 % \end{longexample}
 % \endgroup
 %
-%     Automatic line breaks are limited with \app{Pygments} styles that use a colored background behind large chunks of text.  This coloring is accomplished with \texttt{\string\colorbox}, which cannot break across lines.  It may be possible to create an alternative to \texttt{\string\colorbox} that supports line breaks, perhaps with \pkg{TikZ}, but the author is unaware of a satisfactory solution.  The only current alternative is to redefine \texttt{\string\colorbox} so that it does nothing.  For example,
+%     Automatic line breaks are limited with \app{Pygments} styles that use a colored background behind large chunks of text.  This coloring is accomplished with \texttt{\string\colorbox}, which cannot break across lines.  It may be possible to create an alternative to \texttt{\string\colorbox} that supports line breaks, perhaps with \texpkg{TikZ}, but the author is unaware of a satisfactory solution.  The only current alternative is to redefine \texttt{\string\colorbox} so that it does nothing.  For example,
 %\begin{Verbatim}
 %\AtBeginEnvironment{minted}{\renewcommand{\colorbox}[3][]{#3}}
 %\end{Verbatim}
-%     uses the \pkg{etoolbox} package to redefine \texttt{\string\colorbox} within all \texttt{minted} environments.
+%     uses the \texpkg{etoolbox} package to redefine \texttt{\string\colorbox} within all \texttt{minted} environments.
 %
 %     Automatic line breaks will not work with \texttt{showspaces=true} unless you use \texttt{breakanywhere} or \texttt{breakafter=\string\space}.
 %
@@ -1146,7 +1163,7 @@
 %   \item[breaksymbolleft (string) (\string\tiny\string\ensuremath\{\string\hookrightarrow\}, {\tiny\ensuremath{\hookrightarrow}})]
 %     The symbol used at the beginning (left) of continuation lines when \texttt{breaklines=true}.  To have no symbol, simply set \texttt{breaksymbolleft} to an empty string (``\texttt{=,}'' or ``\texttt{=\{\}}'').  The symbol is wrapped within curly braces \texttt{\{\}} when used, so there is no danger of formatting commands such as \texttt{\string\tiny} ``escaping.''
 %
-%     The \texttt{\string\hookrightarrow} and \texttt{\string\hookleftarrow} may be further customized by the use of the \texttt{\string\rotatebox} command provided by \pkg{graphicx}.  Additional arrow-type symbols that may be useful are available in the \pkg{dingbat} (\texttt{\string\carriagereturn}) and \pkg{mnsymbol} (hook and curve arrows) packages, among others.
+%     The \texttt{\string\hookrightarrow} and \texttt{\string\hookleftarrow} may be further customized by the use of the \texttt{\string\rotatebox} command provided by \texpkg{graphicx}.  Additional arrow-type symbols that may be useful are available in the \texpkg{dingbat} (\texttt{\string\carriagereturn}) and \texpkg{mnsymbol} (hook and curve arrows) packages, among others.
 %
 %     Does not apply to \texttt{\string\mintinline}.
 %
@@ -1191,7 +1208,7 @@
 %
 %
 % \item[breaksymbolsepright (dimension) (\meta{breaksymbolseprightnchars})]
-% The \emph{minimum} separation between the |breaksymbolright| and the adjacent text.  This is the separation between |breaksymbolright| and the furthest extent to which adjacent text could reach.  In practice, |\linewidth| will typically not be an exact integer multiple of the character width (assuming a fixed-width font), so the actual separation between the |breaksymbolright| and adjacent text will generally be larger than |breaksymbolsepright|.  This ensures that break symbols have the same spacing from the margins on both left and right.  If the same spacing from text is desired instead, |breaksymbolsepright| may be adjusted.  (See the definition of |\FV at makeLineNumber| in \pkg{fvextra} for implementation details.)
+% The \emph{minimum} separation between the |breaksymbolright| and the adjacent text.  This is the separation between |breaksymbolright| and the furthest extent to which adjacent text could reach.  In practice, |\linewidth| will typically not be an exact integer multiple of the character width (assuming a fixed-width font), so the actual separation between the |breaksymbolright| and adjacent text will generally be larger than |breaksymbolsepright|.  This ensures that break symbols have the same spacing from the margins on both left and right.  If the same spacing from text is desired instead, |breaksymbolsepright| may be adjusted.  (See the definition of |\FV at makeLineNumber| in \texpkg{fvextra} for implementation details.)
 %
 % \item[breaksymbolseprightnchars (integer) (2)]
 % Allows |breaksymbolsepright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
@@ -1211,7 +1228,7 @@
 %   \end{minted}
 % \end{example}
 %
-% This option puts \texttt{minted} environments and \texttt{\string\mint} commands in a \texttt{snugshade*} environment from the \pkg{framed} package, which supports breaks across pages.  (Prior to \pkg{minted} 2.2, a \texttt{minipage} was used, which prevented page breaks and gave undesirable spacing from surrounding text.)  Be aware that if \texttt{bgcolor} is used with \texttt{breaklines=true}, and a line break occurs just before a page break, then text may extend below the colored background in some instances.  It is best to use a more advanced framing package in those cases; see ``Framing alternatives'' below.
+% This option puts \texttt{minted} environments and \texttt{\string\mint} commands in a \texttt{snugshade*} environment from the \texpkg{framed} package, which supports breaks across pages.  (Prior to \texpkg{minted} 2.2, a \texttt{minipage} was used, which prevented page breaks and gave undesirable spacing from surrounding text.)  Be aware that if \texttt{bgcolor} is used with \texttt{breaklines=true}, and a line break occurs just before a page break, then text may extend below the colored background in some instances.  It is best to use a more advanced framing package in those cases; see ``Framing alternatives'' below.
 %
 % This option puts \texttt{\string\mintinline} inside a \texttt{\string\colorbox}, which \textbf{does not allow line breaks}.  If you want to use \texttt{\string\setminted} to set background colors, and only want background colors on \texttt{minted} and \texttt{\string\mint}, you may use \texttt{\string\setmintedinline\{bgcolor=\{\}\}} to turn off the coloring for inline commands.
 %
@@ -1219,16 +1236,16 @@
 %
 % \textbf{Framing alternatives}
 %
-% If you want more reliable and advanced options for background colors and framing, you should consider a more advanced framing package such as \pkg{mdframed} or \pkg{tcolorbox}.  It is easy to add framing to \pkg{minted} commands and environments using the \pkg{etoolbox} package, which is automatically loaded by \pkg{minted}.  For example, using \pkg{mdframed}:
+% If you want more reliable and advanced options for background colors and framing, you should consider a more advanced framing package such as \texpkg{mdframed} or \texpkg{tcolorbox}.  It is easy to add framing to \texpkg{minted} commands and environments using the \texpkg{etoolbox} package, which is automatically loaded by \texpkg{minted}.  For example, using \texpkg{mdframed}:
 %\begin{Verbatim}
 %\BeforeBeginEnvironment{minted}{\begin{mdframed}}
 %\AfterEndEnvironment{minted}{\end{mdframed}}
 %\end{Verbatim}
-% Some framing packages also provide built-in commands for such purposes.  For example, \pkg{mdframed} provides a \texttt{\string\surroundwithmdframed} command, which could be used to add a frame to all \texttt{minted} environments:
+% Some framing packages also provide built-in commands for such purposes.  For example, \texpkg{mdframed} provides a \texttt{\string\surroundwithmdframed} command, which could be used to add a frame to all \texttt{minted} environments:
 %\begin{Verbatim}
 %\surroundwithmdframed{minted}
 %\end{Verbatim}
-% \pkg{tcolorbox} even provides a built-in framing environment with \pkg{minted} support.  Simply use \texttt{\string\tcbuselibrary\{minted\}} in the preamble, and then put code within a \texttt{tcblisting} environment:
+% \texpkg{tcolorbox} even provides a built-in framing environment with \texpkg{minted} support.  Simply use \texttt{\string\tcbuselibrary\{minted\}} in the preamble, and then put code within a \texttt{tcblisting} environment:
 %\begin{Verbatim}
 %\begin{tcblisting}{<tcb options>,
 %                   minted language=<language>,
@@ -1237,7 +1254,7 @@
 %<code>
 %\end{tcblisting}
 %\end{Verbatim}
-% \pkg{tcolorbox} provides other commands and environments for fine-tuning listing appearance and for working with external code files.
+% \texpkg{tcolorbox} provides other commands and environments for fine-tuning listing appearance and for working with external code files.
 %
 %   \item[codetagify (list of strings) (\textrm{highlight \texttt{XXX}, \texttt{TODO}, \texttt{BUG}, and \texttt{NOTE}})]
 %     Highlight special code tags in comments and docstrings.
@@ -1250,7 +1267,7 @@
 %   \item[escapeinside (string) (\meta{none})]
 %   Escape to \LaTeX\ between the two characters specified in \texttt{\string(string\string)}.  All code between the two characters will be interpreted as \LaTeX\ and typeset accordingly.  This allows for additional formatting.  The escape characters need not be identical.  Special \LaTeX\ characters must be escaped when they are used as the escape characters (for example, \texttt{escapeinside=\textbackslash\#\textbackslash\%}).  Requires \app{Pygments} 2.0+.
 %
-% \textbf{Escaping does not work inside strings and comments (for comments, there is \texttt{texcomments}).  As of Pygments 2.0.2, this means that escaping is ``fragile'' with some lexers.}  Due to the way that Pygments implements \texttt{escapeinside}, any ``escaped'' \LaTeX\ code that resembles a string or comment for the current lexer may break \texttt{escapeinside}.  There is a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1118}{Pygments issue} for this case.  Additional details and a limited workaround for some scenarios are available on the \href{https://github.com/gpoore/minted/issues/70#issuecomment-111729930}{\pkg{minted} GitHub site}.
+% \textbf{Escaping does not work inside strings and comments (for comments, there is \texttt{texcomments}).  As of Pygments 2.0.2, this means that escaping is ``fragile'' with some lexers.}  Due to the way that Pygments implements \texttt{escapeinside}, any ``escaped'' \LaTeX\ code that resembles a string or comment for the current lexer may break \texttt{escapeinside}.  There is a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1118}{Pygments issue} for this case.  Additional details and a limited workaround for some scenarios are available on the \href{https://github.com/gpoore/minted/issues/70#issuecomment-111729930}{\texpkg{minted} GitHub site}.
 %
 % \begingroup  ^^A Need to prevent active "|" from causing problems
 % \catcode`\|=11
@@ -1263,7 +1280,7 @@
 % \end{example}
 % \endgroup
 %
-% \textbf{Note that when math is used inside escapes, any active characters beyond those that are normally active in verbatim can cause problems.}  Any package that relies on special active characters in math mode (for example, \pkg{icomma}) will produce errors along the lines of \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}.  This may be fixed by modifying \texttt{\string\@noligs}, as described at \url{http://tex.stackexchange.com/questions/223876}.
+% \textbf{Note that when math is used inside escapes, any active characters beyond those that are normally active in verbatim can cause problems.}  Any package that relies on special active characters in math mode (for example, \texpkg{icomma}) will produce errors along the lines of \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}.  This may be fixed by modifying \texttt{\string\@noligs}, as described at \url{http://tex.stackexchange.com/questions/223876}.
 %   \item[firstline (integer) (1)]
 %     The first line to be shown.
 %     All lines before that line are ignored and do not appear in the output.
@@ -1292,7 +1309,7 @@
 %     Remove the first $n$ characters from each input line.
 %
 % \item[highlightcolor (string) (LightCyan)]
-% Set the color used for |highlightlines|, using a predefined color name from \pkg{color} or \pkg{xcolor}, or a color defined via |\definecolor|.
+% Set the color used for |highlightlines|, using a predefined color name from \texpkg{color} or \texpkg{xcolor}, or a color defined via |\definecolor|.
 %
 %
 % \item[highlightlines (string) (\meta{none})]
@@ -1305,12 +1322,12 @@
 %     Changes capitalization of keywords.  Takes |lower|, |upper|, or |capitalize|.
 %   \item[label (string) (\emph{empty})]
 %     Add a label to the top, the bottom or both of the frames around the code.
-%     See the \pkg{fancyvrb} documentation for more information and examples.
+%     See the \texpkg{fancyvrb} documentation for more information and examples.
 %     \emph{Note:} This does \emph{not} add a |\label| to the current listing.
 %     To achieve that, use a floating environment (section \ref{sec:float}) instead.
 %   \item[labelposition (none \| topline \| bottomline \| all) (topline, all,  \textrm{or} none)]
 %     Position where to print the label (see above;  default: |topline| if one label is defined, |all| if two are defined, |none| else).
-%     See the \pkg{fancyvrb} documentation for more information.
+%     See the \texpkg{fancyvrb} documentation for more information.
 %   \item[lastline (integer) (\meta{last line of input})]
 %     The last line to be shown.
 %   \item[linenos (boolean) (false)]
@@ -1340,7 +1357,7 @@
 %     Essentially the same as |linenos|, except the side on which the numbers appear may be specified.
 %   \item[mathescape (boolean) (false)]
 %     Enable \LaTeX{} math mode inside comments.
-%     Usage as in package \pkg{listings}.
+%     Usage as in package \texpkg{listings}.
 %     See the note under \texttt{escapeinside} regarding math and ligatures.
 %   \item[numberblanklines (boolean) (true)]
 %     Enables or disables numbering of blank lines.
@@ -1395,7 +1412,7 @@
 %     Strip leading and trailing newlines from the input.
 %
 %
-% \item[tab (macro) ({\rmfamily\pkg{fancyvrb}'s} \string\FancyVerbTab, \FancyVerbTab)]
+% \item[tab (macro) ({\rmfamily\texpkg{fancyvrb}'s} \string\FancyVerbTab, \FancyVerbTab)]
 % Redefine the visible tab character.  Note that this is only used if |showtabs=true|.  |\rightarrowfill|, \hbox to 2em{\rightarrowfill}, may be a nice alternative.
 %
 %
@@ -1407,11 +1424,11 @@
 %     The number of spaces a tab is equivalent to.  If |obeytabs| is \emph{not} active, tabs will be converted into this number of spaces.  If |obeytabs| is active, tab stops will be set this number of space characters apart.
 %   \item[texcl (boolean) (false)]
 %     Enables \LaTeX{} code inside comments.
-%     Usage as in package \pkg{listings}.  See the note under \texttt{escapeinside} regarding math and ligatures.
+%     Usage as in package \texpkg{listings}.  See the note under \texttt{escapeinside} regarding math and ligatures.
 %   \item[texcomments (boolean) (false)]
 %     Enables \LaTeX{} code inside comments.  The newer name for |texcl|.  See the note under |escapeinside| regarding math and ligatures.
 %
-%     As of Pygments 2.0.2, \texttt{texcomments} fails with multiline C/C++ preprocessor directives, and may fail in some other circumstances.  This is because preprocessor directives are \href{http://pygments.org/docs/tokens/}{tokenized as \texttt{Comment.Preproc}}, so \texttt{texcomments} causes preprocessor directives to be treated as literal \LaTeX\ code.  \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1086/wrong-processing-of-in-c-c-macros-if-is}{An issue has been opened} at the Pygments site; additional details are also available on the \href{https://github.com/gpoore/minted/issues/66}{\pkg{minted} GitHub site}.
+%     As of Pygments 2.0.2, \texttt{texcomments} fails with multiline C/C++ preprocessor directives, and may fail in some other circumstances.  This is because preprocessor directives are \href{http://pygments.org/docs/tokens/}{tokenized as \texttt{Comment.Preproc}}, so \texttt{texcomments} causes preprocessor directives to be treated as literal \LaTeX\ code.  \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1086/wrong-processing-of-in-c-c-macros-if-is}{An issue has been opened} at the Pygments site; additional details are also available on the \href{https://github.com/gpoore/minted/issues/66}{\texpkg{minted} GitHub site}.
 %   \item[xleftmargin (dimension) (0)]
 %     Indentation to add before the listing.
 %   \item[xrightmargin (dimension) (0)]
@@ -1430,7 +1447,7 @@
 %
 % One option is to use \cmd\setminted, but even then you must still specify the language each time.
 %
-% \pkg{minted} therefore defines a set of commands that lets you define shortcuts for the highlighting commands.
+% \texpkg{minted} therefore defines a set of commands that lets you define shortcuts for the highlighting commands.
 % Each shortcut is specific for one programming language.
 %
 % \DescribeMacro{\newminted}
@@ -1458,7 +1475,7 @@
 %   \end{cppcode*}
 % \end{example}
 %
-% Notice the star ``|*|'' behind the environment name---due to restrictions in \pkg{fancyvrb}'s handling
+% Notice the star ``|*|'' behind the environment name---due to restrictions in \texpkg{fancyvrb}'s handling
 % of options, it is necessary to provide a \emph{separate} environment that accepts options, and the options
 % are \emph{not} optional on the starred version of the environment.
 %
@@ -1466,7 +1483,7 @@
 % If this name clashes with another environment or if you want to choose an own name for another reason, you may
 % do so by specifying it as the first argument: \cmd\newminted\oarg{environment name}\marg{language}\marg{options}.
 %
-% Like normal \pkg{minted} environments, environments created with |\newminted| may be used within other environment definitions.  Since the \pkg{minted} environments use \pkg{fancyvrb} internally, any environment based on them must include the \pkg{fancyvrb} command |\VerbatimEnvironment|.  This allows \pkg{fancyvrb} to determine the name of the environment that is being defined, and correctly find its end.  It is best to include this command at the beginning of the definition.  For example,
+% Like normal \texpkg{minted} environments, environments created with |\newminted| may be used within other environment definitions.  Since the \texpkg{minted} environments use \texpkg{fancyvrb} internally, any environment based on them must include the \texpkg{fancyvrb} command |\VerbatimEnvironment|.  This allows \texpkg{fancyvrb} to determine the name of the environment that is being defined, and correctly find its end.  It is best to include this command at the beginning of the definition.  For example,
 %\begin{Verbatim}
 %\newminted{cpp}{gobble=2,linenos}
 %\newenvironment{env}{\VerbatimEnvironment\begin{cppcode}}{\end{cppcode}}
@@ -1507,32 +1524,32 @@
 %
 % \section{FAQ and Troubleshooting}
 %
-% In some cases, \pkg{minted} may not give the desired result due to other document settings that it cannot control.  Common issues are described below, with workarounds or solutions.  You may also wish to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \pkg{minted} in a non-typical context.
+% In some cases, \texpkg{minted} may not give the desired result due to other document settings that it cannot control.  Common issues are described below, with workarounds or solutions.  You may also wish to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \texpkg{minted} in a non-typical context.
 %
 % \begin{itemize}
-% \item \textbf{There are intermittent ``I can't write on file'' errors.}  This can be caused by using \pkg{minted} in a directory that is synchronized with Dropbox or a similar file syncing program.  These programs can try to sync \pkg{minted}'s temporary files while it still needs to be able to modify them.  The solution is to turn off file syncing or use a directory that is not synced.
-% \item \textbf{I receive a ``Font Warning:  Some font shapes were not available'' message, or bold or italic seem to be missing.}  This is due to a limitation in the font that is currently in use for typesetting code.  In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored.  In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font.  See The \LaTeX\ Font Catalogue's section on \href{http://www.tug.dk/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives.  If you like the default \LaTeX\ fonts, the \pkg{lmodern} package is a good place to start.  The \pkg{beramono} and \pkg{courier} packages may also be good options.
+% \item \textbf{There are intermittent ``I can't write on file'' errors.}  This can be caused by using \texpkg{minted} in a directory that is synchronized with Dropbox or a similar file syncing program.  These programs can try to sync \texpkg{minted}'s temporary files while it still needs to be able to modify them.  The solution is to turn off file syncing or use a directory that is not synced.
+% \item \textbf{I receive a ``Font Warning:  Some font shapes were not available'' message, or bold or italic seem to be missing.}  This is due to a limitation in the font that is currently in use for typesetting code.  In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored.  In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font.  See The \LaTeX\ Font Catalogue's section on \href{http://www.tug.dk/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives.  If you like the default \LaTeX\ fonts, the \texpkg{lmodern} package is a good place to start.  The \texpkg{beramono} and \texpkg{courier} packages may also be good options.
 % \item \textbf{I receive a ``Too many open files'' error under OS X when using caching.}  See the note on OS X under Section~\ref{sec:basic:preliminary}.
 % \item \textbf{TeXShop can't find \texttt{pygmentize}.}  You may need to create a symlink.  See \url{https://tex.stackexchange.com/questions/279214}.
-% \item \textbf{Weird things happen when I use the \pkg{fancybox} package.}  \pkg{fancybox} conflicts with \pkg{fancyvrb}, which \pkg{minted} uses internally.  When using \pkg{fancybox}, make sure that it is loaded before \pkg{minted} (or before \pkg{fancyvrb}, if \pkg{fancyvrb} is not loaded by \pkg{minted}).
-% \item \textbf{When I use \pkg{minted} with KOMA-Script document classes, I get warnings about \texttt{\string\float at addtolists}.}  \pkg{minted} uses the \pkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats.  Load the package \pkg{scrhack} to resolve the conflict.  Or use \pkg{minted}'s |newfloat| package option.
+% \item \textbf{Weird things happen when I use the \texpkg{fancybox} package.}  \texpkg{fancybox} conflicts with \texpkg{fancyvrb}, which \texpkg{minted} uses internally.  When using \texpkg{fancybox}, make sure that it is loaded before \texpkg{minted} (or before \texpkg{fancyvrb}, if \texpkg{fancyvrb} is not loaded by \texpkg{minted}).
+% \item \textbf{When I use \texpkg{minted} with KOMA-Script document classes, I get warnings about \texttt{\string\float at addtolists}.}  \texpkg{minted} uses the \texpkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats.  Load the package \texpkg{scrhack} to resolve the conflict.  Or use \texpkg{minted}'s |newfloat| package option.
 % \item \textbf{Tilde characters \texttt{\string~} are raised, almost like superscripts.}
 % This is a font issue.  You need a different font encoding, possibly with a different font.  Try |\usepackage[T1]{fontenc}|, perhaps with |\usepackage{lmodern}|, or something similar.
 %
 % \item \textbf{I'm getting errors with math, something like \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}.}  This is due to ligatures being disabled within verbatim content.  See the note under |escapeinside|.
 %
-% \item \textbf{With \texttt{mathescape} and the \pkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.}  Some math packages like \pkg{breqn} give certain characters like the comma special meanings in math mode.  These can conflict with \pkg{minted}.  In the \pkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
+% \item \textbf{With \texttt{mathescape} and the \texpkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.}  Some math packages like \texpkg{breqn} give certain characters like the comma special meanings in math mode.  These can conflict with \texpkg{minted}.  In the \texpkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
 %\begin{verbatim}
 %\AtBeginEnvironment{minted}{\catcode`\,=12\mathcode`\,="613B}
 %\end{verbatim}
 %Other packages/special characters may need their own modifications.
 %
-% \item \textbf{I'm getting errors with Beamer.}  Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \pkg{minted} commands and environments.  |fragile=singleslide| works best, but it disables overlays.  |fragile| works by saving the contents of each frame to a temp file and then reusing them.  This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment).  To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
+% \item \textbf{I'm getting errors with Beamer.}  Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \texpkg{minted} commands and environments.  |fragile=singleslide| works best, but it disables overlays.  |fragile| works by saving the contents of each frame to a temp file and then reusing them.  This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment).  To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
 %
 % \item \textbf{Tabs are eaten by Beamer.}  This is due to \href{https://bitbucket.org/rivanvx/beamer/issue/310/tab-characters-in-listings-lost-when-using}{a bug in Beamer's treatment of verbatim content}.  Upgrade Beamer or use the linked patch.  Otherwise, try |fragile=singleslide| if you don't need overlays, or consider using \cmd\inputminted\ or converting the tabs into spaces.
 %
-% \item \textbf{I'm trying to create several new \pkg{minted} commands/environments, and want them all to have the same settings.  I'm saving the settings in a macro and then using the macro when defining the commands/environments.  But it's failing.}
-% This is due to the way that \pkg{keyval} works (\pkg{minted} uses it to manage options). Arguments are not expanded. See \href{http://tex.stackexchange.com/questions/13563/building-keyval-arguments-using-a-macro/13564#13564}{this} and \href{http://tex.stackexchange.com/questions/145363/why-does-includegraphics-varone-vartwo-not-compile/145366#145366}{this} for more information.  It is still possible to do what you want; you just need to expand the options macro before passing it to the commands that create the new commands/environments.  An example is shown below.  The |\expandafter| is the vital part.
+% \item \textbf{I'm trying to create several new \texpkg{minted} commands/environments, and want them all to have the same settings.  I'm saving the settings in a macro and then using the macro when defining the commands/environments.  But it's failing.}
+% This is due to the way that \texpkg{keyval} works (\texpkg{minted} uses it to manage options). Arguments are not expanded. See \href{http://tex.stackexchange.com/questions/13563/building-keyval-arguments-using-a-macro/13564#13564}{this} and \href{http://tex.stackexchange.com/questions/145363/why-does-includegraphics-varone-vartwo-not-compile/145366#145366}{this} for more information.  It is still possible to do what you want; you just need to expand the options macro before passing it to the commands that create the new commands/environments.  An example is shown below.  The |\expandafter| is the vital part.
 %\begin{verbatim}
 %\def\args{linenos,frame=single,fontsize=\footnotesize,style=bw}
 %
@@ -1555,10 +1572,10 @@
 %\commandthatdoesnotlikeverbatim{Text \usebox{\mybox}}
 %\end{verbatim}
 %
-% \item \textbf{Extended characters do not work inside \pkg{minted} commands and environments, even when the \pkg{inputenc} package is used.}
-% Version 2.0 adds support for extended characters under the pdfTeX engine.  But if you need characters that are not supported by \pkg{inputenc}, you should use the XeTeX or LuaTeX engines instead.
+% \item \textbf{Extended characters do not work inside \texpkg{minted} commands and environments, even when the \texpkg{inputenc} package is used.}
+% Version 2.0 adds support for extended characters under the pdfTeX engine.  But if you need characters that are not supported by \texpkg{inputenc}, you should use the XeTeX or LuaTeX engines instead.
 %
-% \item \textbf{The \pkg{polyglossia} package is doing undesirable things to code. (For example, adding extra space around colons in French.)}  You may need to put your code within |\begin{english}...\end{english}|.  This may done for all |minted| environments using \pkg{etoolbox} in the preamble:
+% \item \textbf{The \texpkg{polyglossia} package is doing undesirable things to code. (For example, adding extra space around colons in French.)}  You may need to put your code within |\begin{english}...\end{english}|.  This may done for all |minted| environments using \texpkg{etoolbox} in the preamble:
 % \begin{verbatim}
 %\usepackage{etoolbox}
 %\BeforeBeginEnvironment{minted}{\begin{english}}
@@ -1568,8 +1585,8 @@
 % \item \begin{sloppypar} \textbf{Tabs are being turned into the character sequence \texttt{\string^\string^I}}.
 % This happens when you use XeLaTeX.  You need to use the |-8bit| command-line option so that tabs may be written correctly to temporary files.  See \url{http://tex.stackexchange.com/questions/58732/how-to-output-a-tabulation-into-a-file} for more on XeLaTeX's handling of tab characters. \end{sloppypar}
 %
-% \item \textbf{The \pkg{caption} package produces an error when \texttt{\string\captionof} and other commands are used in combination with \pkg{minted}.}
-% Load the \pkg{caption} package with the option |compatibility=false|.  Or better yet, use \pkg{minted}'s |newfloat| package option, which provides better \pkg{caption} compatibility.
+% \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, 
 %\begin{verbatim}
@@ -1576,7 +1593,7 @@
 %\usepackage{caption}
 %\newenvironment{longlisting}{\captionsetup{type=listing}}{}
 %\end{verbatim}
-% With the \pkg{caption} package, it is best to use \pkg{minted}'s |newfloat| package option.  See \url{http://tex.stackexchange.com/a/53540/10742} for more on |listing| environments with page breaks.
+% With the \texpkg{caption} package, it is best to use \texpkg{minted}'s |newfloat| package option.  See \url{http://tex.stackexchange.com/a/53540/10742} for more on |listing| environments with page breaks.
 %
 % \item \textbf{I want to use a custom script/executable to access Pygments, rather than |pygmentize|.}  Redefine |\MintedPygmentize|:
 %\begin{verbatim}
@@ -1583,12 +1600,12 @@
 %\renewcommand{\MintedPygmentize}{...}
 %\end{verbatim}
 %
-% \item \textbf{I want to use the command-line option \texttt{-output-directory}, or MiKTeX's \texttt{-aux-directory}, but am getting errors.}  Use the package option |outputdir| to specify the location of the output directory.  Unfortunately, there is no way for \pkg{minted} to detect the output directory automatically.
+% \item \textbf{I want to use the command-line option \texttt{-output-directory}, or MiKTeX's \texttt{-aux-directory}, but am getting errors.}  Use the package option |outputdir| to specify the location of the output directory.  Unfortunately, there is no way for \texpkg{minted} to detect the output directory automatically.
 %
-% \item \textbf{I want extended characters in frame labels, but am getting errors.}  This can happen with \pkg{minted} <2.0 and Python 2.7, due to a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/801/python-2-fails-to-detect-terminal-encoding}{terminal encoding issue with Pygments}.  It should work with any version of Python with \pkg{minted} 2.0+, which processes labels internally and does not send them to Python.
+% \item \textbf{I want extended characters in frame labels, but am getting errors.}  This can happen with \texpkg{minted} <2.0 and Python 2.7, due to a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/801/python-2-fails-to-detect-terminal-encoding}{terminal encoding issue with Pygments}.  It should work with any version of Python with \texpkg{minted} 2.0+, which processes labels internally and does not send them to Python.
 % \item \textbf{\texttt{minted} environments have extra vertical space inside \texttt{tabular}.}  It is possible to \href{https://github.com/gpoore/minted/issues/82}{create a custom environment} that eliminates the extra space.  However, a general solution that behaves as expected in the presence of adjacent text remains to be found.
-% \item \textbf{I'm receiving a warning from \texttt{lineno.sty} that ``Command \texttt{\string\@parboxrestore} has changed.''}  This can happen when \pkg{minted} is loaded after \pkg{csquotes}.  Try loading \pkg{minted} first.  If you receive this message when you are not using \pkg{csquotes}, you may want to experiment with the order of loading packages and might also open an issue.
-% \item \textbf{I'm using \app{texi2pdf}, and getting ``Cannot stat'' errors from \app{tar}}:  This is due to the way that \app{texi2pdf} handles temporary files.  \pkg{minted} automatically cleans up its temporary files, but \app{texi2pdf} assumes that any temporary file that is ever created will still exist at the end of the run, so it tries to access the files that \pkg{minted} has deleted. It's possible to disable minted's temp file cleanup by adding |\renewcommand{\DeleteFile}[2][]{}| after the |\usepackage{minted}|.
+% \item \textbf{I'm receiving a warning from \texttt{lineno.sty} that ``Command \texttt{\string\@parboxrestore} has changed.''}  This can happen when \texpkg{minted} is loaded after \texpkg{csquotes}.  Try loading \texpkg{minted} first.  If you receive this message when you are not using \texpkg{csquotes}, you may want to experiment with the order of loading packages and might also open an issue.
+% \item \textbf{I'm using \app{texi2pdf}, and getting ``Cannot stat'' errors from \app{tar}}:  This is due to the way that \app{texi2pdf} handles temporary files.  \texpkg{minted} automatically cleans up its temporary files, but \app{texi2pdf} assumes that any temporary file that is ever created will still exist at the end of the run, so it tries to access the files that \texpkg{minted} has deleted. It's possible to disable minted's temp file cleanup by adding |\renewcommand{\DeleteFile}[2][]{}| after the |\usepackage{minted}|.
 % \end{itemize}
 %
 %
@@ -1667,7 +1684,7 @@
 %
 % \begin{macro}{newfloat}
 %
-% Define an option to use \pkg{newfloat} rather than \pkg{float} to create a floated |listing| environment.
+% Define an option to use \texpkg{newfloat} rather than \texpkg{float} to create a floated |listing| environment.
 %
 %    \begin{macrocode}
 \DeclareBoolOption{newfloat}
@@ -1715,7 +1732,7 @@
 %
 %
 % \begin{macro}{frozencache}
-% Define an option that uses a fixed set of cache files, using |listing<number>| file naming with |\write18| disabled.  This is convenient for working with a document in an environment in which |\write18| support is disabled and \pkg{minted} content does not need to be modified.
+% Define an option that uses a fixed set of cache files, using |listing<number>| file naming with |\write18| disabled.  This is convenient for working with a document in an environment in which |\write18| support is disabled and \texpkg{minted} content does not need to be modified.
 %    \begin{macrocode}
 \DeclareBoolOption{frozencache}
 %    \end{macrocode}
@@ -1723,7 +1740,7 @@
 %
 %
 % \begin{macro}{\minted at outputdir}
-% The |-output-directory| command-line option for \LaTeX\ causes problems for \pkg{minted}, because the \pkg{minted} temporary files are saved in the output directory, but \pkg{minted} still looks for them in the document root directory.  There is no way to access the value of the command-line option.  But it is possible to allow the output directory to be specified manually as a package option.  A trailing slash is automatically appended to the |outputdir|, so that it may be directly joined to |cachedir|.  This may be redundant if the user-supplied value already ends with a slash, but doubled slashes are ignored under *nix and Windows, so it isn't a problem.
+% The |-output-directory| command-line option for \LaTeX\ causes problems for \texpkg{minted}, because the \texpkg{minted} temporary files are saved in the output directory, but \texpkg{minted} still looks for them in the document root directory.  There is no way to access the value of the command-line option.  But it is possible to allow the output directory to be specified manually as a package option.  A trailing slash is automatically appended to the |outputdir|, so that it may be directly joined to |cachedir|.  This may be redundant if the user-supplied value already ends with a slash, but doubled slashes are ignored under *nix and Windows, so it isn't a problem.
 %    \begin{macrocode}
 \let\minted at outputdir\@empty
 \let\minted at outputdir@windows\@empty
@@ -1752,7 +1769,7 @@
 %
 %
 % \begin{macro}{draft}
-% Define an option that allows \pkg{fancyvrb} to do all typesetting directly, without using \app{Pygments}.  This trades syntax highlighting for speed.  Note that in many cases, the difference in performance between caching and draft mode will be minimal.  Also note that draft settings may be inherited from the document class.
+% Define an option that allows \texpkg{fancyvrb} to do all typesetting directly, without using \app{Pygments}.  This trades syntax highlighting for speed.  Note that in many cases, the difference in performance between caching and draft mode will be minimal.  Also note that draft settings may be inherited from the document class.
 %    \begin{macrocode}
 \DeclareBoolOption{draft}
 %    \end{macrocode}
@@ -1766,7 +1783,7 @@
 % \end{macro}
 %
 %
-% Process package options.  Proceed with everything that immediately relies upon them.  If PGF/Ti\textit{k}Z externalization is in use, switch on |draft| mode and turn off |cache|.  Externalization involves compiling the \emph{entire} document; all parts not related to the current image are ``silently thrown away.'' \pkg{minted} needs to cooperate with that by not writing any temp files or creating any directories.  Two checks are done for externalization.  The first, using |\tikzifexternalizing|, works if externalization is set before \pkg{minted} is loaded.  The second, using |\tikzexternalrealjob|, works if externalization is set after \pkg{minted} is loaded.
+% Process package options.  Proceed with everything that immediately relies upon them.  If PGF/Ti\textit{k}Z externalization is in use, switch on |draft| mode and turn off |cache|.  Externalization involves compiling the \emph{entire} document; all parts not related to the current image are ``silently thrown away.'' \texpkg{minted} needs to cooperate with that by not writing any temp files or creating any directories.  Two checks are done for externalization.  The first, using |\tikzifexternalizing|, works if externalization is set before \texpkg{minted} is loaded.  The second, using |\tikzexternalrealjob|, works if externalization is set after \texpkg{minted} is loaded.
 %
 %    \begin{macrocode}
 \ProcessKeyvalOptions*
@@ -2005,7 +2022,7 @@
 %
 % \subsection{Option processing}
 %
-% Option processing is somewhat involved, because we want to be able to define options at various levels of hierarchy:  individual command/environment, language, global (document).  And once those options are defined, we need to go through the hierarchy in a defined order of precedence to determine which option to apply.  As if that wasn't complicated enough, some options need to be sent to Pygments, some need to be sent to \pkg{fancyvrb}, and some need to be processed within \pkg{minted} itself.
+% Option processing is somewhat involved, because we want to be able to define options at various levels of hierarchy:  individual command/environment, language, global (document).  And once those options are defined, we need to go through the hierarchy in a defined order of precedence to determine which option to apply.  As if that wasn't complicated enough, some options need to be sent to Pygments, some need to be sent to \texpkg{fancyvrb}, and some need to be processed within \texpkg{minted} itself.
 %
 % To begin with, we need macros for storing lists of options that will later be passed via the command line to Pygments (|optlistcl|).  These are defined at the global (|cl at g|), language (|cl at lang|), and command or environment (|cl at cmd|) levels, so that settings can be specified at various levels of hierarchy.  The language macro is actually a placeholder.  The current language will be tracked using |\minted at lang|.  Each individual language will create a |\minted at optlistcl@lang|\meta{language} macro.  |\minted at optlistcl@lang| may be |\let| to this macro as convenient; otherwise, the general language macro merely serves as a placeholder.
 %
@@ -2047,7 +2064,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% We also need macros for storing lists of options that will later be passed to \pkg{fancyvrb} (|optlistfv|).  As before, these exist at the global (|fv at g|), language (|fv at lang|), and command or environment (|fv at cmd|) levels.  Pygments accepts \pkg{fancyvrb} options, but in almost all cases, these options may be applied via |\fvset| rather than via running Pygments.  This is significantly more efficient when caching is turned on, since it allows formatting changes to be applied without having to re-highlight the code.
+% We also need macros for storing lists of options that will later be passed to \texpkg{fancyvrb} (|optlistfv|).  As before, these exist at the global (|fv at g|), language (|fv at lang|), and command or environment (|fv at cmd|) levels.  Pygments accepts \texpkg{fancyvrb} options, but in almost all cases, these options may be applied via |\fvset| rather than via running Pygments.  This is significantly more efficient when caching is turned on, since it allows formatting changes to be applied without having to re-highlight the code.
 %
 % \begin{macro}{\minted at optlistfv@g}
 %    \begin{macrocode}
@@ -2101,7 +2118,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% We need a way to define options in bulk at the global, language, and command levels.  How this is done will depend on the type of option.  The keys created are grouped by level:  |minted at opt@g|, |minted at opt@lang|, and |minted at opt@cmd|, plus inline variants.  The language-level key groupings use |\minted at lang| internally, so we don't need to duplicate the internals for different languages.  The key groupings are independent of whether a given option relates to Pygments, \pkg{fancyvrb}, etc.  Organization by level is the only thing that is important here, since keys are applied in a hierarchical fashion.  Key values are stored in macros of the form |\minted at opt@|\meta{level}|:|\meta{key}, so that they may be retrieved later.  In practice, these key macros will generally not be used directly (hence the colon in the name).  Rather, the hierarchy of macros will be traversed until an existing macro is found.
+% We need a way to define options in bulk at the global, language, and command levels.  How this is done will depend on the type of option.  The keys created are grouped by level:  |minted at opt@g|, |minted at opt@lang|, and |minted at opt@cmd|, plus inline variants.  The language-level key groupings use |\minted at lang| internally, so we don't need to duplicate the internals for different languages.  The key groupings are independent of whether a given option relates to Pygments, \texpkg{fancyvrb}, etc.  Organization by level is the only thing that is important here, since keys are applied in a hierarchical fashion.  Key values are stored in macros of the form |\minted at opt@|\meta{level}|:|\meta{key}, so that they may be retrieved later.  In practice, these key macros will generally not be used directly (hence the colon in the name).  Rather, the hierarchy of macros will be traversed until an existing macro is found.
 %
 % \begin{macro}{\minted at def@optcl}
 %
@@ -2111,47 +2128,54 @@
 %
 % Options are added to the option lists in such a way that they will be detokenized.  This is necessary since they will ultimately be used in |\write18|.
 %    \begin{macrocode}
-\newcommand{\minted at addto@optlistcl}[2]{%
+\ifwindows
+  \newcommand{\minted at optlistcl@quote}[2]{%
+    \detokenize{#1="#2"}}
+\else
+  \newcommand{\minted at optlistcl@quote}[2]{%
+    \detokenize{#1='#2'}}
+\fi
+\newcommand{\minted at addto@optlistcl}[3]{%
   \expandafter\def\expandafter#1\expandafter{#1%
-    \detokenize{#2}\space}}
-\newcommand{\minted at addto@optlistcl at lang}[2]{%
+    \minted at optlistcl@quote{#2}{#3}\space}}
+\newcommand{\minted at addto@optlistcl at lang}[3]{%
   \expandafter\let\expandafter\minted at tmp\csname #1\endcsname
   \expandafter\def\expandafter\minted at tmp\expandafter{\minted at tmp%
-    \detokenize{#2}\space}%
+    \minted at optlistcl@quote{#2}{#3}\space}%
   \expandafter\let\csname #1\endcsname\minted at tmp}
 \newcommand{\minted at def@optcl}[4][]{%
   \ifthenelse{\equal{#1}{}}%
     {\define at key{minted at opt@g}{#2}{%
-        \minted at addto@optlistcl{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}{%
-        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}{%
-        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}{%
         \minted at addto@optlistcl at lang{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}{%
-        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
     {\define at key{minted at opt@g}{#2}[#1]{%
-        \minted at addto@optlistcl{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}[#1]{%
-        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}[#1]{%
-        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}[#1]{%
         \minted at addto@optlistcl at lang{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}[#1]{%
-        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
 }
 %    \end{macrocode}
@@ -2159,88 +2183,78 @@
 %
 % This covers the typical options that must be passed to Pygments.  But some, particularly |escapeinside|, need more work.  Since their arguments may contain escaped characters, expansion rather than detokenization is needed.  Getting expansion to work as desired in a |\write18| context requires the redefinition of some characters.
 %
-% \begin{macro}{\minted at escchars}
-% We need to define versions of common escaped characters that will work correctly under expansion for use in |\write18|.
+% \begin{macro}{\minted at escape}
+% Process (possibly backslash-escaped) characters into a form that will work correctly under expansion for use in |\write18|.  This assumes that only punctuation characters are escaped.  (Otherwise, trailing spaces from |\detokenize| would need to be stripped.)  This is currently only used for |escapeinside|.
 %    \begin{macrocode}
-\edef\minted at hashchar{\string#}
-\edef\minted at dollarchar{\string$}
-\edef\minted at ampchar{\string&}
-\edef\minted at underscorechar{\string_}
-\edef\minted at tildechar{\string~}
-\edef\minted at leftsquarebracket{\string[}
-\edef\minted at rightsquarebracket{\string]}
-\newcommand{\minted at escchars}{%
-  \let\#\minted at hashchar
-  \let\%\@percentchar
-  \let\{\@charlb
-  \let\}\@charrb
-  \let\$\minted at dollarchar
-  \let\&\minted at ampchar
-  \let\_\minted at underscorechar
-  \let\\\@backslashchar
-  \let~\minted at tildechar
-  \let\~\minted at tildechar
-  \let\[\minted at leftsquarebracket
-  \let\]\minted at rightsquarebracket
-} %$ <- highlighting
+\begingroup
+\catcode`\!=0
+!catcode`!\=12
+!gdef!minted at escape#1{%
+  !expandafter!minted at escape@i!detokenize{#1}\!FV at Sentinel}
+!gdef!minted at escape@i#1\#2!FV at Sentinel{%
+  !if!relax!detokenize{#2}!relax
+    !expandafter!@firstoftwo
+  !else
+    !expandafter!@secondoftwo
+  !fi
+  {#1!minted at escape@end\#2!FV at Sentinel}
+  {#1!minted at escape@esc\#2!FV at Sentinel}}
+!gdef!minted at escape@end#1!FV at Sentinel{}
+!gdef!minted at escape@esc\#1#2!FV at Sentinel{%
+  #1!minted at escape@i#2!FV at Sentinel}
+!endgroup
 %    \end{macrocode}
 % \end{macro}
 %
 %
 % \begin{macro}{\minted at def@optcl at e}
-% Now to define options that are expanded.
+% Now to define options that involve backslash escapes.
 %    \begin{macrocode}
-\newcommand{\minted at addto@optlistcl at e}[2]{%
-  \begingroup
-  \minted at escchars
-  \xdef\minted at xtmp{#2}%
-  \endgroup
-  \expandafter\minted at addto@optlistcl at e@i\expandafter{\minted at xtmp}{#1}}
-\def\minted at addto@optlistcl at e@i#1#2{%
-  \expandafter\def\expandafter#2\expandafter{#2#1\space}}
-\newcommand{\minted at addto@optlistcl at lang@e}[2]{%
-  \begingroup
-  \minted at escchars
-  \xdef\minted at xtmp{#2}%
-  \endgroup
-  \expandafter\minted at addto@optlistcl at lang@e at i\expandafter{\minted at xtmp}{#1}}
-\def\minted at addto@optlistcl at lang@e at i#1#2{%
+\newcommand{\minted at addto@optlistcl at e}[3]{%
+  \edef\minted at tmp{\minted at escape{#3}}%
+  \expandafter\minted at addto@optlistcl at e@i\expandafter{\minted at tmp}{#1}{#2}}
+\def\minted at addto@optlistcl at e@i#1#2#3{%
+  \expandafter\def\expandafter#2\expandafter{#2\minted at optlistcl@quote{#3}{#1}\space}}
+\newcommand{\minted at addto@optlistcl at lang@e}[3]{%
+  \edef\minted at tmp{\minted at escape{#3}}%
+  \expandafter\minted at addto@optlistcl at lang@e at i\expandafter{\minted at tmp}{#1}{#2}}
+\def\minted at addto@optlistcl at lang@e at i#1#2#3{%
   \expandafter\let\expandafter\minted at tmp\csname #2\endcsname
-  \expandafter\def\expandafter\minted at tmp\expandafter{\minted at tmp#1\space}%
+  \expandafter\def\expandafter\minted at tmp\expandafter{\minted at tmp\minted at optlistcl@quote{#3}{#1}\space}%
   \expandafter\let\csname #2\endcsname\minted at tmp}
 \newcommand{\minted at def@optcl at e}[4][]{%
   \ifthenelse{\equal{#1}{}}%
     {\define at key{minted at opt@g}{#2}{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}{%
-        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}{%
         \minted at addto@optlistcl at lang@e{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
     {\define at key{minted at opt@g}{#2}[#1]{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}[#1]{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}[#1]{%
-        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}[#1]{%
         \minted at addto@optlistcl at lang@e{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}[#1]{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
 }
 %    \end{macrocode}
@@ -2253,39 +2267,39 @@
 %    \begin{macrocode}
 \newcommand{\minted at def@optcl at switch}[2]{%
   \define at booleankey{minted at opt@g}{#1}%
-    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2=True}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2}{True}%
       \@namedef{minted at opt@g:#1}{true}}
-    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2=False}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2}{False}%
       \@namedef{minted at opt@g:#1}{false}}
   \define at booleankey{minted at opt@g at i}{#1}%
-    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2=True}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2}{True}%
       \@namedef{minted at opt@g at i:#1}{true}}
-    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2=False}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2}{False}%
       \@namedef{minted at opt@g at i:#1}{false}}
   \define at booleankey{minted at opt@lang}{#1}%
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2=True}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2}{True}%
       \@namedef{minted at opt@lang\minted at lang:#1}{true}}
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2=False}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2}{False}%
       \@namedef{minted at opt@lang\minted at lang:#1}{false}}
   \define at booleankey{minted at opt@lang at i}{#1}%
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2=True}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2}{True}%
       \@namedef{minted at opt@lang\minted at lang @i:#1}{true}}
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2=False}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2}{False}%
       \@namedef{minted at opt@lang\minted at lang @i:#1}{false}}
   \define at booleankey{minted at opt@cmd}{#1}%
-      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2=True}%
+      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2}{True}%
         \@namedef{minted at opt@cmd:#1}{true}}
-      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2=False}%
+      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2}{False}%
         \@namedef{minted at opt@cmd:#1}{false}}
 }
 %    \end{macrocode}
 % \end{macro}
 %
-% Now that all the machinery for Pygments options is in place, we can move on to \pkg{fancyvrb} options.
+% Now that all the machinery for Pygments options is in place, we can move on to \texpkg{fancyvrb} options.
 %
 % \begin{macro}{\minted at def@optfv}
 %
-% Define \pkg{fancyvrb} options.  The |#1={##1}| is needed because any braces enclosing the argument (|##1|) will be stripped during the initial capture, and they need to be reinserted before \pkg{fancyvrb} gets the argument and sends it through another \pkg{keyval} processing step.  If there were no braces initially, adding them here doesn't hurt, since they are just stripped off again during processing.
+% Define \texpkg{fancyvrb} options.  The |#1={##1}| is needed because any braces enclosing the argument (|##1|) will be stripped during the initial capture, and they need to be reinserted before \texpkg{fancyvrb} gets the argument and sends it through another \texpkg{keyval} processing step.  If there were no braces initially, adding them here doesn't hurt, since they are just stripped off again during processing.
 %    \begin{macrocode}
 \newcommand{\minted at def@optfv}[1]{%
   \define at key{minted at opt@g}{#1}{%
@@ -2322,7 +2336,7 @@
 %
 % \begin{macro}{\minted at def@optfv at switch}
 %
-% Define \pkg{fancyvrb} boolean options.
+% Define \texpkg{fancyvrb} boolean options.
 %    \begin{macrocode}
 \newcommand{\minted at def@optfv at switch}[1]{%
   \define at booleankey{minted at opt@g}{#1}%
@@ -2388,7 +2402,7 @@
 % \end{macro}
 %
 % \begin{macro}{\minted at fvset}
-% We will need a way to actually use the lists of stored \pkg{fancyvrb} options later on.
+% We will need a way to actually use the lists of stored \texpkg{fancyvrb} options later on.
 %    \begin{macrocode}
 \newcommand{\minted at fvset}{%
   \expandafter\fvset\expandafter{\minted at optlistfv@g}%
@@ -2407,7 +2421,7 @@
 % \end{macro}
 %
 %
-% We need a way to define \pkg{minted}-specific options at multiple levels of hierarchy, as well as a way to retrieve these options.  As with previous types of options, values are stored in macros of the form |\minted at opt@|\meta{level}|:|\meta{key}, since they are not meant to be accessed directly.
+% We need a way to define \texpkg{minted}-specific options at multiple levels of hierarchy, as well as a way to retrieve these options.  As with previous types of options, values are stored in macros of the form |\minted at opt@|\meta{level}|:|\meta{key}, since they are not meant to be accessed directly.
 %
 % The order of precedence is |cmd|, |lang at i|, |g at i|, |lang|, |g|.  A value specified at the command or environment level should override other settings.  In its absence, a value specified for an inline command should override other settings, if we are indeed in an inline context.  Otherwise, language settings take precedence over global settings.
 %
@@ -2415,7 +2429,7 @@
 %
 %
 % \begin{macro}{\minted at def@opt}
-% Finally, on to the actual option definitions for \pkg{minted}-specific options.
+% Finally, on to the actual option definitions for \texpkg{minted}-specific options.
 %
 % Usage:  |\minted at def@opt[|\meta{initial global value}|]{|\meta{key name}|}|
 %    \begin{macrocode}
@@ -2469,11 +2483,11 @@
 % \begin{itemize}
 % \item At sign |@| would be handled by the |\makeatletter| within the Pygments style definition if the style was brought in via |\input|, but |\makeatletter| doesn't affect tokenization with the |catchfile| approach.
 % \item Percent |%| may not have its normal meaning within a |.dtx| file.
-% \item Backtick |`| is made active by some \pkg{babel} package options, such as |magyar|.
+% \item Backtick |`| is made active by some \texpkg{babel} package options, such as |magyar|.
 % \end{itemize}
 % |\endlinechar| also requires special handling to avoid introducing unwanted spaces.
 %
-% The |\ifx\PYG\relax| tests detect outdated style definitions from \pkg{minted} <2.6 and replace them when possible, and also detect missing styles.  Before \pkg{minted} 2.6, style macros used a |\PYG<style>| prefix and were defined globally.  Starting with 2.6, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix.  This allows more robust treatment of style names that involve punctuation characters and numbers.
+% The |\ifx\PYG\relax| tests detect outdated style definitions from \texpkg{minted} <2.6 and replace them when possible, and also detect missing styles.  Before \texpkg{minted} 2.6, style macros used a |\PYG<style>| prefix and were defined globally.  Starting with 2.6, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix.  This allows more robust treatment of style names that involve punctuation characters and numbers.
 %    \begin{macrocode}
 \newcommand{\minted at generate@PYGdef}[1]{%
   \ifthenelse{\boolean{minted at cache}}%
@@ -2540,6 +2554,7 @@
   \fi
   \csname minted at PYGdef@\minted at style\endcsname
   \minted at patch@PYGZsq
+  \minted at patch@PYGZhy
 }
 \ifthenelse{\boolean{minted at draft}}{\renewcommand{\minted at defstyle}[1]{}}{}
 %    \end{macrocode}
@@ -2547,7 +2562,7 @@
 %
 %
 % \begin{macro}{\minted at patch@PYGZsq}
-% The single quote macro from \pkg{Pygments} 1.6+ needs to be patched if the \pkg{upquote} package is in use.  Patching is done when the default style is created.  Patching is only attempted if the macro exists, so that there is a graceful fallback in the event of a custom \pkg{Pygments} stylesheet.
+% The single quote macro from \texpkg{Pygments} 1.6+ needs to be patched if the \texpkg{upquote} package is in use.  Patching is done when the default style is created.  Patching is only attempted if the macro exists, so that there is a graceful fallback in the event of a custom \texpkg{Pygments} stylesheet.
 %    \begin{macrocode}
 \newcommand{\minted at patch@PYGZsq}{%
   \ifcsname PYGZsq\endcsname
@@ -2560,11 +2575,24 @@
 \catcode`\'=\active
 \gdef\minted at patch@PYGZsq at i{\gdef\PYGZsq{'}}
 \endgroup
-\ifthenelse{\boolean{minted at draft}}{}{\AtBeginDocument{\minted at patch@PYGZsq}}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\minted at patch@PYGZhy}
+% Redefine the hyphen under LuaTeX to prevent unintended line breaks.
+%    \begin{macrocode}
+\newcommand{\minted at patch@PYGZhy}{%
+  \ifcsname PYGZhy\endcsname
+    \expandafter\ifdefstring\expandafter{\csname PYGZhy\endcsname}{\char`\-}%
+     {\def\PYGZhy{\mbox{-}}}%
+     {}%
+  \fi
+}
+%    \end{macrocode}
+% \end{macro}
+% 
 %
+%
 % \begin{macro}{\minted at def@opt at switch}
 % And we need a switch version.
 %
@@ -2593,7 +2621,7 @@
 %
 %
 % \begin{macro}{\minted at get@opt}
-% We need a way to traverse the hierarchy of values for a given key and return the current value that has precedence.  In doing this, we need to specify a default value to use if no value is found.  When working with \pkg{minted}-specific values, there should generally be a default value; in those cases, an empty default may be supplied.  But the macro should also work with Pygments settings, which are stored in macros of the same form and will sometimes need to be accessed (for example, |encoding|).  In the Pygments case, there may very well be no default values on the \LaTeX\ side, because we are falling back on Pygments' own built-in defaults.  There is no need to duplicate those when very few Pygments values are ever needed; it is simpler to specify the default fallback when accessing the macro value.
+% We need a way to traverse the hierarchy of values for a given key and return the current value that has precedence.  In doing this, we need to specify a default value to use if no value is found.  When working with \texpkg{minted}-specific values, there should generally be a default value; in those cases, an empty default may be supplied.  But the macro should also work with Pygments settings, which are stored in macros of the same form and will sometimes need to be accessed (for example, |encoding|).  In the Pygments case, there may very well be no default values on the \LaTeX\ side, because we are falling back on Pygments' own built-in defaults.  There is no need to duplicate those when very few Pygments values are ever needed; it is simpler to specify the default fallback when accessing the macro value.
 %
 % From a programming perspective, the default argument value needs to be mandatory, so that |\minted at get@opt| can be fully expandable. This significantly simplifies accessing options.
 %    \begin{macrocode}
@@ -2636,13 +2664,13 @@
 % \end{macro}
 %
 %
-% \noindent Actual option definitions.  Some of these must be defined conditionally depending on whether we are in |draft| mode; in |draft| mode, we need to emulate Pygments functionality with \LaTeX, particularly with \pkg{fancyvrb}, when possible.  For example, gobbling must be performed by Pygments when |draft| is off, but when |draft| is on, \pkg{fancyvrb} can perform gobbling.
+% \noindent Actual option definitions.  Some of these must be defined conditionally depending on whether we are in |draft| mode; in |draft| mode, we need to emulate Pygments functionality with \LaTeX, particularly with \texpkg{fancyvrb}, when possible.  For example, gobbling must be performed by Pygments when |draft| is off, but when |draft| is on, \texpkg{fancyvrb} can perform gobbling.
 %
 % Lexers.
 %    \begin{macrocode}
 \minted at def@optcl{encoding}{-P encoding}{#1}
 \minted at def@optcl{outencoding}{-P outencoding}{#1}
-\minted at def@optcl at e{escapeinside}{-P "escapeinside}{#1"}
+\minted at def@optcl at e{escapeinside}{-P escapeinside}{#1}
 \minted at def@optcl at switch{stripnl}{-P stripnl}
 \minted at def@optcl at switch{stripall}{-P stripall}
 % Python console
@@ -2670,7 +2698,7 @@
 \minted at def@opt at detok{style}
 %    \end{macrocode}
 %
-% \pkg{fancyvrb} and \pkg{fvextra} options.
+% \texpkg{fancyvrb} and \texpkg{fvextra} options.
 %    \begin{macrocode}
 \minted at def@optfv{frame}
 \minted at def@optfv{framesep}
@@ -2747,7 +2775,7 @@
 \minted at def@optfv{fontencoding}
 %    \end{macrocode}
 %
-% Finally, options specific to \pkg{minted}.
+% Finally, options specific to \texpkg{minted}.
 %
 % |bgcolor|.  The original, |minipage|- and |\colorbox|-based solution was replaced with a |framed|-based solution in version 2.2.  A dedicated framing package will often be preferable.
 %    \begin{macrocode}
@@ -2772,7 +2800,7 @@
 % \subsection{Internal helpers}
 %
 % \begin{environment}{minted at snugshade*}
-% Define a custom version of \pkg{framed}'s |snugshade*| that takes a color as argument.  This avoids the need to redefine |shadecolor|.
+% 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 
@@ -2789,7 +2817,7 @@
 %
 % \begin{environment}{\minted at bgbox}
 %
-% Define an environment that may be wrapped around a |minted| environment to assign a background color.  This is retained as a holdover from version 1.0.  In most cases, it is probably better to use a dedicated framing package, such as \pkg{tcolorbox} or \pkg{mdframed}.
+% Define an environment that may be wrapped around a |minted| environment to assign a background color.  This is retained as a holdover from version 1.0.  In most cases, it is probably better to use a dedicated framing package, such as \texpkg{tcolorbox} or \texpkg{mdframed}.
 %
 % First, we need to define a new save box.
 %
@@ -2797,7 +2825,7 @@
 \newsavebox{\minted at bgbox}
 %    \end{macrocode}
 %
-% Now we can define the environment that applies a background color.  Prior to \pkg{minted} 2.2, this involved a |minipage|.  However, that approach was problematic because it did not allow linebreaks, would be pushed into the margin by immediately preceding text, and had very different whitespace separation from preceding and following text compared to no background color.  In version 2.2, this was replaced with an approach based on \pkg{framed}.  |\FV at NumberSep| is adjusted by |\fboxsep| to ensure that line numbers remain in the same location in the margin regardless of whether |bgcolor| is used.
+% Now we can define the environment that applies a background color.  Prior to \texpkg{minted} 2.2, this involved a |minipage|.  However, that approach was problematic because it did not allow linebreaks, would be pushed into the margin by immediately preceding text, and had very different whitespace separation from preceding and following text compared to no background color.  In version 2.2, this was replaced with an approach based on \texpkg{framed}.  |\FV at NumberSep| is adjusted by |\fboxsep| to ensure that line numbers remain in the same location in the margin regardless of whether |bgcolor| is used.
 %
 %    \begin{macrocode}
 \newenvironment{minted at colorbg}[1]{%
@@ -2842,7 +2870,7 @@
 %
 %
 % \begin{macro}{\minted at FVB@VerbatimOut}
-% We need a custom version of \pkg{fancyvrb}'s |\FVB at VerbatimOut| that supports Unicode (everything written to file is |\detokenized|).  We also need to prevent the value of |FancyVerbLine| from being incorrectly incremented.
+% We need a custom version of \texpkg{fancyvrb}'s |\FVB at VerbatimOut| that supports Unicode (everything written to file is |\detokenized|).  We also need to prevent the value of |FancyVerbLine| from being incorrectly incremented.
 %    \begin{macrocode}
 \newcommand{\minted at write@detok}[1]{%
   \immediate\write\FV at OutFile{\detokenize{#1}}}
@@ -2873,7 +2901,7 @@
 %
 %
 % \begin{macro}{\MintedPygmentize}
-% We need a way to customize the executable/script that is called to perform highlighting.  Typically, we will want |pygmentize|.  But advanced users might wish to use a custom Python script instead.  The command is only defined if it does not exist.  In general, the command should be |\renewcommand|ed after the package is loaded, but this way, it will work if defined before \pkg{minted} is loaded.
+% We need a way to customize the executable/script that is called to perform highlighting.  Typically, we will want |pygmentize|.  But advanced users might wish to use a custom Python script instead.  The command is only defined if it does not exist.  In general, the command should be |\renewcommand|ed after the package is loaded, but this way, it will work if defined before \texpkg{minted} is loaded.
 %    \begin{macrocode}
 \ifcsname MintedPygmentize\endcsname\else
   \newcommand{\MintedPygmentize}{pygmentize}
@@ -2972,6 +3000,11 @@
 % At the very beginning, a check is performed to make sure that style macros exist.  This must be done before the highlighted content is generated, so that temp file names can be shared without accidental overwriting.  Styles are generated here, rather than when a style is set, so that creating the style macros is done as late as possible in case a custom |pygmentize| is in use via |\MintedPygmentize|.
 %
 %    \begin{macrocode}
+\ifwindows
+  \def\minted at opt@quote#1{\detokenize{"#1"}}
+\else
+  \def\minted at opt@quote#1{\detokenize{'#1'}}
+\fi
 \newcommand{\minted at pygmentize}[2][\minted at outputdir\minted at jobname.pyg]{%
   \minted at defstyle{\minted at get@opt{style}{default}}%
   \stepcounter{minted at pygmentizecounter}%
@@ -2989,7 +3022,7 @@
         \detokenize{for /f "usebackq tokens=*"}\space\@percentchar\detokenize{a in (`kpsewhich}\space\minted at codefile\detokenize{`) do}\space
       \fi
     \fi
-    \MintedPygmentize\space -l #2
+    \MintedPygmentize\space -l \minted at opt@quote{#2}
     -f latex -P commandprefix=PYG -F tokenmerge
     \minted at optlistcl@g \csname minted at optlistcl@lang\minted at lang\endcsname
     \minted at optlistcl@inlines
@@ -3094,7 +3127,7 @@
     fvstartnum = }\the\numexpr\FancyVerbStartNum\detokenize{;
     fvstopnum = }\the\numexpr\FancyVerbStopNum\detokenize{;
     s = max(0, fvstartnum-1);
-    e = min(s, fvstopnum if fvstopnum > 0 else len(t_opt));
+    e = max(s, fvstopnum) if fvstopnum > 0 else len(t_opt);
     [f.write(textwrap.dedent(\"\".join(x))) for x in (t_opt[0:s], t_opt[s:e], t_opt[e:]) if x and t is not None];
     f.close() if t is not None else os.remove(tmpfname);"}%
     \ifminted at kpsewhich
@@ -3114,7 +3147,7 @@
 % \begin{macro}{\minted at inputpyg}
 % For increased clarity, the actual |\input| process is separated out into its own macro.
 %
-% At the last possible moment, |\PYG| is |\let| to |\PYG|\meta{style} and redefined to used appropriate line breaking via |\VerbatimPygments| from \pkg{fvextra}.
+% At the last possible moment, |\PYG| is |\let| to |\PYG|\meta{style} and redefined to used appropriate line breaking via |\VerbatimPygments| from \texpkg{fvextra}.
 %
 % The |bgcolor| option needs to be dealt with in different ways depending on whether we are using |\mintinline|.  It is simplest to apply this option here, so that the macro redefinitions may be local and thus do not need to be manually reset later.
 %    \begin{macrocode}
@@ -3223,7 +3256,7 @@
 %
 %
 % \begin{macro}{\minted at defwhitespace@retok}
-% The |\mint| and |\mintinline| commands need to be able to retokenize the code they collect, particularly in |draft| mode.  Retokenizeation involves expansion combined with |\scantokens|, with active space and tab characters.  The active characters need to expand to the appropriate \pkg{fancyvrb} macros, but the macros themselves should not be expanded.  We need a macro that will accomplish the appropriate definitions.
+% The |\mint| and |\mintinline| commands need to be able to retokenize the code they collect, particularly in |draft| mode.  Retokenizeation involves expansion combined with |\scantokens|, with active space and tab characters.  The active characters need to expand to the appropriate \texpkg{fancyvrb} macros, but the macros themselves should not be expanded.  We need a macro that will accomplish the appropriate definitions.
 %    \begin{macrocode}
 \begingroup
 \catcode`\ =\active
@@ -3246,69 +3279,46 @@
 %
 %
 % \begin{macro}{\mintinline}
-% Define an inline command.  This requires some catcode acrobatics.  The typical verbatim methods are not used.  Rather, a different approach is taken that is generally more robust when used within other commands (for example, when used in footnotes).
+% Define an inline command.  This is modeled after the reimplemented |\Verb| from \texpkg{fvextra}.  See the \texpkg{fvextra} documentation for details about expansion handling, argument reading, and (re)tokenization.
 %
-% Pygments saves code wrapped in a |Verbatim| environment.  Getting the inline command to work correctly require redefining |Verbatim| to be |BVerbatim| temporarily.  This approach would break if |BVerbatim| were ever redefined elsewhere.
+% Pygments emits code wrapped in a |Verbatim| environment.  Getting the inline command to work correctly requires redefining |Verbatim| to be \texpkg{fvextra}'s |VerbEnv| temporarily.
 %
 % Everything needs to be within a |\begingroup...\endgroup| to prevent settings from escaping.
 %
-% In the case of |draft| mode, the code is captured and retokenized.  Then the internals of \pkg{fancyvrb} are used to emulate |SaveVerbatim|, so that |\BUseVerbatim| may be employed.
-%
-% The |FancyVerbLine| counter is altered somehow within |\minted at pygmentize|, so we protect against this.
+% In the case of |draft| mode, \texpkg{fvextra}'s |\Verb| is used directly.
 %    \begin{macrocode}
-\newrobustcmd{\mintinline}[2][]{%
+\def\mintinline{%
+  \FVExtraRobustCommand\RobustMintInline\FVExtraUnexpandedReadStarOArgMArgBVArg}
+\FVExtrapdfstringdefDisableCommands{%
+  \def\RobustMintInline{}}
+\newrobustcmd{\RobustMintInline}[2][]{%
+  \ifbool{FVExtraRobustCommandExpanded}%
+   {\@ifnextchar\bgroup
+     {\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}%
+     {\PackageError{minted}%
+       {Inline delimiters must be paired curly braces in this context}%
+       {Use curly braces as delimiters}}}%
+   {\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}}
+\def\RobustMintInlineProcess#1#2#3{%
   \begingroup
   \setboolean{minted at isinline}{true}%
   \minted at configlang{#2}%
   \setkeys{minted at opt@cmd}{#1}%
   \minted at fvset
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\{=1
-  \catcode`\}=2
-  \catcode`\^^I=\active
-  \@ifnextchar\bgroup
-    {\minted at inline@iii}%
-    {\catcode`\{=12\catcode`\}=12
-      \minted at inline@i}}
-\def\minted at inline@i#1{%
-  \endgroup
-  \def\minted at inline@ii##1#1{%
-    \minted at inline@iii{##1}}%
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\^^I=\active
-  \minted at inline@ii}
+  \RobustMintInlineProcess at i{#3}}
 \ifthenelse{\boolean{minted at draft}}%
-  {\newcommand{\minted at inline@iii}[1]{%
-    \endgroup
-    \begingroup
-    \minted at defwhitespace@retok
-    \everyeof{\noexpand}%
-    \endlinechar-1\relax
-    \let\do\@makeother\dospecials
-    \catcode`\ =\active
-    \catcode`\^^I=\active
-    \xdef\minted at tmp{\scantokens{#1}}%
-    \endgroup
-    \let\FV at Line\minted at tmp
-    \def\FV at SV@minted at tmp{%
-      \FV at Gobble
-      \expandafter\FV at ProcessLine\expandafter{\FV at Line}}%
-    \ifthenelse{\equal{\minted at get@opt{breaklines}{false}}{true}}%
-     {\let\FV at BeginVBox\relax
-      \let\FV at EndVBox\relax
-      \def\FV at BProcessLine##1{\FancyVerbFormatLine{##1}}%
-      \BUseVerbatim{minted at tmp}}%
-     {\BUseVerbatim{minted at tmp}}%
+ {\def\RobustMintInlineProcess at i#1{%
+    \fvset{extra=true}%
+    \Verb{#1}%
     \endgroup}}%
-  {\newcommand{\minted at inline@iii}[1]{%
-    \endgroup
+ {\def\RobustMintInlineProcess at i#1{%
+   \FVExtraDetokenizeVArg{%
+     \FVExtraRetokenizeVArg{\RobustMintInlineProcess at ii}{\FV at CatCodes}}{#1}}
+  \def\RobustMintInlineProcess at ii#1{%
     \minted at writecmdcode{#1}%
-    \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}%
-    \setcounter{minted at FancyVerbLineTemp}{\value{FancyVerbLine}}%
-    \minted at pygmentize{\minted at lang}%
-    \setcounter{FancyVerbLine}{\value{minted at FancyVerbLineTemp}}%
+    \let\Verbatim\VerbEnv
+    \let\endVerbatim\endVerbEnv
+    \expandafter\minted at pygmentize\expandafter{\minted at lang}%
     \endgroup}}
 %    \end{macrocode}
 % \end{macro}
@@ -3316,60 +3326,57 @@
 %
 % \begin{macro}{\mint}
 %
-% Highlight a small piece of verbatim code (a single line).
-%
-% The |draft| version digs into a good deal of \pkg{fancyvrb} internals.  We want to employ |\UseVerbatim|, and this requires assembling a macro equivalent to what |SaveVerbatim| would have created.  Actually, this is superior to what |SaveVerbatim| would yield, because line numbering is handled correctly.
+% Highlight a single line of code.  This is essentially a shortcut for the \env{minted} environment when there is only a single line of code.  The implementation follows \cmd{\mintinline} for argument reading and processing, but then typesets the code as an environment rather than command.  The \cmd{\@doendpe} ensures proper paragraph indentation for following text (immediately following text with no intervening blank lines does not begin a new paragraph).
 %    \begin{macrocode}
-\newrobustcmd{\mint}[2][]{%
+\def\mint{%
+  \FVExtraRobustCommand\RobustMint\FVExtraUnexpandedReadStarOArgMArgBVArg}
+\FVExtrapdfstringdefDisableCommands{%
+  \def\RobustMint{}}
+\newrobustcmd{\RobustMint}[2][]{%
+  \ifbool{FVExtraRobustCommandExpanded}%
+   {\@ifnextchar\bgroup
+     {\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}%
+     {\PackageError{minted}%
+       {Delimiters must be paired curly braces in this context}%
+       {Use curly braces as delimiters}}}%
+   {\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}}
+\def\RobustMintProcess#1#2#3{%
   \begingroup
   \minted at configlang{#2}%
   \setkeys{minted at opt@cmd}{#1}%
   \minted at fvset
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\{=1
-  \catcode`\}=2
-  \catcode`\^^I=\active
-  \@ifnextchar\bgroup
-    {\mint at iii}%
-    {\catcode`\{=12\catcode`\}=12
-      \mint at i}}
-\def\mint at i#1{%
-  \endgroup
-  \def\mint at ii##1#1{%
-    \mint at iii{##1}}%
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\^^I=\active
-  \mint at ii}
-\ifthenelse{\boolean{minted at draft}}%
-  {\newcommand{\mint at iii}[1]{%
-    \endgroup
-    \begingroup
-    \minted at defwhitespace@retok
-    \everyeof{\noexpand}%
-    \endlinechar-1\relax
-    \let\do\@makeother\dospecials
-    \catcode`\ =\active
-    \catcode`\^^I=\active
-    \xdef\minted at tmp{\scantokens{#1}}%
-    \endgroup
-    \let\FV at Line\minted at tmp
-    \def\FV at SV@minted at tmp{%
-      \FV at CodeLineNo=1\FV at StepLineNo
-      \FV at Gobble
-      \expandafter\FV at ProcessLine\expandafter{\FV at Line}}%
-    \minted at langlinenoson
-    \UseVerbatim{minted at tmp}%
-    \minted at langlinenosoff
-    \endgroup}}%
-  {\newcommand{\mint at iii}[1]{%
-    \endgroup
-    \minted at writecmdcode{#1}%
-    \minted at langlinenoson
-    \minted at pygmentize{\minted at lang}%
-    \minted at langlinenosoff
-    \endgroup}}
+  \RobustMintProcess at i{#3}}
+\begingroup
+\catcode`\^^M=\active%
+\catcode`\<=1%
+\catcode`\>=2%
+\catcode`\{=12%
+\catcode`\}=12%
+\catcode`\!=0%
+\catcode`\\=12%
+!ifthenelse<!boolean<minted at draft>>%
+ <!gdef!RobustMintProcess at i#1<%
+    !FVExtraDetokenizeVArg<%
+      !FVExtraRetokenizeVArg<!RobustMintProcess at ii><!FV at CatCodes>><#1>>%
+  !gdef!RobustMintProcess at ii#1<%
+    !minted at langlinenoson%
+    !scantokens<%
+      \begin{Verbatim}
+      #1
+      \end{Verbatim}
+      !noexpand>%
+    !minted at langlinenosoff%
+    !endgroup!@doendpe>>%
+ <!gdef!RobustMintProcess at i#1<%
+    !FVExtraDetokenizeVArg<%
+      !FVExtraRetokenizeVArg<!RobustMintProcess at ii><!FV at CatCodes>><#1>>%
+  !gdef!RobustMintProcess at ii#1<%
+    !minted at writecmdcode<#1>%
+    !minted at langlinenoson%
+    !expandafter!minted at pygmentize!expandafter<!minted at lang>%
+    !minted at langlinenosoff%
+    !endgroup!@doendpe>>%
+!endgroup
 %    \end{macrocode}
 % \end{macro}
 %
@@ -3398,7 +3405,7 @@
       \begin{VerbatimOut}[codes={\catcode`\^^I=12},firstline,lastline]{\minted at jobname.pyg}}%
     {\end{VerbatimOut}%
         \minted at langlinenoson
-        \minted at pygmentize{\minted at lang}%
+        \expandafter\minted at pygmentize\expandafter{\minted at lang}%
         \minted at langlinenosoff}}
 %    \end{macrocode}
 % \end{environment}
@@ -3469,20 +3476,32 @@
 %
 % Define a new language-specific alias for the |\mint| short form.
 %    \begin{macrocode}
-\newcommand{\newmint}[3][]{
+\newcommand{\newmint}[3][]{%
+  \if\relax\detokenize{#1}\relax
+    \def\minted at shortname{#2}%
+  \else
+    \def\minted at shortname{#1}%
+  \fi    
+  \expandafter\newmint at i\expandafter{\minted at shortname}{#2}{#3}}
+\def\newmint at i#1#2#3{%
+  \expandafter\newcommand\csname#1\endcsname{%
+    \expandafter\FVExtraRobustCommand\csname RobustNewMint#1\endcsname
+      \FVExtraUnexpandedReadStarOArgBVArg}%
+  \FVExtrapdfstringdefDisableCommands{%
+    \expandafter\def\csname RobustNewMint#1\endcsname{}}%
+  \expandafter\newrobustcmd\csname RobustNewMint#1\endcsname{%
+    \FVExtraReadOArgBeforeVArg{\csname RobustNewMint#1 at i\endcsname}}%
+  \expandafter\def\csname RobustNewMint#1 at i\endcsname##1{%
+    \ifbool{FVExtraRobustCommandExpanded}%
+     {\@ifnextchar\bgroup
+       {\FVExtraReadVArg{\csname RobustNewMint#1 at ii\endcsname{##1}}}%
+       {\PackageError{minted}%
+         {Delimiters must be paired curly braces in this context}%
+         {Use curly braces as delimiters}}}%
+     {\FVExtraReadVArg{\csname RobustNewMint#1 at ii\endcsname{##1}}}}
+  \expandafter\def\csname RobustNewMint#1 at ii\endcsname##1##2{%
+    \RobustMintProcess{#3,##1}{#2}{##2}}}
 %    \end{macrocode}
-% Same as with |\newminted|, look whether an explicit name is provided.
-% If not, take the language name as command name.
-%    \begin{macrocode}
-  \ifthenelse{\equal{#1}{}}
-    {\def\minted at shortname{#2}}
-    {\def\minted at shortname{#1}}
-%    \end{macrocode}
-% And define the macro.
-%    \begin{macrocode}
-  \expandafter\newcommand\csname\minted at shortname\endcsname[2][]{
-    \mint[#3,##1]{#2}##2}}
-%    \end{macrocode}
 % \end{macro}
 %
 %
@@ -3510,22 +3529,32 @@
 %
 % \begin{macro}{\newmintinline}
 % Define an alias for |\mintinline|.
-%
-% As is usual with inline commands, a little catcode trickery must be employed.
 %    \begin{macrocode}
 \newcommand{\newmintinline}[3][]{%
-  \ifthenelse{\equal{#1}{}}%
-    {\def\minted at shortname{#2inline}}%
-    {\def\minted at shortname{#1}}%
-    \expandafter\newrobustcmd\csname\minted at shortname\endcsname{%
-      \begingroup
-      \let\do\@makeother\dospecials
-      \catcode`\{=1
-      \catcode`\}=2
-      \@ifnextchar[{\endgroup\minted at inliner[#3][#2]}%
-        {\endgroup\minted at inliner[#3][#2][]}}%
-    \def\minted at inliner[##1][##2][##3]{\mintinline[##1,##3]{##2}}%
-}
+  \if\relax\detokenize{#1}\relax
+    \def\minted at shortname{#2inline}%
+  \else
+    \def\minted at shortname{#1}%
+  \fi
+  \expandafter\newmintinline at i\expandafter{\minted at shortname}{#2}{#3}}
+\def\newmintinline at i#1#2#3{%
+  \expandafter\newcommand\csname#1\endcsname{%
+    \expandafter\FVExtraRobustCommand\csname RobustNewMintInline#1\endcsname
+      \FVExtraUnexpandedReadStarOArgBVArg}%
+  \FVExtrapdfstringdefDisableCommands{%
+    \expandafter\def\csname RobustNewMintInline#1\endcsname{}}%
+  \expandafter\newrobustcmd\csname RobustNewMintInline#1\endcsname{%
+    \FVExtraReadOArgBeforeVArg{\csname RobustNewMintInline#1 at i\endcsname}}%
+  \expandafter\def\csname RobustNewMintInline#1 at i\endcsname##1{%
+    \ifbool{FVExtraRobustCommandExpanded}%
+     {\@ifnextchar\bgroup
+       {\FVExtraReadVArg{\csname RobustNewMintInline#1 at ii\endcsname{##1}}}%
+       {\PackageError{minted}%
+         {Inline delimiters must be paired curly braces in this context}%
+         {Use curly braces as delimiters}}}%
+     {\FVExtraReadVArg{\csname RobustNewMintInline#1 at ii\endcsname{##1}}}}
+  \expandafter\def\csname RobustNewMintInline#1 at ii\endcsname##1##2{%
+    \RobustMintInlineProcess{#3,##1}{#2}{##2}}}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -3549,7 +3578,7 @@
 %    \end{macrocode}
 % \end{environment}
 %
-% The following macros only apply when |listing| is created with the \pkg{float} package.  When |listing| is created with \pkg{newfloat}, its properties should be modified using \pkg{newfloat}'s |\SetupFloatingEnvironment|.
+% The following macros only apply when |listing| is created with the \texpkg{float} package.  When |listing| is created with \texpkg{newfloat}, its properties should be modified using \texpkg{newfloat}'s |\SetupFloatingEnvironment|.
 %    \begin{macrocode}
 \ifminted at newfloat\else
 %    \end{macrocode}
@@ -3582,7 +3611,7 @@
 % \begin{macro}{\listoflistings}
 %
 % Used to produce a list of listings (like |\listoffigures| etc.).
-% This may well clash with other packages (for example, \pkg{listings}) but we choose to ignore this
+% This may well clash with other packages (for example, \texpkg{listings}) but we choose to ignore this
 % since these two packages shouldn't be used together in the first place.
 %
 %    \begin{macrocode}
@@ -3590,7 +3619,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% Again, the preceding macros only apply when \pkg{float} is used to create listings, so we need to end the conditional.
+% Again, the preceding macros only apply when \texpkg{float} is used to create listings, so we need to end the conditional.
 %    \begin{macrocode}
 \fi
 %    \end{macrocode}
@@ -3667,13 +3696,13 @@
 %<*packageone>
 % \fi
 %
-% \pkg{minted} version 2 is designed to be completely compatible with version 1.7.  All of the same options and commands still exist.  As far as most users are concerned, the only difference should be the new commands and options.
+% \texpkg{minted} version 2 is designed to be completely compatible with version 1.7.  All of the same options and commands still exist.  As far as most users are concerned, the only difference should be the new commands and options.
 %
-% However, \pkg{minted} 2 does require some additional packages compared to \pkg{minted} 1.7.  More importantly, since \pkg{minted} 2 has almost completely new internal code, user code that accessed the internals of 1.7 will generally not work with 2.0, at least not without some modification.  For these reasons, a copy of \pkg{minted} 1.7 is supplied as the package \pkg{minted1}.  This is intended \emph{only} for compatibility cases when using the current version is too inconvenient.
+% However, \texpkg{minted} 2 does require some additional packages compared to \texpkg{minted} 1.7.  More importantly, since \texpkg{minted} 2 has almost completely new internal code, user code that accessed the internals of 1.7 will generally not work with 2.0, at least not without some modification.  For these reasons, a copy of \texpkg{minted} 1.7 is supplied as the package \texpkg{minted1}.  This is intended \emph{only} for compatibility cases when using the current version is too inconvenient.
 %
-% The code in \pkg{minted1} is an exact copy of \pkg{minted} version 1.7, except for two things:  (1) the package has been renamed, and (2) code has been added that allows \pkg{minted1} to act as (impersonate) \pkg{minted}, so that it can cooperate with other packages that require \pkg{minted} to be loaded.\footnote{The approach used for doing this is described at \url{http://tex.stackexchange.com/a/39418/10742}.}  When \pkg{minted1} is used, it must be loaded \emph{before} any other packages that would require \pkg{minted}.
+% The code in \texpkg{minted1} is an exact copy of \texpkg{minted} version 1.7, except for two things:  (1) the package has been renamed, and (2) code has been added that allows \texpkg{minted1} to act as (impersonate) \texpkg{minted}, so that it can cooperate with other packages that require \texpkg{minted} to be loaded.\footnote{The approach used for doing this is described at \url{http://tex.stackexchange.com/a/39418/10742}.}  When \texpkg{minted1} is used, it must be loaded \emph{before} any other packages that would require \texpkg{minted}.
 %
-% All modifications to the original \pkg{minted} 1.7 source are indicated with comments.  All original code that has been replaced has been commented out rather than deleted.  Any future modifications of \pkg{minted1} should \emph{only} be for the purpose of allowing it to serve better as a drop-in compatibility substitute for the current release of \pkg{minted}.
+% All modifications to the original \texpkg{minted} 1.7 source are indicated with comments.  All original code that has been replaced has been commented out rather than deleted.  Any future modifications of \texpkg{minted1} should \emph{only} be for the purpose of allowing it to serve better as a drop-in compatibility substitute for the current release of \texpkg{minted}.
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}

Modified: trunk/Master/texmf-dist/source/latex/minted/minted.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/minted/minted.ins	2022-12-12 21:00:50 UTC (rev 65251)
+++ trunk/Master/texmf-dist/source/latex/minted/minted.ins	2022-12-12 21:01:06 UTC (rev 65252)
@@ -3,7 +3,7 @@
 \askforoverwritefalse
 
 \preamble
-Copyright 2013--2021 Geoffrey M. Poore
+Copyright 2013--2022 Geoffrey M. Poore
 Copyright 2010--2011 Konrad Rudolph
 
 This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/tex/latex/minted/minted.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/minted/minted.sty	2022-12-12 21:00:50 UTC (rev 65251)
+++ trunk/Master/texmf-dist/tex/latex/minted/minted.sty	2022-12-12 21:01:06 UTC (rev 65252)
@@ -5,7 +5,7 @@
 %% The original source files were:
 %%
 %% minted.dtx  (with options: `package')
-%% Copyright 2013--2021 Geoffrey M. Poore
+%% Copyright 2013--2022 Geoffrey M. Poore
 %% Copyright 2010--2011 Konrad Rudolph
 %% 
 %% This work may be distributed and/or modified under the
@@ -27,7 +27,7 @@
 %% and the derived file minted.sty.
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{minted}
-    [2021/12/24 v2.6 Yet another Pygments shim for LaTeX]
+    [2022/12/12 v2.7 Yet another Pygments shim for LaTeX]
 \RequirePackage{keyval}
 \RequirePackage{kvoptions}
 \RequirePackage{fvextra}
@@ -227,148 +227,145 @@
     \expandafter\gdef\csname minted at optlistfv@lang\minted at lang @i\endcsname{}%
   \fi
 }
-\newcommand{\minted at addto@optlistcl}[2]{%
+\ifwindows
+  \newcommand{\minted at optlistcl@quote}[2]{%
+    \detokenize{#1="#2"}}
+\else
+  \newcommand{\minted at optlistcl@quote}[2]{%
+    \detokenize{#1='#2'}}
+\fi
+\newcommand{\minted at addto@optlistcl}[3]{%
   \expandafter\def\expandafter#1\expandafter{#1%
-    \detokenize{#2}\space}}
-\newcommand{\minted at addto@optlistcl at lang}[2]{%
+    \minted at optlistcl@quote{#2}{#3}\space}}
+\newcommand{\minted at addto@optlistcl at lang}[3]{%
   \expandafter\let\expandafter\minted at tmp\csname #1\endcsname
   \expandafter\def\expandafter\minted at tmp\expandafter{\minted at tmp%
-    \detokenize{#2}\space}%
+    \minted at optlistcl@quote{#2}{#3}\space}%
   \expandafter\let\csname #1\endcsname\minted at tmp}
 \newcommand{\minted at def@optcl}[4][]{%
   \ifthenelse{\equal{#1}{}}%
     {\define at key{minted at opt@g}{#2}{%
-        \minted at addto@optlistcl{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}{%
-        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}{%
-        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}{%
         \minted at addto@optlistcl at lang{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}{%
-        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
     {\define at key{minted at opt@g}{#2}[#1]{%
-        \minted at addto@optlistcl{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}[#1]{%
-        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}[#1]{%
-        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}[#1]{%
         \minted at addto@optlistcl at lang{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}[#1]{%
-        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
 }
-\edef\minted at hashchar{\string#}
-\edef\minted at dollarchar{\string$}
-\edef\minted at ampchar{\string&}
-\edef\minted at underscorechar{\string_}
-\edef\minted at tildechar{\string~}
-\edef\minted at leftsquarebracket{\string[}
-\edef\minted at rightsquarebracket{\string]}
-\newcommand{\minted at escchars}{%
-  \let\#\minted at hashchar
-  \let\%\@percentchar
-  \let\{\@charlb
-  \let\}\@charrb
-  \let\$\minted at dollarchar
-  \let\&\minted at ampchar
-  \let\_\minted at underscorechar
-  \let\\\@backslashchar
-  \let~\minted at tildechar
-  \let\~\minted at tildechar
-  \let\[\minted at leftsquarebracket
-  \let\]\minted at rightsquarebracket
-} %$ <- highlighting
-\newcommand{\minted at addto@optlistcl at e}[2]{%
-  \begingroup
-  \minted at escchars
-  \xdef\minted at xtmp{#2}%
-  \endgroup
-  \expandafter\minted at addto@optlistcl at e@i\expandafter{\minted at xtmp}{#1}}
-\def\minted at addto@optlistcl at e@i#1#2{%
-  \expandafter\def\expandafter#2\expandafter{#2#1\space}}
-\newcommand{\minted at addto@optlistcl at lang@e}[2]{%
-  \begingroup
-  \minted at escchars
-  \xdef\minted at xtmp{#2}%
-  \endgroup
-  \expandafter\minted at addto@optlistcl at lang@e at i\expandafter{\minted at xtmp}{#1}}
-\def\minted at addto@optlistcl at lang@e at i#1#2{%
+\begingroup
+\catcode`\!=0
+!catcode`!\=12
+!gdef!minted at escape#1{%
+  !expandafter!minted at escape@i!detokenize{#1}\!FV at Sentinel}
+!gdef!minted at escape@i#1\#2!FV at Sentinel{%
+  !if!relax!detokenize{#2}!relax
+    !expandafter!@firstoftwo
+  !else
+    !expandafter!@secondoftwo
+  !fi
+  {#1!minted at escape@end\#2!FV at Sentinel}
+  {#1!minted at escape@esc\#2!FV at Sentinel}}
+!gdef!minted at escape@end#1!FV at Sentinel{}
+!gdef!minted at escape@esc\#1#2!FV at Sentinel{%
+  #1!minted at escape@i#2!FV at Sentinel}
+!endgroup
+\newcommand{\minted at addto@optlistcl at e}[3]{%
+  \edef\minted at tmp{\minted at escape{#3}}%
+  \expandafter\minted at addto@optlistcl at e@i\expandafter{\minted at tmp}{#1}{#2}}
+\def\minted at addto@optlistcl at e@i#1#2#3{%
+  \expandafter\def\expandafter#2\expandafter{#2\minted at optlistcl@quote{#3}{#1}\space}}
+\newcommand{\minted at addto@optlistcl at lang@e}[3]{%
+  \edef\minted at tmp{\minted at escape{#3}}%
+  \expandafter\minted at addto@optlistcl at lang@e at i\expandafter{\minted at tmp}{#1}{#2}}
+\def\minted at addto@optlistcl at lang@e at i#1#2#3{%
   \expandafter\let\expandafter\minted at tmp\csname #2\endcsname
-  \expandafter\def\expandafter\minted at tmp\expandafter{\minted at tmp#1\space}%
+  \expandafter\def\expandafter\minted at tmp\expandafter{\minted at tmp\minted at optlistcl@quote{#3}{#1}\space}%
   \expandafter\let\csname #2\endcsname\minted at tmp}
 \newcommand{\minted at def@optcl at e}[4][]{%
   \ifthenelse{\equal{#1}{}}%
     {\define at key{minted at opt@g}{#2}{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}{%
-        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}{%
         \minted at addto@optlistcl at lang@e{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
     {\define at key{minted at opt@g}{#2}[#1]{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g}{#3}{#4}%
         \@namedef{minted at opt@g:#2}{#4}}%
       \define at key{minted at opt@g at i}{#2}[#1]{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@g at i}{#3}{#4}%
         \@namedef{minted at opt@g at i:#2}{#4}}%
       \define at key{minted at opt@lang}{#2}[#1]{%
-        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3=#4}%
+        \minted at addto@optlistcl at lang@e{minted at optlistcl@lang\minted at lang}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang:#2}{#4}}%
       \define at key{minted at opt@lang at i}{#2}[#1]{%
         \minted at addto@optlistcl at lang@e{%
-          minted at optlistcl@lang\minted at lang @i}{#3=#4}%
+          minted at optlistcl@lang\minted at lang @i}{#3}{#4}%
         \@namedef{minted at opt@lang\minted at lang @i:#2}{#4}}%
       \define at key{minted at opt@cmd}{#2}[#1]{%
-        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3=#4}%
+        \minted at addto@optlistcl at e{\minted at optlistcl@cmd}{#3}{#4}%
         \@namedef{minted at opt@cmd:#2}{#4}}}%
 }
 \newcommand{\minted at def@optcl at switch}[2]{%
   \define at booleankey{minted at opt@g}{#1}%
-    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2=True}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2}{True}%
       \@namedef{minted at opt@g:#1}{true}}
-    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2=False}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g}{#2}{False}%
       \@namedef{minted at opt@g:#1}{false}}
   \define at booleankey{minted at opt@g at i}{#1}%
-    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2=True}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2}{True}%
       \@namedef{minted at opt@g at i:#1}{true}}
-    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2=False}%
+    {\minted at addto@optlistcl{\minted at optlistcl@g at i}{#2}{False}%
       \@namedef{minted at opt@g at i:#1}{false}}
   \define at booleankey{minted at opt@lang}{#1}%
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2=True}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2}{True}%
       \@namedef{minted at opt@lang\minted at lang:#1}{true}}
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2=False}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang}{#2}{False}%
       \@namedef{minted at opt@lang\minted at lang:#1}{false}}
   \define at booleankey{minted at opt@lang at i}{#1}%
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2=True}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2}{True}%
       \@namedef{minted at opt@lang\minted at lang @i:#1}{true}}
-    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2=False}%
+    {\minted at addto@optlistcl at lang{minted at optlistcl@lang\minted at lang @i}{#2}{False}%
       \@namedef{minted at opt@lang\minted at lang @i:#1}{false}}
   \define at booleankey{minted at opt@cmd}{#1}%
-      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2=True}%
+      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2}{True}%
         \@namedef{minted at opt@cmd:#1}{true}}
-      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2=False}%
+      {\minted at addto@optlistcl{\minted at optlistcl@cmd}{#2}{False}%
         \@namedef{minted at opt@cmd:#1}{false}}
 }
 \newcommand{\minted at def@optfv}[1]{%
@@ -552,6 +549,7 @@
   \fi
   \csname minted at PYGdef@\minted at style\endcsname
   \minted at patch@PYGZsq
+  \minted at patch@PYGZhy
 }
 \ifthenelse{\boolean{minted at draft}}{\renewcommand{\minted at defstyle}[1]{}}{}
 \newcommand{\minted at patch@PYGZsq}{%
@@ -565,7 +563,13 @@
 \catcode`\'=\active
 \gdef\minted at patch@PYGZsq at i{\gdef\PYGZsq{'}}
 \endgroup
-\ifthenelse{\boolean{minted at draft}}{}{\AtBeginDocument{\minted at patch@PYGZsq}}
+\newcommand{\minted at patch@PYGZhy}{%
+  \ifcsname PYGZhy\endcsname
+    \expandafter\ifdefstring\expandafter{\csname PYGZhy\endcsname}{\char`\-}%
+     {\def\PYGZhy{\mbox{-}}}%
+     {}%
+  \fi
+}
 \newcommand{\minted at def@opt at switch}[2][false]{%
   \define at booleankey{minted at opt@g}{#2}%
     {\@namedef{minted at opt@g:#2}{true}}%
@@ -621,7 +625,7 @@
 }%
 \minted at def@optcl{encoding}{-P encoding}{#1}
 \minted at def@optcl{outencoding}{-P outencoding}{#1}
-\minted at def@optcl at e{escapeinside}{-P "escapeinside}{#1"}
+\minted at def@optcl at e{escapeinside}{-P escapeinside}{#1}
 \minted at def@optcl at switch{stripnl}{-P stripnl}
 \minted at def@optcl at switch{stripall}{-P stripall}
 \minted at def@optcl at switch{python3}{-P python3}
@@ -813,6 +817,11 @@
     \fi
   \fi
 }
+\ifwindows
+  \def\minted at opt@quote#1{\detokenize{"#1"}}
+\else
+  \def\minted at opt@quote#1{\detokenize{'#1'}}
+\fi
 \newcommand{\minted at pygmentize}[2][\minted at outputdir\minted at jobname.pyg]{%
   \minted at defstyle{\minted at get@opt{style}{default}}%
   \stepcounter{minted at pygmentizecounter}%
@@ -830,7 +839,7 @@
         \detokenize{for /f "usebackq tokens=*"}\space\@percentchar\detokenize{a in (`kpsewhich}\space\minted at codefile\detokenize{`) do}\space
       \fi
     \fi
-    \MintedPygmentize\space -l #2
+    \MintedPygmentize\space -l \minted at opt@quote{#2}
     -f latex -P commandprefix=PYG -F tokenmerge
     \minted at optlistcl@g \csname minted at optlistcl@lang\minted at lang\endcsname
     \minted at optlistcl@inlines
@@ -928,7 +937,7 @@
     fvstartnum = }\the\numexpr\FancyVerbStartNum\detokenize{;
     fvstopnum = }\the\numexpr\FancyVerbStopNum\detokenize{;
     s = max(0, fvstartnum-1);
-    e = min(s, fvstopnum if fvstopnum > 0 else len(t_opt));
+    e = max(s, fvstopnum) if fvstopnum > 0 else len(t_opt);
     [f.write(textwrap.dedent(\"\".join(x))) for x in (t_opt[0:s], t_opt[s:e], t_opt[e:]) if x and t is not None];
     f.close() if t is not None else os.remove(tmpfname);"}%
     \ifminted at kpsewhich
@@ -1002,111 +1011,89 @@
   \immediate\openout\minted at code\minted at jobname.pyg\relax
   \immediate\write\minted at code{\detokenize{#1}}%
   \immediate\closeout\minted at code}
-\newrobustcmd{\mintinline}[2][]{%
+\def\mintinline{%
+  \FVExtraRobustCommand\RobustMintInline\FVExtraUnexpandedReadStarOArgMArgBVArg}
+\FVExtrapdfstringdefDisableCommands{%
+  \def\RobustMintInline{}}
+\newrobustcmd{\RobustMintInline}[2][]{%
+  \ifbool{FVExtraRobustCommandExpanded}%
+   {\@ifnextchar\bgroup
+     {\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}%
+     {\PackageError{minted}%
+       {Inline delimiters must be paired curly braces in this context}%
+       {Use curly braces as delimiters}}}%
+   {\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}}
+\def\RobustMintInlineProcess#1#2#3{%
   \begingroup
   \setboolean{minted at isinline}{true}%
   \minted at configlang{#2}%
   \setkeys{minted at opt@cmd}{#1}%
   \minted at fvset
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\{=1
-  \catcode`\}=2
-  \catcode`\^^I=\active
-  \@ifnextchar\bgroup
-    {\minted at inline@iii}%
-    {\catcode`\{=12\catcode`\}=12
-      \minted at inline@i}}
-\def\minted at inline@i#1{%
-  \endgroup
-  \def\minted at inline@ii##1#1{%
-    \minted at inline@iii{##1}}%
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\^^I=\active
-  \minted at inline@ii}
+  \RobustMintInlineProcess at i{#3}}
 \ifthenelse{\boolean{minted at draft}}%
-  {\newcommand{\minted at inline@iii}[1]{%
-    \endgroup
-    \begingroup
-    \minted at defwhitespace@retok
-    \everyeof{\noexpand}%
-    \endlinechar-1\relax
-    \let\do\@makeother\dospecials
-    \catcode`\ =\active
-    \catcode`\^^I=\active
-    \xdef\minted at tmp{\scantokens{#1}}%
-    \endgroup
-    \let\FV at Line\minted at tmp
-    \def\FV at SV@minted at tmp{%
-      \FV at Gobble
-      \expandafter\FV at ProcessLine\expandafter{\FV at Line}}%
-    \ifthenelse{\equal{\minted at get@opt{breaklines}{false}}{true}}%
-     {\let\FV at BeginVBox\relax
-      \let\FV at EndVBox\relax
-      \def\FV at BProcessLine##1{\FancyVerbFormatLine{##1}}%
-      \BUseVerbatim{minted at tmp}}%
-     {\BUseVerbatim{minted at tmp}}%
+ {\def\RobustMintInlineProcess at i#1{%
+    \fvset{extra=true}%
+    \Verb{#1}%
     \endgroup}}%
-  {\newcommand{\minted at inline@iii}[1]{%
-    \endgroup
+ {\def\RobustMintInlineProcess at i#1{%
+   \FVExtraDetokenizeVArg{%
+     \FVExtraRetokenizeVArg{\RobustMintInlineProcess at ii}{\FV at CatCodes}}{#1}}
+  \def\RobustMintInlineProcess at ii#1{%
     \minted at writecmdcode{#1}%
-    \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}%
-    \setcounter{minted at FancyVerbLineTemp}{\value{FancyVerbLine}}%
-    \minted at pygmentize{\minted at lang}%
-    \setcounter{FancyVerbLine}{\value{minted at FancyVerbLineTemp}}%
+    \let\Verbatim\VerbEnv
+    \let\endVerbatim\endVerbEnv
+    \expandafter\minted at pygmentize\expandafter{\minted at lang}%
     \endgroup}}
-\newrobustcmd{\mint}[2][]{%
+\def\mint{%
+  \FVExtraRobustCommand\RobustMint\FVExtraUnexpandedReadStarOArgMArgBVArg}
+\FVExtrapdfstringdefDisableCommands{%
+  \def\RobustMint{}}
+\newrobustcmd{\RobustMint}[2][]{%
+  \ifbool{FVExtraRobustCommandExpanded}%
+   {\@ifnextchar\bgroup
+     {\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}%
+     {\PackageError{minted}%
+       {Delimiters must be paired curly braces in this context}%
+       {Use curly braces as delimiters}}}%
+   {\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}}
+\def\RobustMintProcess#1#2#3{%
   \begingroup
   \minted at configlang{#2}%
   \setkeys{minted at opt@cmd}{#1}%
   \minted at fvset
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\{=1
-  \catcode`\}=2
-  \catcode`\^^I=\active
-  \@ifnextchar\bgroup
-    {\mint at iii}%
-    {\catcode`\{=12\catcode`\}=12
-      \mint at i}}
-\def\mint at i#1{%
-  \endgroup
-  \def\mint at ii##1#1{%
-    \mint at iii{##1}}%
-  \begingroup
-  \let\do\@makeother\dospecials
-  \catcode`\^^I=\active
-  \mint at ii}
+  \RobustMintProcess at i{#3}}
+\begingroup
+\catcode`\^^M=\active%
+\catcode`\<=1%
+\catcode`\>=2%
+\catcode`\{=12%
+\catcode`\}=12%
+\catcode`\!=0%
+\catcode`\\=12%
+!ifthenelse<!boolean<minted at draft>>%
+ <!gdef!RobustMintProcess at i#1<%
+    !FVExtraDetokenizeVArg<%
+      !FVExtraRetokenizeVArg<!RobustMintProcess at ii><!FV at CatCodes>><#1>>%
+  !gdef!RobustMintProcess at ii#1<%
+    !minted at langlinenoson%
+    !scantokens<%
+      \begin{Verbatim}
+      #1
+      \end{Verbatim}
+      !noexpand>%
+    !minted at langlinenosoff%
+    !endgroup!@doendpe>>%
+ <!gdef!RobustMintProcess at i#1<%
+    !FVExtraDetokenizeVArg<%
+      !FVExtraRetokenizeVArg<!RobustMintProcess at ii><!FV at CatCodes>><#1>>%
+  !gdef!RobustMintProcess at ii#1<%
+    !minted at writecmdcode<#1>%
+    !minted at langlinenoson%
+    !expandafter!minted at pygmentize!expandafter<!minted at lang>%
+    !minted at langlinenosoff%
+    !endgroup!@doendpe>>%
+!endgroup
 \ifthenelse{\boolean{minted at draft}}%
-  {\newcommand{\mint at iii}[1]{%
-    \endgroup
-    \begingroup
-    \minted at defwhitespace@retok
-    \everyeof{\noexpand}%
-    \endlinechar-1\relax
-    \let\do\@makeother\dospecials
-    \catcode`\ =\active
-    \catcode`\^^I=\active
-    \xdef\minted at tmp{\scantokens{#1}}%
-    \endgroup
-    \let\FV at Line\minted at tmp
-    \def\FV at SV@minted at tmp{%
-      \FV at CodeLineNo=1\FV at StepLineNo
-      \FV at Gobble
-      \expandafter\FV at ProcessLine\expandafter{\FV at Line}}%
-    \minted at langlinenoson
-    \UseVerbatim{minted at tmp}%
-    \minted at langlinenosoff
-    \endgroup}}%
-  {\newcommand{\mint at iii}[1]{%
-    \endgroup
-    \minted at writecmdcode{#1}%
-    \minted at langlinenoson
-    \minted at pygmentize{\minted at lang}%
-    \minted at langlinenosoff
-    \endgroup}}
-\ifthenelse{\boolean{minted at draft}}%
   {\newenvironment{minted}[2][]
     {\VerbatimEnvironment
       \minted at configlang{#2}%
@@ -1126,7 +1113,7 @@
       \begin{VerbatimOut}[codes={\catcode`\^^I=12},firstline,lastline]{\minted at jobname.pyg}}%
     {\end{VerbatimOut}%
         \minted at langlinenoson
-        \minted at pygmentize{\minted at lang}%
+        \expandafter\minted at pygmentize\expandafter{\minted at lang}%
         \minted at langlinenosoff}}
 \ifthenelse{\boolean{minted at draft}}%
   {\newcommand{\inputminted}[3][]{%
@@ -1154,12 +1141,31 @@
   \newenvironment{\minted at envname *}[1]
     {\VerbatimEnvironment\begin{minted}[#3,##1]{#2}}
     {\end{minted}}}
-\newcommand{\newmint}[3][]{
-  \ifthenelse{\equal{#1}{}}
-    {\def\minted at shortname{#2}}
-    {\def\minted at shortname{#1}}
-  \expandafter\newcommand\csname\minted at shortname\endcsname[2][]{
-    \mint[#3,##1]{#2}##2}}
+\newcommand{\newmint}[3][]{%
+  \if\relax\detokenize{#1}\relax
+    \def\minted at shortname{#2}%
+  \else
+    \def\minted at shortname{#1}%
+  \fi
+  \expandafter\newmint at i\expandafter{\minted at shortname}{#2}{#3}}
+\def\newmint at i#1#2#3{%
+  \expandafter\newcommand\csname#1\endcsname{%
+    \expandafter\FVExtraRobustCommand\csname RobustNewMint#1\endcsname
+      \FVExtraUnexpandedReadStarOArgBVArg}%
+  \FVExtrapdfstringdefDisableCommands{%
+    \expandafter\def\csname RobustNewMint#1\endcsname{}}%
+  \expandafter\newrobustcmd\csname RobustNewMint#1\endcsname{%
+    \FVExtraReadOArgBeforeVArg{\csname RobustNewMint#1 at i\endcsname}}%
+  \expandafter\def\csname RobustNewMint#1 at i\endcsname##1{%
+    \ifbool{FVExtraRobustCommandExpanded}%
+     {\@ifnextchar\bgroup
+       {\FVExtraReadVArg{\csname RobustNewMint#1 at ii\endcsname{##1}}}%
+       {\PackageError{minted}%
+         {Delimiters must be paired curly braces in this context}%
+         {Use curly braces as delimiters}}}%
+     {\FVExtraReadVArg{\csname RobustNewMint#1 at ii\endcsname{##1}}}}
+  \expandafter\def\csname RobustNewMint#1 at ii\endcsname##1##2{%
+    \RobustMintProcess{#3,##1}{#2}{##2}}}
 \newcommand{\newmintedfile}[3][]{
   \ifthenelse{\equal{#1}{}}
     {\def\minted at shortname{#2file}}
@@ -1167,18 +1173,30 @@
   \expandafter\newcommand\csname\minted at shortname\endcsname[2][]{
     \inputminted[#3,##1]{#2}{##2}}}
 \newcommand{\newmintinline}[3][]{%
-  \ifthenelse{\equal{#1}{}}%
-    {\def\minted at shortname{#2inline}}%
-    {\def\minted at shortname{#1}}%
-    \expandafter\newrobustcmd\csname\minted at shortname\endcsname{%
-      \begingroup
-      \let\do\@makeother\dospecials
-      \catcode`\{=1
-      \catcode`\}=2
-      \@ifnextchar[{\endgroup\minted at inliner[#3][#2]}%
-        {\endgroup\minted at inliner[#3][#2][]}}%
-    \def\minted at inliner[##1][##2][##3]{\mintinline[##1,##3]{##2}}%
-}
+  \if\relax\detokenize{#1}\relax
+    \def\minted at shortname{#2inline}%
+  \else
+    \def\minted at shortname{#1}%
+  \fi
+  \expandafter\newmintinline at i\expandafter{\minted at shortname}{#2}{#3}}
+\def\newmintinline at i#1#2#3{%
+  \expandafter\newcommand\csname#1\endcsname{%
+    \expandafter\FVExtraRobustCommand\csname RobustNewMintInline#1\endcsname
+      \FVExtraUnexpandedReadStarOArgBVArg}%
+  \FVExtrapdfstringdefDisableCommands{%
+    \expandafter\def\csname RobustNewMintInline#1\endcsname{}}%
+  \expandafter\newrobustcmd\csname RobustNewMintInline#1\endcsname{%
+    \FVExtraReadOArgBeforeVArg{\csname RobustNewMintInline#1 at i\endcsname}}%
+  \expandafter\def\csname RobustNewMintInline#1 at i\endcsname##1{%
+    \ifbool{FVExtraRobustCommandExpanded}%
+     {\@ifnextchar\bgroup
+       {\FVExtraReadVArg{\csname RobustNewMintInline#1 at ii\endcsname{##1}}}%
+       {\PackageError{minted}%
+         {Inline delimiters must be paired curly braces in this context}%
+         {Use curly braces as delimiters}}}%
+     {\FVExtraReadVArg{\csname RobustNewMintInline#1 at ii\endcsname{##1}}}}
+  \expandafter\def\csname RobustNewMintInline#1 at ii\endcsname##1##2{%
+    \RobustMintInlineProcess{#3,##1}{#2}{##2}}}
 \ifthenelse{\boolean{minted at newfloat}}%
  {\@ifundefined{minted at float@within}%
     {\DeclareFloatingEnvironment[fileext=lol,placement=tbp]{listing}}%

Modified: trunk/Master/texmf-dist/tex/latex/minted/minted1.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/minted/minted1.sty	2022-12-12 21:00:50 UTC (rev 65251)
+++ trunk/Master/texmf-dist/tex/latex/minted/minted1.sty	2022-12-12 21:01:06 UTC (rev 65252)
@@ -5,7 +5,7 @@
 %% The original source files were:
 %%
 %% minted.dtx  (with options: `packageone')
-%% Copyright 2013--2021 Geoffrey M. Poore
+%% Copyright 2013--2022 Geoffrey M. Poore
 %% Copyright 2010--2011 Konrad Rudolph
 %% 
 %% This work may be distributed and/or modified under the



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