Hi List,

There is a bug in the minted package used in the ports because a
bad argument of which command.
Discussed here: http://code.google.com/p/minted/issues/detail?id=19&can=1
The bug is already fixed in more recent versions.

The error can be reproduced with following minimal working example
(requires: python, py-pygments and should be used with 'pdflatex
-enable-write18' ):
\documentclass{report}
\usepackage{minted}

\begin{document}

\begin{minted}{perl}
 echo "Hello List!!";
\end{minted}

\end{document}


Here is a proposal to patch or update minted package:

[patch]
--- /usr/local/share/texmf-dist/tex/latex/minted/minted.sty.ori    Fri Jul
20 06:15:26 2012
+++ /usr/local/share/texmf-dist/tex/latex/minted/minted.sty    Fri Jul 20
06:15:47 2012
@@ -57,7 +57,7 @@
     \DeleteFile{\jobname.aex}
 \immediate\typeout{file deleted}
   \else
-    \immediate\write18{which -s #1 && touch \jobname.aex}
+    \immediate\write18{which -a #1 && touch \jobname.aex}
     \IfFileExists{\jobname.aex}
      {\AppExiststrue
       \DeleteFile{\jobname.aex}}


[update]
--- /usr/local/share/texmf-dist/tex/latex/minted/minted.sty.ori    Mon Aug
6 15:21:45 2012
+++ /usr/local/share/texmf-dist/tex/latex/minted/minted.sty    Mon Aug  6
15:22:49 2012
@@ -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'.

-- 
Cumprimentos,
Luis

Reply via email to