diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-18 22:29:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-18 22:29:01 +0000 |
commit | 4c7c93512d5ad99119fc38035815ba54a17605a5 (patch) | |
tree | a99c0960c4f6e75b07c8045709370a737c33da6b /Master/texmf-dist/tex/latex/minted | |
parent | 649107c8ec87f4bc736e7089a0bf9aed9ba1e137 (diff) |
minuted 1.7 (17sep11)
git-svn-id: svn://tug.org/texlive/trunk@24002 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/minted')
-rw-r--r-- | Master/texmf-dist/tex/latex/minted/minted.sty | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/minted/minted.sty b/Master/texmf-dist/tex/latex/minted/minted.sty index a6f1dc830c0..0e0585cfdd2 100644 --- a/Master/texmf-dist/tex/latex/minted/minted.sty +++ b/Master/texmf-dist/tex/latex/minted/minted.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% minted.dtx (with options: `package') -%% Copyright 2010 Konrad Rudolph +%% Copyright 2010--2011 Konrad Rudolph %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -22,24 +22,27 @@ %% %% The Current Maintainer of this work is Konrad Rudolph. %% -%% This work consists of the files mints.dtx and mints.ins -%% and the derived file mints.sty. +%% This work consists of the files minted.dtx and minted.ins +%% and the derived file minted.sty. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{minted}[2010/01/27 v1.6 Yet another Pygments shim for LaTeX] +\ProvidesPackage{minted}[2011/09/17 v1.7 Yet another Pygments shim for LaTeX] \RequirePackage{keyval} \RequirePackage{fancyvrb} -\RequirePackage{color} +\RequirePackage{xcolor} \RequirePackage{float} \RequirePackage{ifthen} \RequirePackage{calc} \RequirePackage{ifplatform} +\DeclareOption{chapter}{\def\minted@float@within{chapter}} +\DeclareOption{section}{\def\minted@float@within{section}} +\ProcessOptions\relax \ifwindows \providecommand\DeleteFile[1]{\immediate\write18{del #1}} \else \providecommand\DeleteFile[1]{\immediate\write18{rm #1}} \fi \newboolean{AppExists} -\providecommand\TestAppExists[1]{ +\newcommand\TestAppExists[1]{ \ifwindows \DeleteFile{\jobname.aex} \immediate\write18{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd) @@ -57,7 +60,7 @@ \DeleteFile{\jobname.aex} \immediate\typeout{file deleted} \else - \immediate\write18{which -s #1 && touch \jobname.aex} + \immediate\write18{which #1 && touch \jobname.aex} \IfFileExists{\jobname.aex} {\AppExiststrue \DeleteFile{\jobname.aex}} @@ -76,11 +79,11 @@ \ifthenelse{\equal{#1}{}}{ \define@key{minted@opt}{#2}{\@namedef{minted@opt@#2}{#3}}} {\define@key{minted@opt}{#2}[#1]{\@namedef{minted@opt@#2}{#3}}}} -\newcommand\minted@define@switch[2]{ - \minted@defopt{#1} - \define@booleankey{minted@opt}{#1}{ - \@namedef{minted@opt@#1}{#2}} - {\@namedef{minted@opt@#1}{}}} +\newcommand\minted@define@switch[3][]{ + \minted@defopt{#2} + \define@booleankey{minted@opt}{#2} + {\@namedef{minted@opt@#2}{#3}} + {\@namedef{minted@opt@#2}{#1}}} \minted@defopt{extra} \newcommand\minted@define@extra[1]{ \define@key{minted@opt}{#1}{ @@ -95,6 +98,9 @@ \minted@define@switch{texcl}{-P texcomments} \minted@define@switch{mathescape}{-P mathescape} \minted@define@switch{linenos}{-P linenos} +\minted@define@switch{startinline}{-P startinline} +\minted@define@switch[-P funcnamehighlighting=False]% + {funcnamehighlighting}{-P funcnamehighlighting} \minted@define@opt{gobble}{-F gobble:n=#1} \minted@define@opt{bgcolor}{#1} \minted@define@extra{frame} @@ -116,6 +122,7 @@ \minted@define@extra{fontshape} \minted@define@extra{fontseries} \minted@define@extra{formatcom} +\minted@define@extra{label} \minted@define@extra@switch{numberblanklines} \minted@define@extra@switch{showspaces} \minted@define@extra@switch{resetmargins} @@ -139,9 +146,12 @@ \newcommand\minted@pygmentize[2][\jobname.pyg]{ \def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge \minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape} + \minted@opt{startinline} \minted@opt{funcnamehighlighting} \minted@opt{linenos} -P "verboptions=\minted@opt{extra}" -o \jobname.out.pyg #1} \immediate\write18{\minted@cmd} + % For debugging, uncomment: + %\immediate\typeout{\minted@cmd} \ifthenelse{\equal{\minted@opt@bgcolor}{}} {} {\begin{minted@colorbg}{\minted@opt@bgcolor}} @@ -170,7 +180,7 @@ \renewcommand{\minted@proglang}[1]{#2} \minted@resetoptions \setkeys{minted@opt}{#1} - \begin{VerbatimOut}{\jobname.pyg}}% + \begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\jobname.pyg}}% {\end{VerbatimOut} \minted@pygmentize{\minted@proglang{}} \DeleteFile{\jobname.pyg}} @@ -200,7 +210,9 @@ {\def\minted@shortname{#1}} \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{ \inputminted[#3,##1]{#2}{##2}}} -\newfloat{listing}{h}{lol} +\@ifundefined{minted@float@within} + {\newfloat{listing}{h}{lol}} + {\newfloat{listing}{h}{lol}[\minted@float@within]} \newcommand\listingscaption{Listing} \floatname{listing}{\listingscaption} \newcommand\listoflistingscaption{List of listings} @@ -208,12 +220,12 @@ \AtBeginDocument{ \minted@usedefaultstyle} \AtEndOfPackage{ - \ifeof18 + \ifnum\pdf@shellescape=1\relax\else \PackageError{minted} {You must invoke LaTeX with the -shell-escape flag} {Pass the -shell-escape flag to LaTeX. Refer to the minted.sty - documentation for more information.}\fi} + documentation for more information.}\fi \TestAppExists{pygmentize} \ifAppExists\else \PackageError{minted} @@ -221,7 +233,7 @@ to use this package} {Refer to the installation instructions in the minted documentation for more information.} - \fi + \fi} \endinput %% %% End of file `minted.sty'. |