texlive[44855] Master/texmf-dist: minted (20jul17)

commits+karl at tug.org commits+karl at tug.org
Thu Jul 20 23:22:54 CEST 2017


Revision: 44855
          http://tug.org/svn/texlive?view=revision&revision=44855
Author:   karl
Date:     2017-07-20 23:22:54 +0200 (Thu, 20 Jul 2017)
Log Message:
-----------
minted (20jul17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/minted/README
    trunk/Master/texmf-dist/doc/latex/minted/minted.pdf
    trunk/Master/texmf-dist/source/latex/minted/minted.dtx
    trunk/Master/texmf-dist/source/latex/minted/minted.ins
    trunk/Master/texmf-dist/tex/latex/minted/minted.sty
    trunk/Master/texmf-dist/tex/latex/minted/minted1.sty

Modified: trunk/Master/texmf-dist/doc/latex/minted/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/minted/README	2017-07-20 21:22:36 UTC (rev 44854)
+++ trunk/Master/texmf-dist/doc/latex/minted/README	2017-07-20 21:22:54 UTC (rev 44855)
@@ -1,16 +1,16 @@
 minted - highlighted source code for LaTeX
 
 minted is a package that facilitates expressive syntax highlighting in LaTeX
-using the Pygments library.  The package also provides options to customize 
-the highlighted source code output using fancyvrb.
+using the Pygments library.  The package also provides options to customize
+the highlighted source code output using fancyvrb and fvextra.
 
-See the documentation (minted.pdf) for examples and instructions for 
+See the documentation (minted.pdf) for examples and instructions for
 installation and usage.
 
-This work may be distributed and/or modified under the conditions of the 
-LaTeX Project Public License (LPPL), version 1.3 or later.  Additionally, 
+This work may be distributed and/or modified under the conditions of the
+LaTeX Project Public License (LPPL), version 1.3 or later.  Additionally,
 the project may be distributed under the terms of the 3-Clause ("New") BSD
 license.
 
-For suggestions, feature requests, and bug reports, please use the project's 
+For suggestions, feature requests, and bug reports, please use the project's
 GitHub site:  https://github.com/gpoore/minted.

Modified: trunk/Master/texmf-dist/doc/latex/minted/minted.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/minted/minted.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/minted/minted.dtx	2017-07-20 21:22:36 UTC (rev 44854)
+++ trunk/Master/texmf-dist/source/latex/minted/minted.dtx	2017-07-20 21:22:54 UTC (rev 44855)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2013-2016 by Geoffrey M. Poore <gpoore at gmail.com>
+% Copyright (C) 2013-2017 by Geoffrey M. Poore <gpoore at gmail.com>
 % Copyright (C) 2010-2011 by Konrad Rudolph <konrad_rudolph at madrat.net>
 % ---------------------------------------------------------------------------
 % This work may be distributed and/or modified under the
@@ -31,7 +31,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{minted}
 %<*package>
-    [2016/10/31 v2.4.1 Yet another Pygments shim for LaTeX]
+    [2017/07/19 v2.5 Yet another Pygments shim for LaTeX]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -163,7 +163,7 @@
 \def\minted at printopt#1(#2) (#3){%
   \vspace{0.1in}%
   \leavevmode%
-  \marginpar{\raggedleft\texttt{\textcolor{minted at linkcolor}{#1}}\ }%
+  \marginpar{\raggedleft\texttt{\textcolor{minted at linkcolor}{\small #1}}\ }%
   \kern-\parindent\textsf{(#2)}\hfill(default: \texttt{#3})\\}
 
 \newenvironment{optionlist}%
@@ -195,7 +195,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{2614}
+% \CheckSum{2604}
 %
 % \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
@@ -216,6 +216,19 @@
 %
 %
 %
+% \begin{changelog}{v2.5}{2017/07/19}
+% \item The default placement for the \texttt{listing} float is now \texttt{tbp} instead of \texttt{h}, to parallel \texttt{figure} and \texttt{table} and also avoid warnings caused by \texttt{h} (\#165).  The documentation now contains information about changing default placement.  The \texttt{float} package is no longer loaded when the \texttt{newfloat} package option is used.
+% \item Added support for \texttt{*nchars} options from \texttt{fvextra} v1.3 that allow setting \texttt{breaklines}-related indentation in terms of a number of characters, rather than as a fixed dimension.
+% \item Fixed incompatibility with \texttt{babel magyar} (\#158).
+% \item Added support for \texttt{beamer} overlays with \texttt{beameroverlays} option (\#155).
+% \item Comments in the Pygments \LaTeX\ style files no longer appear as literal text when \texttt{minted} is used in \texttt{.dtx} files (\#161).
+% \item \texttt{autogobble} now works with package option \texttt{kpsewhich} (\#151).  Under Windows, the \texttt{kpsewhich} option no longer requires PowerShell.
+% \item Fixed a bug that prevented \texttt{finalizecache} from working with \texttt{outputdir} (\#149).
+% \item Fixed a bug with \texttt{firstline} and \texttt{lastline} that prevented them from working with the \texttt{minted} environment (\#145).
+% \item Added note on \texttt{breqn} conflicts to FAQ (\#163).
+% \end{changelog}
+%
+%
 % \begin{changelog}{v2.4.1}{2016/10/31}
 % \item Single quotation marks in \texttt{\string\jobname} are now replaced with underscores in \texttt{\string\minted at jobname} to prevent quoting errors (\#137).
 % \item The \texttt{autogobble} option now takes \texttt{firstline} and \texttt{lastline} into account (\#130).
@@ -697,8 +710,7 @@
 % \section{Floating listings}\label{sec:float}
 %
 % \DescribeEnv{listing}
-% \pkg{minted} provides the |listing| environment to wrap around a source code block.  This puts the code into a floating box.  You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is,
-% as for the |table| and |figure| environments):
+% \pkg{minted} provides the |listing| environment to wrap around a source code block.  This puts the code into a floating box, with the default placement |tbp| like figures and tables.  You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is, as for the |figure| and |table| environments):
 % \begin{VerbatimOut}[gobble=1]{minted.doc.out}
 %   \begin{listing}[H]
 %     \mint{cl}/(car (cons 1 '(2)))/
@@ -718,6 +730,18 @@
 % \end{minipage}}
 % \hfill\hfill
 %
+% The default |listing| placement can be modified easily.  When the package option |newfloat=false| (default), the \pkg{float} package is used to create the |listing| environment.  Placement can be modified by redefining |\fps at listing|.  For example,
+%\begin{verbatim}
+%\makeatletter
+%\renewcommand{\fps at listing}{htp}
+%\makeatother
+%\end{verbatim}
+% When |newfloat=true|, the more powerful \pkg{newfloat} package is used to create the |listing| environment.  In that case, \pkg{newfloat} commands are available to customize |listing|:
+%\begin{verbatim}
+%\SetupFloatingEnvironment{listing}{placement=htp}
+%\end{verbatim}
+%
+%
 % \DescribeMacro{\listoflistings}
 % The |\listoflistings| macro will insert a list of all (floated) listings in the document:
 %
@@ -825,9 +849,7 @@
 %
 % This option does \emph{not} make \pkg{minted} work with the |-output-directory| and |-aux-directory| command-line options for \LaTeX.  For those, see the |outputdir| package option.
 %
-% Under Windows, this option currently requires that PowerShell be installed.  It may need to be installed in versions of Windows prior to Windows 7.
 %
-%
 % \DescribeMacro{langlinenos=\meta{boolean} (default:~false)}
 % \pkg{minted} uses the \pkg{fancyvrb} package behind the scenes for the code typesetting.  \pkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified.  For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off.  The |langlinenos| option makes |firstnumber| work for each language individually with all |minted| and |\mint| usages.  For example, consider the code and output below.
 %
@@ -959,6 +981,11 @@
 %   \item[baselinestretch (dimension) (\meta{document default})]
 %     Value to use as for baselinestretch inside the listing.
 %
+%
+% \item[beameroverlays (boolean) (false)]
+% Give the |<| and |>| characters their normal text meanings when used with |escapeinside| and |texcomments|, so that \pkg{beamer} overlays of the form |\only<1>{...}| will work.
+%
+%
 %   \item[breakafter (string) (\meta{none})]
 %     Break lines after specified characters, not just at spaces, when \texttt{breaklines=true}.  Does not apply to |\mintinline|.
 %
@@ -1032,9 +1059,14 @@
 %   \item[breakbytokenanywhere (boolean) (false)] 
 %   Like \texttt{breakbytoken}, but also allows line breaks between immediately adjacent tokens, not just between tokens that are separated by spaces.  Using \texttt{breakbytokenanywhere} with \texttt{breakanywhere} is redundant.
 %
-%   \item[breakindent (dimension) (0pt)]
-%     When a line is broken, indent the continuation lines by this amount.  When \texttt{breakautoindent} and \texttt{breakindent} are used together, the indentations add.  This  indentation is combined with \texttt{breaksymbolindentleft} to give the total actual left indentation.  Does not apply to \texttt{\string\mintinline}.
+% \item[breakindent (dimension) (\meta{breakindentnchars})]
+% When a line is broken, indent the continuation lines by this amount.  When |breakautoindent| and |breakindent| are used together, the indentations add.  This  indentation is combined with |breaksymbolindentleft| to give the total actual left indentation.
 %
+% Does not apply to \texttt{\string\mintinline}.
+%
+% \item[breakindentnchars (integer) (0)]
+% This allows |breakindent| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
+%
 %   \item[breaklines (boolean) (false)] 
 %     Automatically break long lines in \texttt{minted} environments and \texttt{\string\mint} commands, and wrap longer lines in \texttt{\string\mintinline}.
 %
@@ -1091,33 +1123,50 @@
 %   \item[breaksymbolright (string) (\meta{none})]
 %     The symbol used at breaks (right) when \texttt{breaklines=true}. Does not appear at the end of the very last segment of a broken line.
 %
-%   \item[breaksymbolindent (dimension) (breaksymbolindentleft)]
-%     Alias for \texttt{breaksymbolindentleft}.
 %
-%   \item[breaksymbolindentleft (dimension) (\meta{width of 4 characters in default teletype font})]
-%     The extra left indentation that is provided to make room for \texttt{breaksymbolleft}.  This indentation is only applied when there is a \texttt{breaksymbolleft}.
+% \item[breaksymbolindent (dimension) (\meta{breaksymbolindentleftnchars})]
+% Alias for |breaksymbolindentleft|.
 %
-%     This may be set to the width of a specific number of (fixed-width) characters by using an approach such as 
-%\begin{Verbatim}
-%\newdimen\temporarydimen
-%\settowidth{\temporarydimen}{\ttfamily aaaa}
-%\end{Verbatim}
-% and then using \texttt{breaksymbolindentleft=\string\temporarydimen}.
+% \item[breaksymbolindentnchars (integer) (\meta{breaksymbolindentleftnchars})]
+% Alias for |breaksymbolindentleftnchars|.
 %
+%
+% \item[breaksymbolindentleft (dimension) (\meta{breaksymbolindentleftnchars})]
+% The extra left indentation that is provided to make room for |breaksymbolleft|.  This indentation is only applied when there is a |breaksymbolleft|.
+%
 %     Does not apply to \texttt{\string\mintinline}.
 %
-%   \item[breaksymbolindentright (dimension) (\meta{width of 4 characters in default teletype font})]
-%     The extra right indentation that is provided to make room for \texttt{breaksymbolright}.  This indentation is only applied when there is a \texttt{breaksymbolright}.
+% \item[breaksymbolindentleftnchars (integer) (4)]
+% This allows |breaksymbolindentleft| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
-%   \item[breaksymbolsep (dimension) (breaksymbolsepleft)]
-%     Alias for \texttt{breaksymbolsepleft}
+% \item[breaksymbolindentright (dimension) (\meta{breaksymbolindentrightnchars})]
+% The extra right indentation that is provided to make room for |breaksymbolright|.  This indentation is only applied when there is a |breaksymbolright|.
 %
-%   \item[breaksymbolsepleft (dimension) (1em)]
-%     The separation between the \texttt{breaksymbolleft} and the adjacent code.  Does not apply to \texttt{\string\mintinline}.
+% \item[breaksymbolindentrightnchars (integer) (4)]
+% This allows |breaksymbolindentright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
 %
-%   \item[breaksymbolsepright (dimension) (1em)]
-%     The separation between the \texttt{breaksymbolright} and the adjacent code.
 %
+% \item[breaksymbolsep (dimension) (\meta{breaksymbolsepleftnchars})]
+% Alias for |breaksymbolsepleft|.
+%
+% \item[breaksymbolsepnchars (integer) (\meta{breaksymbolsepleftnchars})]
+% Alias for |breaksymbolsepleftnchars|.
+%
+%
+% \item[breaksymbolsepleft (dimension) (\meta{breaksymbolsepleftnchars})]
+% The separation between the |breaksymbolleft| and the adjacent text. 
+%
+% \item[breaksymbolsepleftnchars (integer) (2)]
+% Allows |breaksymbolsepleft| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
+%
+%
+% \item[breaksymbolsepright (dimension) (\meta{breaksymbolseprightnchars})]
+% The \emph{minimum} separation between the |breaksymbolright| and the adjacent text.  This is the separation between |breaksymbolright| and the furthest extent to which adjacent text could reach.  In practice, |\linewidth| will typically not be an exact integer multiple of the character width (assuming a fixed-width font), so the actual separation between the |breaksymbolright| and adjacent text will generally be larger than |breaksymbolsepright|.  This ensures that break symbols have the same spacing from the margins on both left and right.  If the same spacing from text is desired instead, |breaksymbolsepright| may be adjusted.  (See the definition of |\FV at makeLineNumber| in \pkg{fvextra} for implementation details.)
+%
+% \item[breaksymbolseprightnchars (integer) (2)]
+% Allows |breaksymbolsepright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
+%
+%
 %   \item[bgcolor (string) (\meta{none})]
 %     Background color of the listing.  Be aware that this option has several limitations (described below); see ``Framing alternatives'' below for more powerful alternatives.
 %
@@ -1431,8 +1480,10 @@
 % In some cases, \pkg{minted} may not give the desired result due to other document settings that it cannot control.  Common issues are described below, with workarounds or solutions.  You may also wish to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \pkg{minted} in a non-typical context.
 %
 % \begin{itemize}
+% \item \textbf{There are intermittent ``I can't write on file'' errors.}  This can be caused by using \pkg{minted} in a directory that is synchronized with Dropbox or a similar file syncing program.  These programs can try to sync \pkg{minted}'s temporary files while it still needs to be able to modify them.  The solution is to turn off file syncing or use a directory that is not synced.
 % \item \textbf{I receive a ``Font Warning:  Some font shapes were not available'' message, or bold or italic seem to be missing.}  This due to a limitation in the font that is currently in use for typesetting code.  In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored.  In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font.  See The \LaTeX\ Font Catalogue's section on \href{http://www.tug.dk/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives.  If you like the default \LaTeX\ fonts, the \pkg{lmodern} package is a good place to start.  The \pkg{beramono} and \pkg{courier} packages may also be good options.
 % \item \textbf{I receive a ``Too many open files'' error under OS X when using caching.}  See the note on OS X under Section~\ref{sec:basic:preliminary}.
+% \item \textbf{TeXShop can't find \texttt{pygmentize}.}  You may need to create a symlink.  See \url{https://tex.stackexchange.com/questions/279214}.
 % \item \textbf{Weird things happen when I use the \pkg{fancybox} package.}  \pkg{fancybox} conflicts with \pkg{fancyvrb}, which \pkg{minted} uses internally.  When using \pkg{fancybox}, make sure that it is loaded before \pkg{minted} (or before \pkg{fancyvrb}, if \pkg{fancyvrb} is not loaded by \pkg{minted}).
 % \item \textbf{When I use \pkg{minted} with KOMA-Script document classes, I get warnings about \texttt{\string\float at addtolists}.}  \pkg{minted} uses the \pkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats.  Load the package \pkg{scrhack} to resolve the conflict.  Or use \pkg{minted}'s |newfloat| package option.
 % \item \textbf{Tilde characters \texttt{\string~} are raised, almost like superscripts.}
@@ -1440,6 +1491,12 @@
 %
 % \item \textbf{I'm getting errors with math, something like \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}.}  This is due to ligatures being disabled within verbatim content.  See the note under |escapeinside|.
 %
+% \item \textbf{With \texttt{mathescape} and the \pkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.}  Some math packages like \pkg{breqn} give certain characters like the comma special meanings in math mode.  These can conflict with \pkg{minted}.  In the \pkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
+%\begin{verbatim}
+%\AtBeginEnvironment{minted}{\catcode`\,=12\mathcode`\,="613B}
+%\end{verbatim}
+%Other packages/special characters may need their own modifications.
+%
 % \item \textbf{I'm getting errors with Beamer.}  Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \pkg{minted} commands and environments.  |fragile=singleslide| works best, but it disables overlays.  |fragile| works by saving the contents of each frame to a temp file and then reusing them.  This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment).  To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
 %
 % \item \textbf{Tabs are eaten by Beamer.}  This is due to \href{https://bitbucket.org/rivanvx/beamer/issue/310/tab-characters-in-listings-lost-when-using}{a bug in Beamer's treatment of verbatim content}.  Upgrade Beamer or use the linked patch.  Otherwise, try |fragile=singleslide| if you don't need overlays, or consider using \cmd\inputminted\ or converting the tabs into spaces.
@@ -1530,7 +1587,6 @@
 \RequirePackage{keyval}
 \RequirePackage{kvoptions}
 \RequirePackage{fvextra}
-\RequirePackage{float}
 \RequirePackage{ifthen}
 \RequirePackage{calc}
 \IfFileExists{shellesc.sty}
@@ -1675,7 +1731,7 @@
 %
 %    \begin{macrocode}
 \ProcessKeyvalOptions*
-\ifthenelse{\boolean{minted at newfloat}}{\RequirePackage{newfloat}}{}
+\ifthenelse{\boolean{minted at newfloat}}{\RequirePackage{newfloat}}{\RequirePackage{float}}
 \ifcsname tikzifexternalizing\endcsname 
   \tikzifexternalizing{\minted at drafttrue\minted at cachefalse}{}
 \else
@@ -1712,12 +1768,10 @@
    {\PackageError{minted}{Missing Pygments output; \string\inputminted\space 
      was^^Jprobably given a file that does not exist--otherwise, you may need 
      ^^Jthe outputdir package option, or may be using an incompatible build
-     tool\ifwindows,^^Jor may be using the kpsewhich option without having
-     PowerShell installed\fi,^^Jor may be using frozencache with a missing file}%
+     tool,^^Jor may be using frozencache with a missing file}%
     {This could be caused by using -output-directory or -aux-directory
      ^^Jwithout setting minted's outputdir, or by using a build tool that
-     ^^Jchanges paths in ways minted cannot detect\ifwindows, or by using the
-     ^^Jkpsewhich option without PowerShell\fi,
+     ^^Jchanges paths in ways minted cannot detect,
      ^^Jor using frozencache with a missing file.}}%
 }
 %    \end{macrocode}
@@ -2346,7 +2400,7 @@
 % \begin{macro}{\minted at checkstyle}
 % Make sure that style macros exist.
 %
-% We have to do some tricks with |\endlinechar| to prevent |\input| from inserting unwanted whitespace.  That is primarily for inline commands, where it would introduce a line break.  There is also the very unorthodox |\let\def\gdef| to make sure that macros are defined globally.  The catcodes for |-| and |_| must be changed during macro definition to accomodate style names like |paraiso-light|, |paraiso-dark|, and |algol_nu|.
+% We have to do some tricks with |\endlinechar| to prevent |\input| from inserting unwanted whitespace.  That is primarily for inline commands, where it would introduce a line break.  There is also the very unorthodox |\let\def\gdef| to make sure that macros are defined globally.  The catcodes for |-| and |_| must be changed during macro definition to accomodate style names like |paraiso-light|, |paraiso-dark|, and |algol_nu|.  The catcode for |%| must be changed to the default value in case \pkg{minted} is being used in a |.dtx| file; otherwise, \LaTeX\ comments in the Pygments style files will appear as literal text.
 %
 % If a style is not given, then revert to the |default| style, but create macros with prefix |PYG|, and create |default-pyg-prefix.pygstyle| if caching is on.  This allows a graceful fallback in the event that style is empty.  It is also purposefully used to create a complete set of macros with prefix |PYG|, so that the symbol macros may be used, as described next.
 %
@@ -2386,8 +2440,10 @@
         }%
         \begingroup
         \let\def\gdef
+        \catcode\string``=12
         \catcode`\_=11
         \catcode`\-=11
+        \catcode`\%=14
         \endlinechar=-1\relax
         \minted at input{%
           \minted at outputdir\minted at cachedir/\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}%
@@ -2405,8 +2461,10 @@
         \fi
         \begingroup
         \let\def\gdef
+        \catcode\string``=12
         \catcode`\_=11
         \catcode`\-=11
+        \catcode`\%=14
         \endlinechar=-1\relax
         \minted at input{\minted at outputdir\minted at jobname.out.pyg}%
         \endgroup}%
@@ -2542,7 +2600,7 @@
 \minted at def@opt{style}
 %    \end{macrocode}
 %
-% \pkg{fancyvrb} options.
+% \pkg{fancyvrb} and \pkg{fvextra} options.
 %    \begin{macrocode}
 \minted at def@optfv{frame}
 \minted at def@optfv{framesep}
@@ -2573,6 +2631,7 @@
 \minted at def@optfv{tab}
 \minted at def@optfv{tabcolor}
 \minted at def@optfv{highlightcolor}
+\minted at def@optfv at switch{beameroverlays}
 \minted at def@optfv at switch{curlyquotes}
 \minted at def@optfv at switch{numberfirstline}
 \minted at def@optfv at switch{numberblanklines}
@@ -2587,16 +2646,23 @@
 \minted at def@optfv at switch{breakbytoken}
 \minted at def@optfv at switch{breakbytokenanywhere}
 \minted at def@optfv{breakindent}
+\minted at def@optfv{breakindentnchars}
 \minted at def@optfv at switch{breakautoindent}
 \minted at def@optfv{breaksymbol}
 \minted at def@optfv{breaksymbolsep}
+\minted at def@optfv{breaksymbolsepnchars}
 \minted at def@optfv{breaksymbolindent}
+\minted at def@optfv{breaksymbolindentnchars}
 \minted at def@optfv{breaksymbolleft}
 \minted at def@optfv{breaksymbolsepleft}
+\minted at def@optfv{breaksymbolsepleftnchars}
 \minted at def@optfv{breaksymbolindentleft}
+\minted at def@optfv{breaksymbolindentleftnchars}
 \minted at def@optfv{breaksymbolright}
 \minted at def@optfv{breaksymbolsepright}
+\minted at def@optfv{breaksymbolseprightnchars}
 \minted at def@optfv{breaksymbolindentright}
+\minted at def@optfv{breaksymbolindentrightnchars}
 \minted at def@optfv{breakbefore}
 \minted at def@optfv{breakbeforesymbolpre}
 \minted at def@optfv{breakbeforesymbolpost}
@@ -2765,7 +2831,11 @@
       \csname minted at optlistcl@lang\minted at lang @i\endcsname}}%
     {\let\minted at optlistcl@inlines\@empty}%
   \def\minted at cmd{%
-    \ifminted at kpsewhich\ifwindows powershell\space\fi\fi
+    \ifminted at kpsewhich
+      \ifwindows
+        \detokenize{for /f "usebackq tokens=*"}\space\@percentchar\detokenize{a in (`kpsewhich}\space\minted at codefile\detokenize{`) do}\space
+      \fi
+    \fi
     \MintedPygmentize\space -l #2
     -f latex -P commandprefix=PYG -F tokenmerge
     \minted at optlistcl@g \csname minted at optlistcl@lang\minted at lang\endcsname
@@ -2773,7 +2843,7 @@
     \minted at optlistcl@cmd -o \minted at outputdir\minted at infile\space
     \ifminted at kpsewhich
       \ifwindows
-        \detokenize{$}(kpsewhich \minted at codefile)%
+        \@percentchar\detokenize{a}%
       \else
         \detokenize{`}kpsewhich \minted at codefile\space 
           \detokenize{||} \minted at codefile\detokenize{`}%
@@ -2835,29 +2905,7 @@
         \edef\minted at infile{\minted at cachedir/\minted at hash.pygtex}%
         \IfFileExists{\minted at infile}{}{%
           \ifthenelse{\equal{\minted at get@opt{autogobble}{false}}{true}}{%
-            \edef\minted at argone@esc{#1}%
-            \StrSubstitute{\minted at argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at argone@esc]%
-            \StrSubstitute{\minted at argone@esc}{"}{\@backslashchar"}[\minted at argone@esc]%
-            \edef\minted at tmpfname@esc{\minted at outputdir\minted at jobname}%
-            \StrSubstitute{\minted at tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at tmpfname@esc]%
-            \StrSubstitute{\minted at tmpfname@esc}{"}{\@backslashchar"}[\minted at tmpfname@esc]%
-            %Need a version of open() that supports encoding under Python 2
-            \edef\minted at autogobblecmd{%
-              \detokenize{python -c "import sys; import os;
-              import textwrap;
-              from io import open;
-              f = open(os.path.expanduser(os.path.expandvars(\"}\minted at argone@esc\detokenize{\")), \"r\", encoding=\"}\minted at encoding\detokenize{\");
-              t = f.readlines();
-              f.close();
-              f = open(os.path.expanduser(os.path.expandvars(\"}\minted at tmpfname@esc.pyg\detokenize{\")), \"w\", encoding=\"}\minted at encoding\detokenize{\");
-              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 at autogobblecmd}}{}%
+            \minted at autogobble{#1}}{}%
           \ShellEscape{\minted at cmd}}%
       \fi
       \ifthenelse{\boolean{minted at finalizecache}}%
@@ -2867,9 +2915,9 @@
           \ifwindows
             \StrSubstitute{\minted at infile}{/}{\@backslashchar}[\minted at infile@windows]
             \StrSubstitute{\minted at actualinfile}{/}{\@backslashchar}[\minted at actualinfile@windows]
-            \ShellEscape{move /y \minted at infile@windows\space\minted at actualinfile@windows}%
+            \ShellEscape{move /y \minted at outputdir\minted at infile@windows\space\minted at outputdir\minted at actualinfile@windows}%
           \else
-            \ShellEscape{mv -f \minted at infile\space\minted at actualinfile}%
+            \ShellEscape{mv -f \minted at outputdir\minted at infile\space\minted at outputdir\minted at actualinfile}%
           \fi
           \let\minted at infile\minted at actualinfile
           \expandafter\minted at addcachefile\expandafter{\minted at cachefilename}%
@@ -2884,29 +2932,7 @@
       \minted at inputpyg}%
     {%
       \ifthenelse{\equal{\minted at get@opt{autogobble}{false}}{true}}{%
-        \edef\minted at argone@esc{#1}%
-        \StrSubstitute{\minted at argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at argone@esc]%
-        \StrSubstitute{\minted at argone@esc}{"}{\@backslashchar"}[\minted at argone@esc]%
-        \edef\minted at tmpfname@esc{\minted at outputdir\minted at jobname}%
-        \StrSubstitute{\minted at tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at tmpfname@esc]%
-        \StrSubstitute{\minted at tmpfname@esc}{"}{\@backslashchar"}[\minted at tmpfname@esc]%
-        %Need a version of open() that supports encoding under Python 2
-        \edef\minted at autogobblecmd{%
-          \detokenize{python -c "import sys; import os;
-          import textwrap;
-          from io import open;
-          f = open(os.path.expanduser(os.path.expandvars(\"}\minted at argone@esc\detokenize{\")), \"r\", encoding=\"}\minted at encoding\detokenize{\");
-          t = f.readlines();
-          f.close();
-          f = open(os.path.expanduser(os.path.expandvars(\"}\minted at tmpfname@esc.pyg\detokenize{\")), \"w\", encoding=\"}\minted at encoding\detokenize{\");
-          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 at autogobblecmd}}{}%
+        \minted at autogobble{#1}}{}%
       \ShellEscape{\minted at cmd}%
       \minted at inputpyg}%
 }
@@ -2913,6 +2939,59 @@
 %    \end{macrocode}
 % \end{macro}
 %
+%
+% \begin{macro}{\minted at autogobble}
+% Remove common leading whitespace.
+%    \begin{macrocode}
+\def\minted at autogobble#1{%
+  \edef\minted at argone@esc{#1}%
+  \StrSubstitute{\minted at argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at argone@esc]%
+  \StrSubstitute{\minted at argone@esc}{"}{\@backslashchar"}[\minted at argone@esc]%
+  \edef\minted at tmpfname@esc{\minted at outputdir\minted at jobname}%
+  \StrSubstitute{\minted at tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at tmpfname@esc]%
+  \StrSubstitute{\minted at tmpfname@esc}{"}{\@backslashchar"}[\minted at tmpfname@esc]%
+  %Need a version of open() that supports encoding under Python 2
+  \edef\minted at autogobblecmd{%
+    \ifminted at kpsewhich
+      \ifwindows
+        \detokenize{for /f "usebackq tokens=*" }\@percentchar\detokenize{a in (`kpsewhich} #1\detokenize{`) do}\space
+      \fi
+    \fi
+    \detokenize{python -c "import sys; import os;
+    import textwrap;
+    from io import open;
+    fname = }%
+      \ifminted at kpsewhich
+        \detokenize{sys.argv[1];}\space%
+      \else
+        \detokenize{os.path.expanduser(os.path.expandvars(\"}\minted at argone@esc\detokenize{\"));}\space%
+      \fi
+    \detokenize{f = open(fname, \"r\", encoding=\"}\minted at encoding\detokenize{\") if os.path.isfile(fname) else None;
+    t = f.readlines() if f is not None else None;
+    t_opt = t if t is not None else [];
+    f.close() if f is not None else None;
+    tmpfname = os.path.expanduser(os.path.expandvars(\"}\minted at tmpfname@esc.pyg\detokenize{\"));
+    f = open(tmpfname, \"w\", encoding=\"}\minted at encoding\detokenize{\") if t is not None else None;
+    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_opt);
+    [f.write(textwrap.dedent(\"\".join(x))) for x in (t_opt[0:s], t_opt[s:e], t_opt[e:]) if x and t is not None];
+    f.close() if t is not None else os.remove(tmpfname);"}%
+    \ifminted at kpsewhich
+      \ifwindows
+        \space\@percentchar\detokenize{a}%
+      \else
+        \space\detokenize{`}kpsewhich #1\space\detokenize{||} #1\detokenize{`}%
+      \fi
+    \fi
+  }%
+  \ShellEscape{\minted at autogobblecmd}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \begin{macro}{\minted at inputpyg}
 % For increased clarity, the actual |\input| process is separated out into its own macro.
 %
@@ -3198,7 +3277,7 @@
       \minted at configlang{#2}%
       \setkeys{minted at opt@cmd}{#1}%
       \minted at fvset
-      \begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\minted at jobname.pyg}}%
+      \begin{VerbatimOut}[codes={\catcode`\^^I=12},firstline,lastline]{\minted at jobname.pyg}}%
     {\end{VerbatimOut}%
         \minted at langlinenoson
         \minted at pygmentize{\minted at lang}%
@@ -3342,13 +3421,13 @@
 %    \begin{macrocode}
 \ifthenelse{\boolean{minted at newfloat}}%
  {\@ifundefined{minted at float@within}%
-    {\DeclareFloatingEnvironment[fileext=lol,placement=h]{listing}}%
+    {\DeclareFloatingEnvironment[fileext=lol,placement=tbp]{listing}}%
     {\def\minted at tmp#1{%
-       \DeclareFloatingEnvironment[fileext=lol,placement=h, within=#1]{listing}}%
+       \DeclareFloatingEnvironment[fileext=lol,placement=tbp, within=#1]{listing}}%
      \expandafter\minted at tmp\expandafter{\minted at float@within}}}%
  {\@ifundefined{minted at float@within}%
-    {\newfloat{listing}{h}{lol}}%
-    {\newfloat{listing}{h}{lol}[\minted at float@within]}}
+    {\newfloat{listing}{tbp}{lol}}%
+    {\newfloat{listing}{tbp}{lol}[\minted at float@within]}}
 %    \end{macrocode}
 % \end{environment}
 %

Modified: trunk/Master/texmf-dist/source/latex/minted/minted.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/minted/minted.ins	2017-07-20 21:22:36 UTC (rev 44854)
+++ trunk/Master/texmf-dist/source/latex/minted/minted.ins	2017-07-20 21:22:54 UTC (rev 44855)
@@ -3,7 +3,7 @@
 \askforoverwritefalse
 
 \preamble
-Copyright 2013--2016 Geoffrey M. Poore
+Copyright 2013--2017 Geoffrey M. Poore
 Copyright 2010--2011 Konrad Rudolph
 
 This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/tex/latex/minted/minted.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/minted/minted.sty	2017-07-20 21:22:36 UTC (rev 44854)
+++ trunk/Master/texmf-dist/tex/latex/minted/minted.sty	2017-07-20 21:22:54 UTC (rev 44855)
@@ -5,7 +5,7 @@
 %% The original source files were:
 %%
 %% minted.dtx  (with options: `package')
-%% Copyright 2013--2016 Geoffrey M. Poore
+%% Copyright 2013--2017 Geoffrey M. Poore
 %% Copyright 2010--2011 Konrad Rudolph
 %% 
 %% This work may be distributed and/or modified under the
@@ -27,11 +27,10 @@
 %% and the derived file minted.sty.
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{minted}
-    [2016/10/31 v2.4.1 Yet another Pygments shim for LaTeX]
+    [2017/07/19 v2.5 Yet another Pygments shim for LaTeX]
 \RequirePackage{keyval}
 \RequirePackage{kvoptions}
 \RequirePackage{fvextra}
-\RequirePackage{float}
 \RequirePackage{ifthen}
 \RequirePackage{calc}
 \IfFileExists{shellesc.sty}
@@ -76,7 +75,7 @@
 \DeclareBoolOption{draft}
 \DeclareComplementaryOption{final}{draft}
 \ProcessKeyvalOptions*
-\ifthenelse{\boolean{minted at newfloat}}{\RequirePackage{newfloat}}{}
+\ifthenelse{\boolean{minted at newfloat}}{\RequirePackage{newfloat}}{\RequirePackage{float}}
 \ifcsname tikzifexternalizing\endcsname
   \tikzifexternalizing{\minted at drafttrue\minted at cachefalse}{}
 \else
@@ -104,12 +103,10 @@
    {\PackageError{minted}{Missing Pygments output; \string\inputminted\space
      was^^Jprobably given a file that does not exist--otherwise, you may need
      ^^Jthe outputdir package option, or may be using an incompatible build
-     tool\ifwindows,^^Jor may be using the kpsewhich option without having
-     PowerShell installed\fi,^^Jor may be using frozencache with a missing file}%
+     tool,^^Jor may be using frozencache with a missing file}%
     {This could be caused by using -output-directory or -aux-directory
      ^^Jwithout setting minted's outputdir, or by using a build tool that
-     ^^Jchanges paths in ways minted cannot detect\ifwindows, or by using the
-     ^^Jkpsewhich option without PowerShell\fi,
+     ^^Jchanges paths in ways minted cannot detect,
      ^^Jor using frozencache with a missing file.}}%
 }
 \newcommand{\minted at infile}{\minted at jobname.out.pyg}
@@ -513,8 +510,10 @@
         }%
         \begingroup
         \let\def\gdef
+        \catcode\string``=12
         \catcode`\_=11
         \catcode`\-=11
+        \catcode`\%=14
         \endlinechar=-1\relax
         \minted at input{%
           \minted at outputdir\minted at cachedir/\ifstrempty{#1}{default-pyg-prefix}{#1}.pygstyle}%
@@ -532,8 +531,10 @@
         \fi
         \begingroup
         \let\def\gdef
+        \catcode\string``=12
         \catcode`\_=11
         \catcode`\-=11
+        \catcode`\%=14
         \endlinechar=-1\relax
         \minted at input{\minted at outputdir\minted at jobname.out.pyg}%
         \endgroup}%
@@ -653,6 +654,7 @@
 \minted at def@optfv{tab}
 \minted at def@optfv{tabcolor}
 \minted at def@optfv{highlightcolor}
+\minted at def@optfv at switch{beameroverlays}
 \minted at def@optfv at switch{curlyquotes}
 \minted at def@optfv at switch{numberfirstline}
 \minted at def@optfv at switch{numberblanklines}
@@ -667,16 +669,23 @@
 \minted at def@optfv at switch{breakbytoken}
 \minted at def@optfv at switch{breakbytokenanywhere}
 \minted at def@optfv{breakindent}
+\minted at def@optfv{breakindentnchars}
 \minted at def@optfv at switch{breakautoindent}
 \minted at def@optfv{breaksymbol}
 \minted at def@optfv{breaksymbolsep}
+\minted at def@optfv{breaksymbolsepnchars}
 \minted at def@optfv{breaksymbolindent}
+\minted at def@optfv{breaksymbolindentnchars}
 \minted at def@optfv{breaksymbolleft}
 \minted at def@optfv{breaksymbolsepleft}
+\minted at def@optfv{breaksymbolsepleftnchars}
 \minted at def@optfv{breaksymbolindentleft}
+\minted at def@optfv{breaksymbolindentleftnchars}
 \minted at def@optfv{breaksymbolright}
 \minted at def@optfv{breaksymbolsepright}
+\minted at def@optfv{breaksymbolseprightnchars}
 \minted at def@optfv{breaksymbolindentright}
+\minted at def@optfv{breaksymbolindentrightnchars}
 \minted at def@optfv{breakbefore}
 \minted at def@optfv{breakbeforesymbolpre}
 \minted at def@optfv{breakbeforesymbolpost}
@@ -742,7 +751,11 @@
       \csname minted at optlistcl@lang\minted at lang @i\endcsname}}%
     {\let\minted at optlistcl@inlines\@empty}%
   \def\minted at cmd{%
-    \ifminted at kpsewhich\ifwindows powershell\space\fi\fi
+    \ifminted at kpsewhich
+      \ifwindows
+        \detokenize{for /f "usebackq tokens=*"}\space\@percentchar\detokenize{a in (`kpsewhich}\space\minted at codefile\detokenize{`) do}\space
+      \fi
+    \fi
     \MintedPygmentize\space -l #2
     -f latex -P commandprefix=PYG -F tokenmerge
     \minted at optlistcl@g \csname minted at optlistcl@lang\minted at lang\endcsname
@@ -750,7 +763,7 @@
     \minted at optlistcl@cmd -o \minted at outputdir\minted at infile\space
     \ifminted at kpsewhich
       \ifwindows
-        \detokenize{$}(kpsewhich \minted at codefile)%
+        \@percentchar\detokenize{a}%
       \else
         \detokenize{`}kpsewhich \minted at codefile\space
           \detokenize{||} \minted at codefile\detokenize{`}%
@@ -812,29 +825,7 @@
         \edef\minted at infile{\minted at cachedir/\minted at hash.pygtex}%
         \IfFileExists{\minted at infile}{}{%
           \ifthenelse{\equal{\minted at get@opt{autogobble}{false}}{true}}{%
-            \edef\minted at argone@esc{#1}%
-            \StrSubstitute{\minted at argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at argone@esc]%
-            \StrSubstitute{\minted at argone@esc}{"}{\@backslashchar"}[\minted at argone@esc]%
-            \edef\minted at tmpfname@esc{\minted at outputdir\minted at jobname}%
-            \StrSubstitute{\minted at tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at tmpfname@esc]%
-            \StrSubstitute{\minted at tmpfname@esc}{"}{\@backslashchar"}[\minted at tmpfname@esc]%
-            %Need a version of open() that supports encoding under Python 2
-            \edef\minted at autogobblecmd{%
-              \detokenize{python -c "import sys; import os;
-              import textwrap;
-              from io import open;
-              f = open(os.path.expanduser(os.path.expandvars(\"}\minted at argone@esc\detokenize{\")), \"r\", encoding=\"}\minted at encoding\detokenize{\");
-              t = f.readlines();
-              f.close();
-              f = open(os.path.expanduser(os.path.expandvars(\"}\minted at tmpfname@esc.pyg\detokenize{\")), \"w\", encoding=\"}\minted at encoding\detokenize{\");
-              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 at autogobblecmd}}{}%
+            \minted at autogobble{#1}}{}%
           \ShellEscape{\minted at cmd}}%
       \fi
       \ifthenelse{\boolean{minted at finalizecache}}%
@@ -844,9 +835,9 @@
           \ifwindows
             \StrSubstitute{\minted at infile}{/}{\@backslashchar}[\minted at infile@windows]
             \StrSubstitute{\minted at actualinfile}{/}{\@backslashchar}[\minted at actualinfile@windows]
-            \ShellEscape{move /y \minted at infile@windows\space\minted at actualinfile@windows}%
+            \ShellEscape{move /y \minted at outputdir\minted at infile@windows\space\minted at outputdir\minted at actualinfile@windows}%
           \else
-            \ShellEscape{mv -f \minted at infile\space\minted at actualinfile}%
+            \ShellEscape{mv -f \minted at outputdir\minted at infile\space\minted at outputdir\minted at actualinfile}%
           \fi
           \let\minted at infile\minted at actualinfile
           \expandafter\minted at addcachefile\expandafter{\minted at cachefilename}%
@@ -861,32 +852,55 @@
       \minted at inputpyg}%
     {%
       \ifthenelse{\equal{\minted at get@opt{autogobble}{false}}{true}}{%
-        \edef\minted at argone@esc{#1}%
-        \StrSubstitute{\minted at argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at argone@esc]%
-        \StrSubstitute{\minted at argone@esc}{"}{\@backslashchar"}[\minted at argone@esc]%
-        \edef\minted at tmpfname@esc{\minted at outputdir\minted at jobname}%
-        \StrSubstitute{\minted at tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at tmpfname@esc]%
-        \StrSubstitute{\minted at tmpfname@esc}{"}{\@backslashchar"}[\minted at tmpfname@esc]%
-        %Need a version of open() that supports encoding under Python 2
-        \edef\minted at autogobblecmd{%
-          \detokenize{python -c "import sys; import os;
-          import textwrap;
-          from io import open;
-          f = open(os.path.expanduser(os.path.expandvars(\"}\minted at argone@esc\detokenize{\")), \"r\", encoding=\"}\minted at encoding\detokenize{\");
-          t = f.readlines();
-          f.close();
-          f = open(os.path.expanduser(os.path.expandvars(\"}\minted at tmpfname@esc.pyg\detokenize{\")), \"w\", encoding=\"}\minted at encoding\detokenize{\");
-          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 at autogobblecmd}}{}%
+        \minted at autogobble{#1}}{}%
       \ShellEscape{\minted at cmd}%
       \minted at inputpyg}%
 }
+\def\minted at autogobble#1{%
+  \edef\minted at argone@esc{#1}%
+  \StrSubstitute{\minted at argone@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at argone@esc]%
+  \StrSubstitute{\minted at argone@esc}{"}{\@backslashchar"}[\minted at argone@esc]%
+  \edef\minted at tmpfname@esc{\minted at outputdir\minted at jobname}%
+  \StrSubstitute{\minted at tmpfname@esc}{\@backslashchar}{\@backslashchar\@backslashchar}[\minted at tmpfname@esc]%
+  \StrSubstitute{\minted at tmpfname@esc}{"}{\@backslashchar"}[\minted at tmpfname@esc]%
+  %Need a version of open() that supports encoding under Python 2
+  \edef\minted at autogobblecmd{%
+    \ifminted at kpsewhich
+      \ifwindows
+        \detokenize{for /f "usebackq tokens=*" }\@percentchar\detokenize{a in (`kpsewhich} #1\detokenize{`) do}\space
+      \fi
+    \fi
+    \detokenize{python -c "import sys; import os;
+    import textwrap;
+    from io import open;
+    fname = }%
+      \ifminted at kpsewhich
+        \detokenize{sys.argv[1];}\space%
+      \else
+        \detokenize{os.path.expanduser(os.path.expandvars(\"}\minted at argone@esc\detokenize{\"));}\space%
+      \fi
+    \detokenize{f = open(fname, \"r\", encoding=\"}\minted at encoding\detokenize{\") if os.path.isfile(fname) else None;
+    t = f.readlines() if f is not None else None;
+    t_opt = t if t is not None else [];
+    f.close() if f is not None else None;
+    tmpfname = os.path.expanduser(os.path.expandvars(\"}\minted at tmpfname@esc.pyg\detokenize{\"));
+    f = open(tmpfname, \"w\", encoding=\"}\minted at encoding\detokenize{\") if t is not None else None;
+    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_opt);
+    [f.write(textwrap.dedent(\"\".join(x))) for x in (t_opt[0:s], t_opt[s:e], t_opt[e:]) if x and t is not None];
+    f.close() if t is not None else os.remove(tmpfname);"}%
+    \ifminted at kpsewhich
+      \ifwindows
+        \space\@percentchar\detokenize{a}%
+      \else
+        \space\detokenize{`}kpsewhich #1\space\detokenize{||} #1\detokenize{`}%
+      \fi
+    \fi
+  }%
+  \ShellEscape{\minted at autogobblecmd}%
+}
 \newcommand{\minted at inputpyg}{%
   \expandafter\let\expandafter\minted at PYGstyle%
     \csname PYG\minted at get@opt{style}{default}\endcsname
@@ -1070,7 +1084,7 @@
       \minted at configlang{#2}%
       \setkeys{minted at opt@cmd}{#1}%
       \minted at fvset
-      \begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\minted at jobname.pyg}}%
+      \begin{VerbatimOut}[codes={\catcode`\^^I=12},firstline,lastline]{\minted at jobname.pyg}}%
     {\end{VerbatimOut}%
         \minted at langlinenoson
         \minted at pygmentize{\minted at lang}%
@@ -1128,13 +1142,13 @@
 }
 \ifthenelse{\boolean{minted at newfloat}}%
  {\@ifundefined{minted at float@within}%
-    {\DeclareFloatingEnvironment[fileext=lol,placement=h]{listing}}%
+    {\DeclareFloatingEnvironment[fileext=lol,placement=tbp]{listing}}%
     {\def\minted at tmp#1{%
-       \DeclareFloatingEnvironment[fileext=lol,placement=h, within=#1]{listing}}%
+       \DeclareFloatingEnvironment[fileext=lol,placement=tbp, within=#1]{listing}}%
      \expandafter\minted at tmp\expandafter{\minted at float@within}}}%
  {\@ifundefined{minted at float@within}%
-    {\newfloat{listing}{h}{lol}}%
-    {\newfloat{listing}{h}{lol}[\minted at float@within]}}
+    {\newfloat{listing}{tbp}{lol}}%
+    {\newfloat{listing}{tbp}{lol}[\minted at float@within]}}
 \ifminted at newfloat\else
 \newcommand{\listingscaption}{Listing}
 \floatname{listing}{\listingscaption}

Modified: trunk/Master/texmf-dist/tex/latex/minted/minted1.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/minted/minted1.sty	2017-07-20 21:22:36 UTC (rev 44854)
+++ trunk/Master/texmf-dist/tex/latex/minted/minted1.sty	2017-07-20 21:22:54 UTC (rev 44855)
@@ -5,7 +5,7 @@
 %% The original source files were:
 %%
 %% minted.dtx  (with options: `packageone')
-%% Copyright 2013--2016 Geoffrey M. Poore
+%% Copyright 2013--2017 Geoffrey M. Poore
 %% Copyright 2010--2011 Konrad Rudolph
 %% 
 %% This work may be distributed and/or modified under the



More information about the tex-live-commits mailing list