summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/minted
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-11-01 20:14:54 +0000
committerKarl Berry <karl@freefriends.org>2016-11-01 20:14:54 +0000
commit2eb34cbc280474b94760588e88ed5a5dc7acaea0 (patch)
treee5794e908c82f0d9974c87bbeb77467010910489 /Master/texmf-dist/tex/latex/minted
parent14d2653fc014c2663e17017f23e79306e070a04c (diff)
minted (1nov16)
git-svn-id: svn://tug.org/texlive/trunk@42418 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/minted')
-rw-r--r--Master/texmf-dist/tex/latex/minted/minted.sty26
1 files changed, 18 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/minted/minted.sty b/Master/texmf-dist/tex/latex/minted/minted.sty
index 8fb66f0ad58..25b064a7b08 100644
--- a/Master/texmf-dist/tex/latex/minted/minted.sty
+++ b/Master/texmf-dist/tex/latex/minted/minted.sty
@@ -27,7 +27,7 @@
%% and the derived file minted.sty.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{minted}
- [2016/07/20 v2.4 Yet another Pygments shim for LaTeX]
+ [2016/10/31 v2.4.1 Yet another Pygments shim for LaTeX]
\RequirePackage{keyval}
\RequirePackage{kvoptions}
\RequirePackage{fvextra}
@@ -57,6 +57,7 @@
\StrSubstitute{\jobname}{ }{_}[\minted@jobname]
\StrSubstitute{\minted@jobname}{*}{_}[\minted@jobname]
\StrSubstitute{\minted@jobname}{"}{}[\minted@jobname]
+\StrSubstitute{\minted@jobname}{'}{_}[\minted@jobname]
\newcommand{\minted@cachedir}{\detokenize{_}minted-\minted@jobname}
\let\minted@cachedir@windows\minted@cachedir
\define@key{minted}{cachedir}{%
@@ -654,6 +655,7 @@
\minted@def@optfv{highlightcolor}
\minted@def@optfv@switch{curlyquotes}
\minted@def@optfv@switch{numberfirstline}
+\minted@def@optfv@switch{numberblanklines}
\minted@def@optfv@switch{stepnumberfromfirst}
\minted@def@optfv@switch{stepnumberoffsetvalues}
\minted@def@optfv@switch{showspaces}
@@ -766,7 +768,7 @@
\ifx\XeTeXinterchartoks\minted@undefined
\ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
{\edef\minted@hash{\pdf@filemdfivesum{#1}%
- \pdf@mdfivesum{\minted@cmd autogobble}}}%
+ \pdf@mdfivesum{\minted@cmd autogobble(\ifx\FancyVerbStartNum\z@ 0\else\FancyVerbStartNum\fi-\ifx\FancyVerbStopNum\z@ 0\else\FancyVerbStopNum\fi)}}}%
{\edef\minted@hash{\pdf@filemdfivesum{#1}%
\pdf@mdfivesum{\minted@cmd}}}%
\else
@@ -774,7 +776,7 @@
\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\write\minted@code{autogobble(\ifx\FancyVerbStartNum\z@ 0\else\FancyVerbStartNum\fi-\ifx\FancyVerbStopNum\z@ 0\else\FancyVerbStopNum\fi)}}{}%
\immediate\closeout\minted@code
\edef\minted@argone@esc{#1}%
\StrSubstitute{\minted@argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted@argone@esc]%
@@ -802,7 +804,7 @@
\else
\ifthenelse{\equal{\minted@get@opt{autogobble}{false}}{true}}%
{\edef\minted@hash{\mdfivesum file {#1}%
- \mdfivesum{\minted@cmd autogobble}}}%
+ \mdfivesum{\minted@cmd autogobble(\ifx\FancyVerbStartNum\z@ 0\else\FancyVerbStartNum\fi-\ifx\FancyVerbStopNum\z@ 0\else\FancyVerbStopNum\fi)}}}%
{\edef\minted@hash{\mdfivesum file {#1}%
\mdfivesum{\minted@cmd}}}%
\fi
@@ -822,10 +824,14 @@
import textwrap;
from io import open;
f = open(os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\")), \"r\", encoding=\"}\minted@encoding\detokenize{\");
- t = f.read();
+ t = f.readlines();
f.close();
f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.pyg\detokenize{\")), \"w\", encoding=\"}\minted@encoding\detokenize{\");
- f.write(textwrap.dedent(t));
+ fvstartnum = }\ifx\FancyVerbStartNum\z@ 0\else\FancyVerbStartNum\fi\detokenize{;
+ fvstopnum = }\ifx\FancyVerbStopNum\z@ 0\else\FancyVerbStopNum\fi\detokenize{;
+ s = fvstartnum-1 if fvstartnum != 0 else 0;
+ e = fvstopnum if fvstopnum != 0 else len(t);
+ [f.write(textwrap.dedent(\"\".join(x))) for x in (t[0:s], t[s:e], t[e:]) if x];
f.close();"}%
}%
\ShellEscape{\minted@autogobblecmd}}{}%
@@ -867,10 +873,14 @@
import textwrap;
from io import open;
f = open(os.path.expanduser(os.path.expandvars(\"}\minted@argone@esc\detokenize{\")), \"r\", encoding=\"}\minted@encoding\detokenize{\");
- t = f.read();
+ t = f.readlines();
f.close();
f = open(os.path.expanduser(os.path.expandvars(\"}\minted@tmpfname@esc.pyg\detokenize{\")), \"w\", encoding=\"}\minted@encoding\detokenize{\");
- f.write(textwrap.dedent(t));
+ fvstartnum = }\ifx\FancyVerbStartNum\z@ 0\else\FancyVerbStartNum\fi\detokenize{;
+ fvstopnum = }\ifx\FancyVerbStopNum\z@ 0\else\FancyVerbStopNum\fi\detokenize{;
+ s = fvstartnum-1 if fvstartnum != 0 else 0;
+ e = fvstopnum if fvstopnum != 0 else len(t);
+ [f.write(textwrap.dedent(\"\".join(x))) for x in (t[0:s], t[s:e], t[e:]) if x];
f.close();"}%
}%
\ShellEscape{\minted@autogobblecmd}}{}%