summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/minted/minted.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-01-15 00:21:46 +0000
committerKarl Berry <karl@freefriends.org>2010-01-15 00:21:46 +0000
commit9a67e99a67abb5407d276cea4024eaa8c0ee23f9 (patch)
tree7699ac74c7e447a32082041d4e9e9b5a3d34110e /Master/texmf-dist/tex/latex/minted/minted.sty
parentc873315ca2aa88a1dbfb1e8114b2172d13f05e64 (diff)
minted 0.1.5 (14jan10)
git-svn-id: svn://tug.org/texlive/trunk@16717 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/minted/minted.sty')
-rw-r--r--Master/texmf-dist/tex/latex/minted/minted.sty55
1 files changed, 41 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/minted/minted.sty b/Master/texmf-dist/tex/latex/minted/minted.sty
index de3062e77da..7b53747c7d1 100644
--- a/Master/texmf-dist/tex/latex/minted/minted.sty
+++ b/Master/texmf-dist/tex/latex/minted/minted.sty
@@ -15,6 +15,9 @@
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
+%% Additionally, the project may be distributed under the terms of the new BSD
+%% license.
+%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Konrad Rudolph.
@@ -22,11 +25,13 @@
%% This work consists of the files mints.dtx and mints.ins
%% and the derived file mints.sty.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{minted}[2010/01/08 0.0.4 Yet another Pygments shim for LaTeX]
+\ProvidesPackage{minted}[2010/01/13 v0.1.5 Yet another Pygments shim for LaTeX]
\RequirePackage{keyval}
\RequirePackage{fancyvrb}
\RequirePackage{color}
-
+\RequirePackage{float}
+\RequirePackage{ifthen}
+\RequirePackage{calc}
\newcommand\minted@resetoptions{}
\newcommand\minted@defopt[1]{
\expandafter\def\expandafter\minted@resetoptions\expandafter{%
@@ -35,9 +40,11 @@
\newcommand\minted@opt[1]{
\expandafter\detokenize%
\expandafter\expandafter\expandafter{\csname minted@opt@#1\endcsname}}
-\newcommand\minted@define@opt[2]{
- \minted@defopt{#1}
- \define@key{minted@opt}{#1}{\@namedef{minted@opt@#1}{#2}}}
+\newcommand\minted@define@opt[3][]{
+ \minted@defopt{#2}
+ \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}{
@@ -58,34 +65,49 @@
\minted@define@switch{mathescape}{-P mathescape}
\minted@define@switch{linenos}{-P linenos}
\minted@define@opt{gobble}{-F gobble:n=#1}
+\minted@define@opt{bgcolor}{#1}
\minted@define@extra{frame}
\minted@define@extra{framesep}
\minted@define@extra{framerule}
\minted@define@extra{rulecolor}
\minted@define@extra{numbersep}
+\minted@define@extra{firstnumber}
\minted@define@extra{stepnumber}
\minted@define@extra{firstline}
\minted@define@extra{lastline}
\minted@define@extra{baselinestretch}
-\minted@define@extra{label}
\minted@define@extra{xleftmargin}
\minted@define@extra{xrightmargin}
+\minted@define@extra{fillcolor}
\minted@define@extra@switch{numberblanklines}
\minted@define@extra@switch{showspaces}
\minted@define@extra@switch{resetmargins}
\minted@define@extra@switch{samepage}
+\newsavebox{\minted@bgbox}
+\newenvironment{minted@colorbg}[1]{
+ \def\minted@bgcol{#1}
+ \noindent
+ \begin{lrbox}{\minted@bgbox}
+ \begin{minipage}{\linewidth-2\fboxsep}}
+ {\end{minipage}
+ \end{lrbox}%
+ \colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}}
\newwrite\minted@code
\newcommand\minted@savecode[1]{
\immediate\openout\minted@code\jobname.pyg
\immediate\write\minted@code{#1}
\immediate\closeout\minted@code}
\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{linenos}
- -P "verboptions=\minted@opt{extra}" -o \jobname.out.pyg #1}
- %\immediate\typeout{\minted@cmd} % For debugging.
+ \def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge
+ \minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape}
+ \minted@opt{linenos} -P "verboptions=\minted@opt{extra}"
+ -o \jobname.out.pyg #1}
\immediate\write18{\minted@cmd}
+ \ifthenelse{\equal{\minted@opt@bgcolor}{}}{}
+ {\begin{minted@colorbg}{\minted@opt@bgcolor}}
\input{\jobname.out.pyg}
+ \ifthenelse{\equal{\minted@opt@bgcolor}{}}{}
+ {\end{minted@colorbg}}
\immediate\write18{rm \jobname.out.pyg}}
\newcommand\minted@usedefaultstyle{\usemintedstyle{default}}
\newcommand\usemintedstyle[1]{
@@ -115,13 +137,18 @@
\minted@resetoptions
\setkeys{minted@opt}{#1}
\minted@pygmentize[#3]{#2}}
+\newfloat{listing}{h}{lol}
+\newcommand\listingscaption{Listing}
+\floatname{listing}{\listingscaption}
+\newcommand\listoflistingscaption{List of listings}
+\providecommand\listoflistings{\listof{listing}{\listoflistingscaption}}
\AtBeginDocument{
\minted@usedefaultstyle}
\AtEndOfPackage{
- \ifeof18\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}
+ \ifeof18\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}
\endinput
%%
%% End of file `minted.sty'.