summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-06-18 15:50:36 +0000
committerKarl Berry <karl@freefriends.org>2016-06-18 15:50:36 +0000
commitfca717399bb79f5db531685f7e16aa0e0f40a71f (patch)
treeee6c8df0e675c317433dbf3d4063a7d139fa4f92 /Master/texmf-dist
parent898884bc072f148e935c8d40f6d4487d2b69732f (diff)
minted (16jun16)
git-svn-id: svn://tug.org/texlive/trunk@41483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/minted/minted.pdfbin715677 -> 717119 bytes
-rw-r--r--Master/texmf-dist/source/latex/minted/minted.dtx92
-rw-r--r--Master/texmf-dist/tex/latex/minted/minted.sty78
3 files changed, 96 insertions, 74 deletions
diff --git a/Master/texmf-dist/doc/latex/minted/minted.pdf b/Master/texmf-dist/doc/latex/minted/minted.pdf
index fbc05ca2385..0219ff077b5 100644
--- a/Master/texmf-dist/doc/latex/minted/minted.pdf
+++ b/Master/texmf-dist/doc/latex/minted/minted.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/minted/minted.dtx b/Master/texmf-dist/source/latex/minted/minted.dtx
index 48c45077068..96c6abdc5e2 100644
--- a/Master/texmf-dist/source/latex/minted/minted.dtx
+++ b/Master/texmf-dist/source/latex/minted/minted.dtx
@@ -31,7 +31,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{minted}
%<*package>
- [2016/06/08 v2.2 Yet another Pygments shim for LaTeX]
+ [2016/06/15 v2.2.1 Yet another Pygments shim for LaTeX]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -170,7 +170,7 @@
%</driver>
% \fi
%
-% \CheckSum{3835}
+% \CheckSum{3853}
%
% \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
@@ -191,12 +191,18 @@
%
%
%
+% \begin{changelog}{v2.2.1}{2016/06/15}
+% \item The \texttt{shellesc} package is loaded before \texttt{ifplatform} and other packages that might invoke \texttt{\string\write18} (\#112).
+% \item When caching is enabled, XeTeX uses the new \texttt{\string\mdfivesum} macro from TeX Live 2016 to hash cache content, rather than using \texttt{\string\ShellEscape} with Python to perform hashing.
+% \end{changelog}
+%
+%
% \begin{changelog}{v2.2}{2016/06/08}
% \item All uses of \texttt{\string\ShellEscape} (\texttt{\string\write18}) no longer wrap file names and paths with double quotes. This allows a cache directory to be specified relative to a user's home directory, for example, \texttt{\string~/minted\_cache}. \texttt{cachedir} and \texttt{outputdir} paths containing spaces will now require explicit quoting of the parts of the paths that contain spaces, since \texttt{minted} no longer supplies quoting. See the updated documentation for examples (\#89).
% \item Added \texttt{breakbefore}, \texttt{breakbeforegroup}, \texttt{breakbeforesymbolpre}, and \texttt{breakbeforesymbolpost}. These parallel \texttt{breakafter*}. It is possible to use \texttt{breakbefore} and \texttt{breakafter} for the same character, so long as \texttt{breakbeforegroup} and \texttt{breakaftergroup} have the same setting (\#117).
% \item Added package options \texttt{finalizecache} and \texttt{frozencache}. These allow the cache to be prepared for (\texttt{finalizecache}) and then used (\texttt{frozencache}) in an environment in which \texttt{-shell-escape}, Python, and/or Pygments are not available. Note that this only works if \texttt{minted} content does not need to be modified, and if no settings that depend on Pygments or Python need to be changed (\#113).
% \item Style names containing hyphens and underscores (\texttt{paraiso-light}, \texttt{paraiso-dark}, \texttt{algol\_nu}) now work (\#111).
-% \item The \texttt{shellesc} package is now loaded, when available, for compatibility with \texttt{luatex} 0.87+ (TeX Live 2016+, etc.). \texttt{\string\ShellEscape} is now used everywhere instead of \texttt{\string\immediate\string\write18}. If \texttt{shellesc} is not available, then a \texttt{\string\ShellEscape} macro is created. When \texttt{shellesc} is loaded, there is a check for versions before v0.01c to patch a bug in v0.01b (present in TeX Live 2015) (\#112).
+% \item The \texttt{shellesc} package is now loaded, when available, for compatibility with LuaTeX 0.87+ (TeX Live 2016+, etc.). \texttt{\string\ShellEscape} is now used everywhere instead of \texttt{\string\immediate\string\write18}. If \texttt{shellesc} is not available, then a \texttt{\string\ShellEscape} macro is created. When \texttt{shellesc} is loaded, there is a check for versions before v0.01c to patch a bug in v0.01b (present in TeX Live 2015) (\#112).
% \item The \texttt{bgcolor} option now uses the \texttt{snugshade*} environment from the \texttt{framed} package, so \texttt{bgcolor} is now compatible with page breaks. When \texttt{bgcolor} is in use, immediately preceding text will no longer push the \texttt{minted} environment into the margin, and there is now adequate spacing from surrounding text (\#121).
% \item Added missing support for \texttt{fancyvrb}'s \texttt{labelposition} (\#102).
% \item Improved fix for TikZ externalization, thanks to Patrick Vogt (\#73).
@@ -747,7 +753,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.
%
-% 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 \texttt{XeTeX} engine since it lacks the built-in MD5 capabilities that \texttt{pdfTeX} and \texttt{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|.
+% 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|.
%
%
% \DescribeMacro{frozencache=\meta{boolean} (default: false)}
@@ -1432,7 +1438,7 @@
%
%
% \subsection{Required packages}
-% Load required packages. For compatibility reasons, most old functionality should be supported with the original set of packages. More recently added packages, such as |etoolbox| and |xstring|, should only be used for new features when possible.
+% Load required packages. For compatibility reasons, most old functionality should be supported with the original set of packages. More recently added packages, such as |etoolbox| and |xstring|, should only be used for new features when possible. |shellesc| must be loaded before any packages that invoke |\write18|, since it is possible that they haven't yet been patched to work with LuaTeX 0.87+.
% \begin{macrocode}
\RequirePackage{keyval}
\RequirePackage{kvoptions}
@@ -1440,18 +1446,18 @@
\RequirePackage{float}
\RequirePackage{ifthen}
\RequirePackage{calc}
-\RequirePackage{ifplatform}
-\RequirePackage{pdftexcmds}
-\RequirePackage{etoolbox}
-\RequirePackage{xstring}
-\RequirePackage{lineno}
-\RequirePackage{framed}
\IfFileExists{shellesc.sty}
{\RequirePackage{shellesc}
\@ifpackagelater{shellesc}{2016/04/29}
{}
{\protected\def\ShellEscape{\immediate\write18 }}}
{\protected\def\ShellEscape{\immediate\write18 }}
+\RequirePackage{ifplatform}
+\RequirePackage{pdftexcmds}
+\RequirePackage{etoolbox}
+\RequirePackage{xstring}
+\RequirePackage{lineno}
+\RequirePackage{framed}
% \end{macrocode}
%
% Make sure that either |color| or |xcolor| is loaded by the beginning of the document.
@@ -3505,34 +3511,42 @@
{\edef\minted@hash{\pdf@filemdfivesum{#1}%
\pdf@mdfivesum{\minted@cmd}}}%
\else
- \immediate\openout\minted@code\minted@jobname.mintedcmd\relax
- \immediate\write\minted@code{\minted@cmd}%
- \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
- {\immediate\write\minted@code{autogobble}}{}%
- \immediate\closeout\minted@code
- \edef\minted@argone@esc{#1}%
- \StrSubstitute{\minted@argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@argone@esc]%
- \StrSubstitute{\minted@argone@esc}{"}{\@backslashchar"}[\minted@argone@esc]%
- \edef\minted@tmpfname@esc{\minted@outputdir\minted@jobname}%
- \StrSubstitute{\minted@tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@tmpfname@esc]%
- \StrSubstitute{\minted@tmpfname@esc}{"}{\@backslashchar"}[\minted@tmpfname@esc]%
- %Cheating a little here by using ASCII codes to write `{` and `}`
- %in the Python code
- \def\minted@hashcmd{%
- \detokenize{python -c "import hashlib; import os;
- hasher = hashlib.sha1();
- f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedcmd\detokenize{\")), \"rb\");
- hasher.update(f.read());
- f.close();
- f = open(os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\")), \"rb\");
- hasher.update(f.read());
- f.close();
- f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedmd5\detokenize{\")), \"w\");
- macro = \"\\edef\\minted@hash\" + chr(123) + hasher.hexdigest() + chr(125) + \"\";
- f.write(\"\\makeatletter\" + macro + \"\\makeatother\\endinput\n\");
- f.close();"}}%
- \ShellEscape{\minted@hashcmd}%
- \minted@input{\minted@outputdir\minted@jobname.mintedmd5}%
+ \ifx\mdfivesum\minted@undefined
+ \immediate\openout\minted@code\minted@jobname.mintedcmd\relax
+ \immediate\write\minted@code{\minted@cmd}%
+ \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+ {\immediate\write\minted@code{autogobble}}{}%
+ \immediate\closeout\minted@code
+ \edef\minted@argone@esc{#1}%
+ \StrSubstitute{\minted@argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@argone@esc]%
+ \StrSubstitute{\minted@argone@esc}{"}{\@backslashchar"}[\minted@argone@esc]%
+ \edef\minted@tmpfname@esc{\minted@outputdir\minted@jobname}%
+ \StrSubstitute{\minted@tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@tmpfname@esc]%
+ \StrSubstitute{\minted@tmpfname@esc}{"}{\@backslashchar"}[\minted@tmpfname@esc]%
+ %Cheating a little here by using ASCII codes to write `{` and `}`
+ %in the Python code
+ \def\minted@hashcmd{%
+ \detokenize{python -c "import hashlib; import os;
+ hasher = hashlib.sha1();
+ f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedcmd\detokenize{\")), \"rb\");
+ hasher.update(f.read());
+ f.close();
+ f = open(os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\")), \"rb\");
+ hasher.update(f.read());
+ f.close();
+ f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedmd5\detokenize{\")), \"w\");
+ macro = \"\\edef\\minted@hash\" + chr(123) + hasher.hexdigest() + chr(125) + \"\";
+ f.write(\"\\makeatletter\" + macro + \"\\makeatother\\endinput\n\");
+ f.close();"}}%
+ \ShellEscape{\minted@hashcmd}%
+ \minted@input{\minted@outputdir\minted@jobname.mintedmd5}%
+ \else
+ \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+ {\edef\minted@hash{\mdfivesum file {#1}%
+ \mdfivesum{\minted@cmd autogobble}}}%
+ {\edef\minted@hash{\mdfivesum file {#1}%
+ \mdfivesum{\minted@cmd}}}%
+ \fi
\fi
\edef\minted@infile{\minted@cachedir/\minted@hash.pygtex}%
\IfFileExists{\minted@infile}{}{%
diff --git a/Master/texmf-dist/tex/latex/minted/minted.sty b/Master/texmf-dist/tex/latex/minted/minted.sty
index a9928e477a8..3a7e9432732 100644
--- a/Master/texmf-dist/tex/latex/minted/minted.sty
+++ b/Master/texmf-dist/tex/latex/minted/minted.sty
@@ -27,25 +27,25 @@
%% and the derived file minted.sty.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{minted}
- [2016/06/08 v2.2 Yet another Pygments shim for LaTeX]
+ [2016/06/15 v2.2.1 Yet another Pygments shim for LaTeX]
\RequirePackage{keyval}
\RequirePackage{kvoptions}
\RequirePackage{fancyvrb}
\RequirePackage{float}
\RequirePackage{ifthen}
\RequirePackage{calc}
-\RequirePackage{ifplatform}
-\RequirePackage{pdftexcmds}
-\RequirePackage{etoolbox}
-\RequirePackage{xstring}
-\RequirePackage{lineno}
-\RequirePackage{framed}
\IfFileExists{shellesc.sty}
{\RequirePackage{shellesc}
\@ifpackagelater{shellesc}{2016/04/29}
{}
{\protected\def\ShellEscape{\immediate\write18 }}}
{\protected\def\ShellEscape{\immediate\write18 }}
+\RequirePackage{ifplatform}
+\RequirePackage{pdftexcmds}
+\RequirePackage{etoolbox}
+\RequirePackage{xstring}
+\RequirePackage{lineno}
+\RequirePackage{framed}
\AtBeginDocument{%
\@ifpackageloaded{color}{}{%
\@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}}%
@@ -1217,34 +1217,42 @@
{\edef\minted@hash{\pdf@filemdfivesum{#1}%
\pdf@mdfivesum{\minted@cmd}}}%
\else
- \immediate\openout\minted@code\minted@jobname.mintedcmd\relax
- \immediate\write\minted@code{\minted@cmd}%
- \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
- {\immediate\write\minted@code{autogobble}}{}%
- \immediate\closeout\minted@code
- \edef\minted@argone@esc{#1}%
- \StrSubstitute{\minted@argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@argone@esc]%
- \StrSubstitute{\minted@argone@esc}{"}{\@backslashchar"}[\minted@argone@esc]%
- \edef\minted@tmpfname@esc{\minted@outputdir\minted@jobname}%
- \StrSubstitute{\minted@tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@tmpfname@esc]%
- \StrSubstitute{\minted@tmpfname@esc}{"}{\@backslashchar"}[\minted@tmpfname@esc]%
- %Cheating a little here by using ASCII codes to write `{` and `}`
- %in the Python code
- \def\minted@hashcmd{%
- \detokenize{python -c "import hashlib; import os;
- hasher = hashlib.sha1();
- f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedcmd\detokenize{\")), \"rb\");
- hasher.update(f.read());
- f.close();
- f = open(os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\")), \"rb\");
- hasher.update(f.read());
- f.close();
- f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedmd5\detokenize{\")), \"w\");
- macro = \"\\edef\\minted@hash\" + chr(123) + hasher.hexdigest() + chr(125) + \"\";
- f.write(\"\\makeatletter\" + macro + \"\\makeatother\\endinput\n\");
- f.close();"}}%
- \ShellEscape{\minted@hashcmd}%
- \minted@input{\minted@outputdir\minted@jobname.mintedmd5}%
+ \ifx\mdfivesum\minted@undefined
+ \immediate\openout\minted@code\minted@jobname.mintedcmd\relax
+ \immediate\write\minted@code{\minted@cmd}%
+ \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+ {\immediate\write\minted@code{autogobble}}{}%
+ \immediate\closeout\minted@code
+ \edef\minted@argone@esc{#1}%
+ \StrSubstitute{\minted@argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@argone@esc]%
+ \StrSubstitute{\minted@argone@esc}{"}{\@backslashchar"}[\minted@argone@esc]%
+ \edef\minted@tmpfname@esc{\minted@outputdir\minted@jobname}%
+ \StrSubstitute{\minted@tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@tmpfname@esc]%
+ \StrSubstitute{\minted@tmpfname@esc}{"}{\@backslashchar"}[\minted@tmpfname@esc]%
+ %Cheating a little here by using ASCII codes to write `{` and `}`
+ %in the Python code
+ \def\minted@hashcmd{%
+ \detokenize{python -c "import hashlib; import os;
+ hasher = hashlib.sha1();
+ f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedcmd\detokenize{\")), \"rb\");
+ hasher.update(f.read());
+ f.close();
+ f = open(os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\")), \"rb\");
+ hasher.update(f.read());
+ f.close();
+ f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.mintedmd5\detokenize{\")), \"w\");
+ macro = \"\\edef\\minted@hash\" + chr(123) + hasher.hexdigest() + chr(125) + \"\";
+ f.write(\"\\makeatletter\" + macro + \"\\makeatother\\endinput\n\");
+ f.close();"}}%
+ \ShellEscape{\minted@hashcmd}%
+ \minted@input{\minted@outputdir\minted@jobname.mintedmd5}%
+ \else
+ \ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
+ {\edef\minted@hash{\mdfivesum file {#1}%
+ \mdfivesum{\minted@cmd autogobble}}}%
+ {\edef\minted@hash{\mdfivesum file {#1}%
+ \mdfivesum{\minted@cmd}}}%
+ \fi
\fi
\edef\minted@infile{\minted@cachedir/\minted@hash.pygtex}%
\IfFileExists{\minted@infile}{}{%