% \iffalse meta-comment % % Copyright (C) 2013-2021 by Geoffrey M. Poore % Copyright (C) 2010-2011 by Konrad Rudolph % --------------------------------------------------------------------------- % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % 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 3-Clause % ("New") BSD license: http://opensource.org/licenses/BSD-3-Clause. % % This work has the LPPL maintenance status `maintained'. % % The Current Maintainer of this work is Geoffrey M. Poore. % % This work consists of the files minted.dtx and minted.ins % and the derived file minted.sty. % % % \fi % % \iffalse %<*driver> \ProvidesFile{minted.dtx} % %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{minted} %<*package> [2021/12/24 v2.6 Yet another Pygments shim for LaTeX] % %<*driver> \documentclass{ltxdoc} \EnableCrossrefs \CodelineIndex %\DisableCrossrefs %\RecordChanges %\OnlyDescription \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{dingbat} \usepackage{microtype} \usepackage[svgnames]{xcolor} \usepackage{textcomp} \usepackage[cache, langlinenos]{minted} \usepackage{environ} \usepackage{graphicx} \usepackage{multicol} \usepackage{hyperref} \makeatletter % The typesetting for macrocode doesn't use \@noligs, which upquote modifies. % So apply the upquote fix to \verbatim@nolig@list as well, which is in macrocode. \begingroup \catcode`'=\active \catcode``=\active \g@addto@macro\verbatim@nolig@list{% \let'\textquotesingle \let`\textasciigrave \ifx\encodingdefault\upquote@OTone \ifx\ttdefault\upquote@cmtt \def'{\char13 }% \def`{\char18 }% \fi\fi} \endgroup % Create a short verbatim pipe that handles quotation marks properly \begingroup \catcode`\|=\active \gdef\pipe@active@verbatim{% \begingroup \let\do\@makeother\dospecials \catcode`\|=\active \catcode`\`=\active \catcode`\'=\active \catcode`\<=\active \catcode`\>=\active \catcode`\-=\active \catcode`\,=\active \catcode`\ =\active \pipe@active@verbatim@i} \gdef\pipe@active@verbatim@i#1|{% \endgroup \begingroup \def\FV@SV@pipe@active@verbatim{% \FV@Gobble \expandafter\FV@ProcessLine\expandafter{#1}}% %\let\FV@BeginVBox\relax %\let\FV@EndVBox\relax %\def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}% \BUseVerbatim{pipe@active@verbatim}% \endgroup} \AtBeginDocument{\let|\pipe@active@verbatim} \endgroup \newcommand{\changestext}{} \NewEnviron{changelog}[2]{% \g@addto@macro\changestext{\item[#1] (#2) \begin{itemize}}% \expandafter\g@addto@macro\expandafter\changestext\expandafter{\BODY}% \g@addto@macro\changestext{\end{itemize}}% } \newcommand{\PrintChangelog}{% \section*{Version History}% \addcontentsline{toc}{section}{Version History} \label{sec:version-history} \begin{description}% \changestext \end{description}% } \def\MacroFont{% \fontencoding\encodingdefault% \fontfamily\ttdefault% \fontseries\mddefault% \fontshape\updefault% \small} \definecolor{minted@mint}{HTML}{0B610B} \definecolor{minted@samplebg}{HTML}{F0F0E0} \colorlet{minted@linkcolor}{minted@mint} % \def\PrintDescribeMacro#1{\strut \MacroFont\textcolor{minted@linkcolor}{\string #1\ }} \let\PrintDescribeEnv\PrintDescribeMacro \let\PrintMacroName\PrintDescribeMacro \let\PrintEnvName\PrintDescribeEnv \def\theCodelineNo{\textcolor{minted@linkcolor}{\sffamily\footnotesize\oldstylenums{\arabic{CodelineNo}}}} % \hypersetup{ pdftitle=The minted package: Highlighted source code in LaTeX, pdfauthor=Geoffrey M. Poore, pdfsubject={Minted LaTeX package manual}, colorlinks=true, allcolors=minted@linkcolor, } % % Shamelessly stolen from http://blog.karssen.org/2009/11/15/a-latex-example-environment/ \newenvironment{example} {\VerbatimEnvironment \begin{VerbatimOut}[gobble=3]{example.out}} {\end{VerbatimOut}% \vspace{1ex}% \setlength{\parindent}{0pt}% \fbox{\begin{minipage}{0.5\linewidth}% \inputminted[resetmargins]{latex}{example.out}% \end{minipage}% \hspace{0.05\linewidth}% \begin{minipage}{0.45\linewidth-2\fboxsep}% \input{example.out}% \end{minipage}% \vspace{1ex}}} \newenvironment{longexample} {\VerbatimEnvironment \begin{VerbatimOut}[gobble=3]{example.out}} {\end{VerbatimOut}% \vspace{1ex}% \setlength{\parindent}{0pt}% \fbox{\begin{minipage}{\linewidth-2\fboxsep}% \inputminted[resetmargins]{latex}{example.out}% ~\hrulefill~ \input{example.out}% \end{minipage}% \vspace{1ex}}} \def\minted@printopt#1(#2) (#3){% \vspace{0.1in}% \leavevmode% \marginpar{\raggedleft\texttt{\textcolor{minted@linkcolor}{\small #1}}\ }% \kern-\parindent\textsf{(#2)}\hfill(default: \texttt{#3})\\} \newenvironment{optionlist}% {% ~\par\vspace{-14pt}% \def\pipechar{|} \let\|\pipechar \newcommand*\mintednext{}% \renewcommand*\item[1][]{% \mintednext% \renewcommand*\mintednext{\par}% \minted@printopt##1% \ignorespaces}} {% \par} \edef\hashchar{\string#} \makeatother \newcommand{\hide}[1]{} \setlength{\parindent}{0pt} \addtolength{\parskip}{0.5\baselineskip} \begin{document} \DocInput{minted.dtx} \PrintIndex \end{document} % % \fi % % \CheckSum{2593} % % \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 % Lower-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 % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % % % % \begin{changelog}{v2.6}{2021/12/24} % \item \texttt{autogobble} automatically uses \texttt{python} or \texttt{python3} executables, depending on availability, instead of requiring \texttt{python}. A custom executable can be specified by redefining \texttt{\string\MintedPython} (\#277, \#287). % \item Fixed \texttt{autogobble} compatibility with \texttt{fancyvrb} 4.0+ (\#315, \#316). % \item Pygments style names may now contain arbitrary non-whitespace characters. Previously, style names containing digits and some punctuation characters were incompatible (\#210, \#294, \#299, \#317). Pygments macros are now only defined just before use locally within \texttt{minted} commands and environments, rather than globally. Pygments macros now always use a \texttt{\string\PYG} prefix regardless of style, rather than a prefix of the form \texttt{\string\PYG