summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pythontex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-07-21 21:18:20 +0000
committerKarl Berry <karl@freefriends.org>2016-07-21 21:18:20 +0000
commit24289a6c830263430a9ff06f2dd20d6ec3482079 (patch)
treede97f9224a4eae78a947c52df01eb7d1b63c37b0 /Master/texmf-dist/source/latex/pythontex
parent75ba721d706ce924641fd8f7715a83809b757812 (diff)
pythontex (21jul16)
git-svn-id: svn://tug.org/texlive/trunk@41746 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pythontex')
-rw-r--r--Master/texmf-dist/source/latex/pythontex/pythontex.dtx364
-rw-r--r--Master/texmf-dist/source/latex/pythontex/pythontex.ins8
2 files changed, 314 insertions, 58 deletions
diff --git a/Master/texmf-dist/source/latex/pythontex/pythontex.dtx b/Master/texmf-dist/source/latex/pythontex/pythontex.dtx
index 612de45fc0d..7ec0af93c78 100644
--- a/Master/texmf-dist/source/latex/pythontex/pythontex.dtx
+++ b/Master/texmf-dist/source/latex/pythontex/pythontex.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2012-2014 by Geoffrey M. Poore <gpoore@gmail.com>
+% Copyright (C) 2012-2016 by Geoffrey M. Poore <gpoore@gmail.com>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,7 +26,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{pythontex}
%<*package>
- [2014/07/17 Version~0.14 ]
+ [2016/07/21 v0.15 execute and typeset Python code and other languages]
%</package>
%
%<*driver>
@@ -39,9 +39,18 @@
\usepackage[svgnames]{xcolor}
\usepackage{environ}
\usepackage{enumitem}
+\usepackage{fvextra}
\usepackage{pythontex}
\usepackage{hyperref}
-\hypersetup{colorlinks=true,urlcolor=Green,linkcolor=blue}
+\hypersetup{
+ pdftitle=The PythonTeX package,
+ pdfauthor=Geoffrey M. Poore,
+ pdfsubject={PythonTeX LaTeX package manual},
+ colorlinks=true,
+ allcolors=ForestGreen,
+}
+\usepackage{cleveref}
+
\newcommand{\pytxtodo}[1]{}
%\newcommand{\pytxtodo}[1]{\textcolor{red}{TO~DO: \scantokens{#1}}}
\newcommand{\changestext}{}
@@ -55,19 +64,77 @@
\section*{Version History}%
\changestext
}
-\EnableCrossrefs
-\CodelineIndex
+
+% 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
+
+\def\MacroFont{%
+ \fontencoding\encodingdefault%
+ \fontfamily\ttdefault%
+ \fontseries\mddefault%
+ \fontshape\updefault%
+ \small}
+
+\def\PrintMacroName#1{{\strut\MacroFont\color{DarkGreen}\footnotesize\string #1\ }}
+
+\def\PrintDescribeMacro#1{\strut\MacroFont\textcolor{DarkGreen}{\string #1\ }}
+\let\PrintDescribeEnv\PrintDescribeMacro
+%\let\PrintMacroName\PrintDescribeMacro
+\let\PrintEnvName\PrintDescribeEnv
+
+\def\theCodelineNo{\textcolor{DarkGreen}{\sffamily\scriptsize{\arabic{CodelineNo}}}}
+
+\let\orig@footnote\footnote
+\renewcommand{\footnote}{%
+ \begingroup
+ \let\do\@makeother
+ \dospecials
+ \catcode`\{=1
+ \catcode`\}=2
+ \new@footnote}
+\newcommand{\new@footnote}[1]{%
+ \endgroup
+ \orig@footnote{\scantokens{#1}}}
+
+%\EnableCrossrefs
+%\CodelineIndex
%\RecordChanges
\makeatother
\begin{document}
\DocInput{pythontex.dtx}
%\PrintChanges
- \PrintIndex
+ %\PrintIndex
\end{document}
%</driver>
% \fi
%
-% \CheckSum{3018}
+% \CheckSum{3174}
%
% \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
@@ -86,6 +153,25 @@
% Right brace \} Tilde \~}
%
%
+% \begin{changelog}{v0.15}{2016/07/21}
+% \textbf{New features}
+% \begin{itemize}
+% \item The \texttt{fvextra} package is now required. This provides line breaking with fine-grained control over break locations, the ability to highlight specific lines or ranges of lines, improved handling of tabs, and several additional features.
+% \item Added \texttt{sub} commands and environments (\texttt{\string\pys}, \texttt{pysub}, ...). These commands and environments perform string interpolation on text. Fields delimited by \texttt{!\{...\}} are replaced by the result of evaluating and then printing their content. This works for all families of commands and environments, not just Python. See the documentation for details about field delimiters and escaping.
+% \item Added \texttt{rust} and \texttt{rs} families of commands and environments. These provide essentially complete support for Rust, except that \texttt{rstex.formatter()}, \texttt{rstex.before()}, and \texttt{rstex.after()} will likely need additional refinement (\#90).
+% \item Added the \texttt{sage} family of commands and environments, which provide support for Sage (\#63).
+% \item Added \texttt{bash} family of commands and environments. This provides basic support for bash (no utilities class or equivalent). Bash works with Windows if it is installed.
+% \item Improved \texttt{console} compatibility under Linux with Python 3 (\#70).
+% \item Counters for default sessions are now created automatically. This prevents counter errors under some circumstances when working with \texttt{\string\includeonly}.
+% \item Commands like \texttt{\string\py} can now output verbatim content under LuaTeX.
+% \end{itemize}
+% \textbf{Bugfixes}
+% \begin{itemize}
+% \item Fixed a bug that could cause an endless loop when a \texttt{code} command or environment printed a \texttt{code} command or environment of the same family with \texttt{autoprint=true}.
+% \end{itemize}
+% \end{changelog}
+%
+%
% \begin{changelog}{v0.14}{2014/07/17}
% \textbf{New features}
% \begin{itemize}
@@ -395,8 +481,9 @@
% \section{Citing \pytex}
% \label{sec:citing}
%
-% If you use \pytex\ in your writing and research, please consider citing it in any resulting publications. Currently, the best paper to cite is the one published in the 2013 SciPy proceedings. Several additional papers about \pytex\ are now under review or in preparation; this list will be edited when they are published.
+% If you use \pytex\ in your writing and research, please consider citing it in any resulting publications. The best and most recent paper is in \textit{Computational Science \& Discovery}.
% \begin{itemize}
+% \item ``PythonTeX: reproducible documents with LaTeX, Python, and more,'' Geoffrey M Poore. \textit{Computational Science \& Discovery} 8 (2015) 014010. Full text and Bib\TeX\ entry available at \url{http://stacks.iop.org/1749-4699/8/i=1/a=014010}.
% \item ``Reproducible Documents with PythonTeX,'' Geoffrey M.\ Poore. \textit{Proceedings of the 12th Python in Science Conference} (2013), pp.\ 73--79. Full text and Bib\TeX\ entry available at \url{http://conference.scipy.org/proceedings/scipy2013/poore.html}.
% \end{itemize}
%
@@ -406,9 +493,9 @@
%
% \subsection{Installing \pytex}
%
-% \pytex\ requires a \TeX\ installation. It has been tested with \href{http://www.tug.org/texlive/}{\TeX\ Live} and \href{http://miktex.org/}{MiK\TeX}, but should work with other distributions. The following \LaTeX\ packages, with their dependencies, are required: |fancyvrb|, |etex|, |etoolbox|, |xstring|, |pgfopts|, |newfloat| (part of the |caption| bundle), |currfile|, and |color| or |xcolor|. A current \TeX\ installation is recommended, since some features require recent versions of the packages. If you are creating and including graphics, you will also need |graphicx|. The \href{http://www.ctan.org/pkg/mdframed}{\texttt{mdframed}} package is recommended for enclosing typeset code in boxes with fancy borders and/or background colors; \href{http://www.ctan.org/pkg/tcolorbox}{\texttt{tcolorbox}} and \href{http://www.ctan.org/pkg/framed}{\texttt{framed}} are alternatives.
+% \pytex\ requires a \TeX\ installation. It has been tested with \href{http://www.tug.org/texlive/}{\TeX\ Live} and \href{http://miktex.org/}{MiK\TeX}, but should work with other distributions. The following \LaTeX\ packages, with their dependencies, are required: |fancyvrb|, |fvextra|, |etoolbox|, |xstring|, |pgfopts|, |newfloat| (part of the |caption| bundle), |currfile|, and |color| or |xcolor|. A current \TeX\ installation is recommended, since some features require recent versions of the packages. If you are creating and including graphics, you will also need |graphicx|. The \href{http://www.ctan.org/pkg/mdframed}{\texttt{mdframed}} package is recommended for enclosing typeset code in boxes with fancy borders and/or background colors; \href{http://www.ctan.org/pkg/tcolorbox}{\texttt{tcolorbox}} and \href{http://www.ctan.org/pkg/framed}{\texttt{framed}} are alternatives.
%
-% \pytex\ also requires a \href{http://www.python.org/}{Python} installation. Python 2.7 is recommended for the greatest compatibility with scientific tools, although many scientific packages are now compatible with Python 3. \pytex\ is compatible with Python 2.7 and 3.2+. The Python package \href{http://pygments.org/}{Pygments} must be installed for syntax highlighting to function. \pytex\ has been tested with Pygments 1.4 and later, but the latest version is recommended. For scientific work, or to compile |pythontex_gallery.tex|, the following are also recommended: \href{http://numpy.scipy.org/}{NumPy}, \href{http://www.scipy.org/}{SciPy}, \href{http://matplotlib.sourceforge.net/}{matplotlib}, and \href{http://sympy.org}{SymPy}.
+% \pytex\ also requires a \href{http://www.python.org/}{Python} installation. Python 2.7 is recommended for the greatest compatibility with scientific tools, although many scientific packages are now compatible with Python 3. \pytex\ is compatible with Python 2.7 and 3.2+. The Python package \href{http://pygments.org/}{Pygments} must be installed for syntax highlighting to function. \pytex\ has been tested with Pygments 1.4 and later, but the latest version is recommended. For scientific work, or to compile |pythontex_gallery.tex|, the following are also recommended: \href{http://numpy.scipy.org/}{NumPy}, \href{http://www.scipy.org/}{SciPy}, \href{http://matplotlib.sourceforge.net/}{matplotlib}, and \href{http://sympy.org}{SymPy}. When using \pytex\ with LyX, be aware that LyX may try to use its own version of Python; you may need to reconfigure LyX.
%
% \pytex\ also provides support for other languages such as Ruby, so you will need to install any additional languags you plan to use. Typically, the most recent major version of these languages is supported.
%
@@ -693,7 +780,7 @@
%
% \DescribeMacro{pygopt=\marg{pygments~options} default:\meta{none}}
%
-% This allows Pygments options to be set at the document level. The options must be enclosed in curly braces |{}|. Currently, three options may be passed in this manner: |style=|\meta{style~name}, which sets the formatting style; |texcomments|, which allows \LaTeX\ in code comments to be rendered; and |mathescape|, which allows \LaTeX\ math mode (|$...$|) in comments. The |texcomments| and |mathescape| options may be used with an argument (for example, |texcomments=True/False|); if an argument is not supplied, |True| is assumed. Example: |pygopt={style=colorful, texcomments=True, mathescape=False}|.
+% This allows Pygments options to be set at the document level. The options must be enclosed in curly braces |{}|. Currently, three options may be passed in this manner: |style=|\meta{style~name}, which sets the formatting style; |texcomments|, which allows \LaTeX\ in code comments to be rendered; and |mathescape|, which allows \LaTeX\ math mode (|$...$|) in comments. The |texcomments| and |mathescape| options may be used with an argument (for example, |texcomments=true/false|); if an argument is not supplied, |true| is assumed. Example: |pygopt={style=colorful, texcomments=true, mathescape=false}|.
%
% Pygments options for individual command and environment families may be set with the |\setpythontexpygopt| macro; for Pygments content, there is |\setpygmentspygopt|. These individual settings are always overridden by the package option.
%
@@ -751,12 +838,31 @@
%
% Assignment is \textbf{not} allowed using |\py|. For example, |\py{a=1}| is \textbf{not} valid. This is because assignment cannot be converted to a string.\footnote{It would be simple to allow any code within |\textbackslash py|, including assignment, by using a |try/except| statement. In this way, the functionality of |\textbackslash py| and |\textbackslash pyc| could be merged. While that would be simpler to use, it also has serious drawbacks. If |\textbackslash py| is not exclusively used to typeset string representations of \meta{code}, then it is no longer possible on the \LaTeX\ side to determine whether a command should return a string. Thus, it is harder to determine, from within a \TeX\ editor, whether |pythontex.py| needs to be run; warnings for missing Python content could not be issued, because the system wouldn't know (on the \LaTeX\ side) whether content was indeed missing.}
%
-% The text returned by Python must be valid \LaTeX\ code. Verbatim and other special content is allowed under the pdfTeX and XeTeX engines (a known bug prevents it from working with LuaTeX). The primary reasons for using |\py| rather than |print| are (1) |\py| is more compact and (2) |print| requires an external file to be created for every command or environment in which it is used, while |\py| and equivalents for other families share a single external file. Thus, use of |\py| minimizes the creation of external files, which is a key design goal for \pytex.\footnote{For |\textbackslash py|, the text returned by Python is stored in macros and thus must be valid \LaTeX\ code, because \LaTeX\ interprets the returned content. The use of macros for storing returned content means that an external file need not be created for each use of |\textbackslash py|. Rather, all macros created by |\textbackslash py| and equivalent commands from other families are stored in a single file that is inputted. Note that even though the content is stored in macros, verbatim content is allowed, through the use of special macro definitions combined with \texttt{\string\scantokens}.} The main reason for using |print| rather than |\py| is if you need to include a very large amount of material; |print|'s use of external files won't use up \TeX's memory, and may give noticeably better performance once the material is sufficiently long.
+% The text returned by Python must be valid \LaTeX\ code. Verbatim and other special content is allowed. The primary reasons for using |\py| rather than |print| are (1) |\py| is more compact and (2) |print| requires an external file to be created for every command or environment in which it is used, while |\py| and equivalents for other families share a single external file. Thus, use of |\py| minimizes the creation of external files, which is a key design goal for \pytex.\footnote{For |\textbackslash py|, the text returned by Python is stored in macros and thus must be valid \LaTeX\ code, because \LaTeX\ interprets the returned content. The use of macros for storing returned content means that an external file need not be created for each use of |\textbackslash py|. Rather, all macros created by |\textbackslash py| and equivalent commands from other families are stored in a single file that is inputted. Note that even though the content is stored in macros, verbatim content is allowed, through the use of special macro definitions combined with \texttt{\string\scantokens}.} The main reason for using |print| rather than |\py| is if you need to include a very large amount of material; |print|'s use of external files won't use up \TeX's memory, and may give noticeably better performance once the material is sufficiently long.
%
% \DescribeMacro{\pyc\oarg{session}\meta{opening~delim}\meta{code}\meta{closing~delim}}
%
% This command is used for executing but not typesetting \meta{code}. The suffix |c| is an abbreviation of |code|. If the |print| statement/function is used within \meta{code}, printed content will be included automatically so long as the package |autoprint| option is set to true (the default setting).
%
+% \DescribeMacro{\pys\oarg{session}\meta{opening~delim}\meta{code}\meta{closing~delim}}
+%
+% This command performs variable and expression substitution, or string interpolation, on \meta{code}. Fields of the form |!{|\meta{expr}|}| in \meta{code} are replaced with the evaluated and printed output of \meta{expr}. The suffix |s| is an abbreviation of |sub|, for ``substitute.'' This command is useful for inserting Python-generated content in contexts where the normal |\py| and |\pyc| would not function or would be inconvenient due to the restrictions imposed by \LaTeX. Since Python processes \meta{code} and performs substitutions before the result is passed to \LaTeX, substitution fields may be anywhere.
+%
+% Literal exclamation points |!| in \meta{code} only need to be escaped when they immediately precede an opening curly brace |{|, or when they precede exclamation points that precede a brace. Escaping is performed by doubling. Thus, |!!{| would indicate a literal exclamation point followed by a literal curly brace (|!{|), not the beginning of a substitution field. And |!!!{| would indicate a literal exclamation point (|!!|) followed by a substitution field (|!{...}|). Because curly braces |{}| only have the meaning of field delimiters when immediately following a non-escaped exclamation point, curly braces never need to be escaped.
+%
+% The rules for delimiting \meta{expr} depend on the number of curly braces used.
+% \begin{description}
+% \item[1 pair] If \meta{expr} is delimited by a single pair of braces, then \meta{expr} may contain curly braces so long as the braces only appear in matched pairs and are nested no more than 5 levels deep. This is essentially the same as standard \LaTeX\ tokenization rules except for the nesting limit.
+% \item[2--6 pairs] If \meta{expr} is delimited by 2--6 immediately adjacent curly braces (|!{{...}}| to |!{{{{{{...}}}}}}|), then \meta{expr} may contain any combination of braces, paired or unpaired, so long as the longest sequence of identical brace characters is shorter than the delimiters. Thus, |!{{...}}| can only contain single braces |{| and |}| (paired or unpaired); |!{{{...}}}| can contain |{|, |}|, |{{|, or |}}|; and so forth.
+% \end{description}
+% In both cases, anything more than five identical, immediately adjacent braces will always trigger an error. If a greater level of nesting is needed, then a function should be created within a |pycode| environment and afterward used to assemble the desired result.
+%
+% Curly braces used for delimiting \meta{expr} must not be immediately adjacent to braces that are part of \meta{expr}, because it would be impossible to distinguish them in the general case. If \meta{expr} begins/ends with a literal curly brace, the brace should be preceded/followed by a space or other whitespace character; leading and trailing whitespace in \meta{expr} is stripped, so this will not affect the output.
+%
+% Besides braces, \meta{expr} may contain any character except for literal newlines. In some cases, it may be appropriate to represent newlines in escaped form (|\n|). In other cases, it will be more appropriate to perform most calculations within a preceding |pycode| environment, and then access them via a variable or function call.
+%
+% Because \meta{expr} is evaluated and printed, it must be suitable for insertion in a |print()| function (or the equivalent, for languages besides Python). If string conversion as performed by |print()| is not desirable, then commands for explicit string conversion should be used.
+%
% \DescribeMacro{\pyv\oarg{session}\meta{opening~delim}\meta{code}\meta{closing~delim}}
%
% This command is used for typesetting but not executing \meta{code}. The suffix |v| is an abbreviation for |verb|.
@@ -773,6 +879,13 @@
% This environment encloses code that is executed but not typeset. The second optional argument \meta{fancyvrb~settings} is irrelevant since nothing is typeset, but it is accepted to maintain parallelism with the |verbatim| and |block| environments. If the |print| statement/function is used within the environment, printed content will be included automatically so long as the package |autoprint| option is set to true (the default setting).
%
%
+% \DescribeEnv{pysub~\oarg{session}\oarg{fancyvrb~settings}}
+%
+% This environment performs variable and expression substitution, or string interpolation, on the enclosed code. Fields of the form |!{|\meta{expr}|}| in \meta{code} are replaced with the evaluated and printed output of \meta{expr}. See the description of the |\pys| command for details about substitution field syntax.
+%
+%
+%
+%
% \DescribeEnv{pyverbatim~\oarg{session}\oarg{fancyvrb~settings}}
%
% This environment encloses code that is typeset but not executed.
@@ -1020,6 +1133,8 @@
%
% \DescribeMacro{\stdoutpythontex\oarg{mode}\oarg{options}}
%
+% ~\par
+%
% Unless the package option |autoprint| is true, printed content from |code| commands and environments will not be automatically included. Even when the |autoprint| option is turned on, |block| commands and environments do not automatically include printed content, since we will generally not want printed content immediately after typeset code. This macro brings in any printed content from the \textbf{last} command or environment. It is reset after each command/environment, so its scope for accessing particular printed content is very limited. It will return an error if no printed content exists.
%
% \meta{mode} determines how printed content is handled. It may be |raw| (interpreted as \LaTeX), |verb| (inline verbatim), or |verbatim|; |raw| is the default. Verbatim content is brought in via |fancyvrb|. \meta{options} consists of |fancyvrb| settings.
@@ -1033,6 +1148,8 @@
%
% \DescribeMacro{\usestdoutpythontex\oarg{verbatim~options}\oarg{fancyvrb~options}\marg{name}}
%
+% ~\par~\par
+%
% We may wish to be able to access the printed content from a command or environment at any point after the code that prints it, not just before any additional commands or environments are used. In that case, we may save access to the content under \meta{name}, and access it later via |\useprintpythontex|\marg{name}. \meta{mode} must be |raw|, |verb|, or |verbatim|. If content is brought in verbatim, then \meta{fancyvrb~options} are applied.
%
% \DescribeMacro{\stderrpythontex\oarg{mode}\oarg{fancyvrb~options}}
@@ -1052,6 +1169,7 @@
%
% \DescribeMacro{\usestderrpythontex\oarg{mode}\oarg{fancyvrb~options}\marg{name}}
%
+% ~\par
%
% Content written to |stderr| may be saved and accessed anywhere later in the document, just as |stdout| content may be. These commands should be used with care. Using Python-generated content at multiple locations within a document may often be appropriate. But an error message will usually be most meaningful in its context, next to the code that produced it.
%
@@ -1059,6 +1177,8 @@
%
% \DescribeMacro{\setpythontexautostdout\marg{boolean}}
%
+% ~\par
+%
% This allows autoprint behavior to be modified at various points within the document. The package-level |autoprint| option is also available for setting autoprint at the document level, but it is overridden by |\setpythontexautoprint|. \meta{boolean} should be |true| or |false|.
%
%
@@ -1433,6 +1553,21 @@
% When |\setpythontexcontext| is used, it must be accessed as struct fields, of the form |octavetex.context.<name>|.
%
%
+% \subsection{bash}
+%
+% Support for bash was added in v0.15. Support for bash is very basic. Bash commands may be executed, and their output (stdout and stderr) may be typeset. As with other languages, all commands are executed in a single session unless the user specifies otherwise. There is not a utilities class or any related features.
+%
+% Bash will work with Windows if it is installed.
+%
+%
+% \subsection{Rust}
+%
+% Support for Rust was added in v0.15, with the command/environment base names |rs| and |rust|. Complete support is provided, except that the utilities struct |rstex| does not have an |open()| method. Also |rstex.formatter()|, |rstex.before()|, and |rstex.after()| may need additional refinement in the future to make them more convenient to work with. All user code is inserted within a template-generated |main()| function; |main()| should not be defined explicitly. Future refinements of \pytex's template system may allow user code outside of |main()|.
+%
+% Because Rust typically gives a long sequence of errors, \pytex\ processing and synchronization of |stderr| is currently verbose and may need to be improved in the future as well. There is no support for encodings other than UTF-8. Currently, executables always use the |.exe| extension, even under non-Windows systems.
+%
+% When using |\rust| and |\rs|, keep in mind that these wrap code in |rstex.formatter()|. Because |rstex| is mutable, accessing its fields within |rstex.formatter()| will require |&rstex.|\meta{field}|.to_string()| or similar.
+%
%
% \subsection{Adding support for a new language}
%
@@ -1639,6 +1774,8 @@
%
% Thanks to Øystein Bjørndal for many suggestions and for help with OS X compatibility.
%
+% Thanks to Alexander Altman for suggesting Rust support and providing template code.
+%
%
% \PrintChangelog
%
@@ -1658,20 +1795,19 @@
% We store the name of the package in a macro for later use in warnings and error messages.
% \begin{macrocode}
\newcommand{\pytx@packagename}{PythonTeX}
-\newcommand{\pytx@packageversion}{0.14}
+\newcommand{\pytx@packageversion}{0.15}
% \end{macrocode}
%
% \subsection{Required packages}
-% A number of packages are required. |fancyvrb| is used to typeset all code that is not inline, and its internals are used to format inline code as well. |etex| provides extra registers, to avoid the (probably unlikely) possibility that the many counters required by \pytex\ will exhaust the supply. |etoolbox| is used for string comparison and boolean flags. |xstring| provides string manipulation. |pgfopts| is used to process package options, via the |pgfkeys| package. |newfloat| allows the creation of a floating environment for code listings. |currfile| is needed to allow errors and warnings to be synchronized with content brought in via |\input|, |\include|, etc. |xcolor| or |color| is needed for syntax highlighting with Pygments.
+% A number of packages are required. |fvextra|, which loads and extends |fancyvrb|, is used to typeset all code that is not inline. |fancyvrb| internals are used to format inline code. |etoolbox| is used for string comparison and boolean flags. |xstring| provides string manipulation. |pgfopts| is used to process package options, via the |pgfkeys| package. |newfloat| allows the creation of a floating environment for code listings. |currfile| is needed to allow errors and warnings to be synchronized with content brought in via |\input|, |\include|, etc. |xcolor| or |color| is needed for syntax highlighting with Pygments.
% \begin{macrocode}
-\RequirePackage{fancyvrb}
-\RequirePackage{etex}
+\RequirePackage{fvextra}
\RequirePackage{etoolbox}
\RequirePackage{xstring}
\RequirePackage{pgfopts}
\RequirePackage{newfloat}
-\RequirePackage{currfile}
-\AtBeginDocument{\@ifpackageloaded{color}{}{\RequirePackage{xcolor}}}
+\@ifpackageloaded{currfile}{}{\RequirePackage{currfile}}
+\AtEndPreamble{\@ifpackageloaded{color}{}{\RequirePackage{xcolor}}}
% \end{macrocode}
%
% \subsection{Package options}
@@ -1966,14 +2102,29 @@
%
% Currently, three options may be passed in this manner: |style=|\meta{style}, which sets the formatting style; |texcomments|, which allows \LaTeX\ in code comments to be rendered; and |mathescape|, which allows \LaTeX\ math mode (|$...$|) in comments. The |texcomments| and |mathescape| options may be used with a boolean argument; if an argument is not supplied, true is assumed. As an example of |pygopt| usage, consider the following:
% \begin{verbatim}
-% pygopt={style=colorful, texcomments=True, mathescape=False}
+% pygopt={style=colorful, texcomments=true, mathescape=false}
% \end{verbatim}
-% The usage of capitalized |True| and |False| is more pythonic, but is not strictly require.
%
-% While the package-level |pygments| option may be overridden by individual commands and environments (though it is not by default), the package-level Pygments options cannot be overridden by individual commands and environments.
+% While the package-level |pygments| option may be overridden by individual commands and environments (though it is not by default), the package-level Pygments options cannot be overridden by individual commands and environments. While we're defining storage for |pygopt|, go ahead and define parsing to extract |style| for later use under all cicumstances. This should be reorganized during the next refactoring.
% \begin{macrocode}
\def\pytx@pygopt{}
-\pgfkeys{/PYTX/pkgopt/pygopt/.code=\def\pytx@pygopt{#1}}
+\pgfkeys{/PYTX/pkgopt/pygopt/.code=\def\pytx@pygopt{#1}\pgfkeys{/PYTX/gopt/pygopt/.cd, #1}}
+\pgfkeys{/PYTX/gopt/pygopt/.is choice}
+\pgfkeys{/PYTX/gopt/pygopt/texcomments/.code=\relax}
+\pgfkeys{/PYTX/gopt/pygopt/mathescape/.code=\relax}
+\pgfkeys{/PYTX/gopt/pygopt/style/.code=\ifstrempty{#1}{}{\def\pytx@style{#1}}}
+\pgfkeys{/PYTX/lopt/pygopt/.is choice}
+\pgfkeys{/PYTX/lopt/pygopt/name/.code=\def\pytx@tmp@name{#1}}
+\pgfkeys{/PYTX/lopt/pygopt/texcomments/.code=\relax}
+\pgfkeys{/PYTX/lopt/pygopt/mathescape/.code=\relax}
+\pgfkeys{/PYTX/lopt/pygopt/style/.code=\ifstrempty{#1}{}{%
+ \expandafter\def\csname pytx@style@\pytx@tmp@name\endcsname{#1}}}
+\pgfkeys{/PYTX/popt/pygopt/.is choice}
+\pgfkeys{/PYTX/popt/pygopt/name/.code=\def\pytx@tmp@name{#1}}
+\pgfkeys{/PYTX/popt/pygopt/texcomments/.code=\relax}
+\pgfkeys{/PYTX/popt/pygopt/mathescape/.code=\relax}
+\pgfkeys{/PYTX/popt/pygopt/style/.code=\ifstrempty{#1}{}{%
+ \expandafter\def\csname pytx@style@PYG\pytx@tmp@name\endcsname{#1}}}
% \end{macrocode}
% \end{macro}
%
@@ -2092,8 +2243,6 @@
%
% This prevents the creation of unnecessary files, but it also has a significant drawback: only some content can be saved in a standard macro. In particular, verbatim content using |\verb| and |verbatim| will not work. So we need a way to save anything in a macro. The solution is to create a special macro that captures its argument verbatim. The argument is then tokenized when it is used via |\scantokens|. All of this requires a certain amount of catcode trickery.
%
-% While this approach works with the XeTeX and pdfTeX engines, it does not work with the LuaTeX engine, which has a known bug in its implementation of |\scantokens|.\footnote{\url{http://tracker.luatex.org/view.php?id=733}} So we provide a separate version for Lua\TeX\ that does not support verbatim. The space after the |#1| is intentional, so that the newline at the beginning of the macro definition is gobbled, and the macro content will start with text rather than leading whitespace. Two separate tests for LuaTeX are performed: comparison with an undefined macro |\pytx@undefined|, which will work under most circumstances, and comparison with |\relax|, which serves as a backup in case a test for LuaTeX by another package |\let|'s |\directlua| to |\relax| (for example, an |\expandafter\ifx\csname directlua\endcsname\relax| test).
-%
% \begin{macrocode}
\def\pytx@SVMCR#1{%
\edef\pytx@tmp{\csname #1\endcsname}%
@@ -2110,22 +2259,6 @@
!expandafter!scantokens!expandafter{#1!empty}}%
}%
!endgroup
-\ifx\directlua\pytx@undefined\else
-\def\pytx@SVMCR#1 {%
- \edef\pytx@tmp{\csname #1\endcsname}%
- \pytx@SVMCR@i}
-\long\def\pytx@SVMCR@i#1\endpytx@SVMCR{%
- \expandafter\gdef\pytx@tmp{#1}%
-}
-\fi
-\ifx\directlua\relax\else
-\def\pytx@SVMCR#1 {%
- \edef\pytx@tmp{\csname #1\endcsname}%
- \pytx@SVMCR@i}
-\long\def\pytx@SVMCR@i#1\endpytx@SVMCR{%
- \expandafter\gdef\pytx@tmp{#1}%
-}
-\fi
% \end{macrocode}\end{macro}
%
% \begin{macro}{pytx@Verbatim}
@@ -2271,12 +2404,20 @@
% \end{macrocode}
% \end{macro}
%
-% Now we can conditionally bring in the Pygments content. Note that we must use the |etoolbox| macro |\AfterEndPreamble|. This is because commands and environments are created using |\AtBeginDocument|, so that the user can change their properties in the preamble before they are created. And since the commands and environments must be created before we know the final state of |pytx@usedpygments|, we must bring in Pygments content after that.
+% Now we can conditionally bring in the Pygments content. Note that we must use the |etoolbox| macro |\AfterEndPreamble|. This is because commands and environments are created using |\AtBeginDocument|, so that the user can change their properties in the preamble before they are created. And since the commands and environments must be created before we know the final state of |pytx@usedpygments|, we must bring in Pygments content after that. We typically need to patch the Pygments single quote macro so that it cooperates with |upquote|.
% \begin{macrocode}
\AfterEndPreamble{%
- \ifbool{pytx@usedpygments}%
- {\InputIfFileExists{\pytx@outputdir/\pytx@jobname.pytxpyg}{}{}}{}%
+ \ifbool{pytx@usedpygments}%
+ {\InputIfFileExists{\pytx@outputdir/\pytx@jobname.pytxpyg}{}{}%
+ \ifcsname PYGZsq\endcsname
+ \ifdefstring{\PYGZsq}{\char`\'}{\pytx@patch@PYGZsq}{}%
+ \fi}%
+ {}%
}
+\begingroup
+\catcode`\'=\active
+\gdef\pytx@patch@PYGZsq{\gdef\PYGZsq{'}}
+\endgroup
% \end{macrocode}
%
% % While we are pulling in content, we also pull in the file of macros that stores some inline ``printed'' content, if the file exists. Since we need this file in general, and since it will not typically invole a noticeable speed penalty, we bring it in at the beginning of the document without any special conditions.
@@ -2405,6 +2546,7 @@
%
% \begin{macro}{\pytx@FVSet}
% Once the |fancyvrb| settings for \pytex\ are stored in macros, we need a way to actually invoke them. |\pytx@FVSet| applies family-specific settings first, then \pytex-wide settings second, so that \pytex-wide settings have precedence and will override family-specific settings. Note that by using |\fvset|, we are overwriting |fancyvrb|'s settings. Thus, to keep the settings local to the \pytex\ code, |\pytx@FVSet| must always be used within a |\begingroup ... \endgroup| block.
+%
% \begin{macrocode}
\def\pytx@FVSet{%
\expandafter\let\expandafter\pytx@fvsettings@@%
@@ -2456,6 +2598,27 @@
% \end{macro}\end{macro}
%
%
+%
+% \subsubsection{Enabling \texttt{fvextra} support for Pygments macros}
+%
+% \begin{macro}{\pytx@ConfigPygments}
+% The |fvextra| package provides Pygments support. We need a macro that can be used to turn this on at the appropriate points.
+% \begin{macrocode}
+\def\pytx@ConfigPygments{%
+ \def\pytx@currentstyle{default}%
+ \ifcsname pytx@style\endcsname
+ \let\pytx@currentstyle\pytx@style
+ \else
+ \ifcsname pytx@style@\pytx@type\endcsname
+ \expandafter\let\expandafter\pytx@currentstyle\csname pytx@style@\pytx@type\endcsname
+ \fi
+ \fi
+ \expandafter\let\expandafter\PYG@style\csname PYG\pytx@currentstyle\endcsname
+ \VerbatimPygments{\PYG}{\PYG@style}}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \subsubsection{Access to printed content (stdout)}
% The |autoprint| package option automatically pulls in printed content from |code| commands and environments. But this does not cover all possible use cases, because we could have print statements/functions in |block| commands and environments as well. Furthermore, sometimes we may print content, but then desire to bring it back into the document multiple times, without duplicating the code that creates the content. Here, we create a number of macros that allow access to printed content. All macros are created in two identical forms, one based on the name |print| and one based on the name |stdout|. Which macros are used depends on user preference. The macros based on |stdout| provide symmetry with |stderr| access.
%
@@ -2913,6 +3076,7 @@
\def\pytx@InlineShowPyg{%
\begingroup
\pytx@FVSet
+ \pytx@ConfigPygments
\ifcsname FV@SV@\pytx@counter @\arabic{\pytx@counter}\endcsname
\setcounter{pytx@FancyVerbLineTemp}{\value{FancyVerbLine}}%
\BUseVerbatim{\pytx@counter @\arabic{\pytx@counter}}%
@@ -2955,6 +3119,18 @@
% \end{macro}
%
%
+% \begin{macro}{\pytx@InlineAlwaysprint}
+% This is like |\pytx@InlineAutoprint|, except that it always prints rather than depending on |autoprint|. It is used for the |s| commands, which are always expected to have output.
+% \begin{macrocode}
+\def\pytx@InlineAlwaysprint{%
+ \InputIfFileExists{\pytx@outputdir/\pytx@stdfile.stdout}%
+ {\DepyFile{p:\pytx@outputdir/\pytx@stdfile.stdout}}%
+ {\textbf{??}%
+ \PackageWarning{\pytx@packagename}{Missing sub content}}}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\pytx@InlineMacroprint}
% This macro brings in ``printed'' content that is brought in via macros in the .pytxmcr file. We must disable the macro in the event that the |debug| option is false.
% \begin{macrocode}
@@ -3080,6 +3256,27 @@
% \end{macro}\end{macro}
%
%
+% \begin{macro}{\pytx@MakeInlinesFV}\begin{macro}{\pytx@MakeInlinesPyg}
+% This macro behaves almost exactly like code commands on the \LaTeX\ side, but on the Python side, the argument is treated as a template in which fields are evaluated and replaced with the result. Since no code is typeset, there is no difference between the |fancyvrb| and Pygments forms.
+% \begin{macrocode}
+\newcommand{\pytx@MakeInlinesFV}[1]{%
+ \expandafter\newrobustcmd\expandafter{\csname #1s\endcsname}{%
+ \Depythontex{cmd:#1s:ov:p}%
+ \xdef\pytx@type{#1}%
+ \edef\pytx@cmd{s}%
+ \pytx@SetContext
+ \pytx@SetGroup
+ \let\pytx@InlineShow\@empty
+ \let\pytx@InlineSave\pytx@InlineSaveCode
+ \let\pytx@InlinePrint\pytx@InlineAlwaysprint
+ \pytx@Inline
+ }%
+}%
+\let\pytx@MakeInlinesPyg\pytx@MakeInlinesFV
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
% \begin{macro}{\pytx@MakeInlineFV}\begin{macro}{\pytx@MakeInlinePyg}
% This macro creates plain inline commands, which save code and then bring in the output of |pytex.formatter(|\meta{code}|)| (|pytex.formatter()| is the formatter function in Python sessions that is provided by |pythontex_utils*.py|). The Python output is saved in a \TeX\ macro, and the macro is written to a file shared by all \pytex\ sessions. This greatly reduces the number of external files needed. Since no code is typeset, there is no difference between the |fancyvrb| and Pygments forms.
% \begin{macrocode}
@@ -3336,6 +3533,7 @@
\setcounter{FancyVerbLine}{\value{\pytx@linecount}}%
\pytx@FVSet
\ifdefstring{\pytx@fvopttmp}{}{}{\expandafter\fvset\expandafter{\pytx@fvopttmp}}%
+ \pytx@ConfigPygments
\ifcsname FV@SV@\pytx@counter @\arabic{\pytx@counter}\endcsname
\UseVerbatim{\pytx@counter @\arabic{\pytx@counter}}%
\else
@@ -3467,9 +3665,9 @@
}%
{\end{VerbatimOut}%
\xdef\pytx@stdfile{\pytx@type_\pytx@session_\pytx@group_\arabic{\pytx@counter}}%
- \pytx@EnvAutoprint
\setcounter{FancyVerbLine}{\value{pytx@FancyVerbLineTemp}}%
\stepcounter{\pytx@counter}%
+ \pytx@EnvAutoprint
}%
}%
% \end{macrocode}
@@ -3537,6 +3735,48 @@
% \end{macro}
%
%
+% \subsubsection{Sub environment constructor}
+%
+% The |sub| environment behaves exactly like a |code| environment on the \LaTeX\ side: environment content is saved to the code file, and then the output is brought back in. The difference is on the Python side, where the environment content is treated as a template in which fields are evaluated and replaced with the result.
+%
+% \begin{macro}{\pytx@MakeSubFV}
+% Create a |sub| environment compatible with |fancyvrb|, reusing the |code| approach almost entirely.
+% \begin{macrocode}
+\newcommand{\pytx@MakeSubFV}[1]{%
+ \expandafter\newenvironment{#1sub}{%
+ \VerbatimEnvironment
+ \Depythontex{env:#1sub:om|:p}%
+ \xdef\pytx@type{#1}%
+ \edef\pytx@cmd{sub}%
+ \pytx@SetContext
+ \pytx@SetGroup
+ \begingroup
+ \obeylines
+ \@ifnextchar[{\endgroup\pytx@BeginCodeEnv}{\endgroup\pytx@BeginCodeEnv[]}%
+ }%
+ {\end{VerbatimOut}%
+ \xdef\pytx@stdfile{\pytx@type_\pytx@session_\pytx@group_\arabic{\pytx@counter}}%
+ \setcounter{FancyVerbLine}{\value{pytx@FancyVerbLineTemp}}%
+ \stepcounter{\pytx@counter}%
+ \InputIfFileExists{\pytx@outputdir/\pytx@stdfile.stdout}%
+ {\DepyFile{p:\pytx@outputdir/\pytx@stdfile.stdout}}%
+ {\textbf{??~\pytx@packagename~??}%
+ \PackageWarning{\pytx@packagename}{Non-existent substituted content}}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pytx@MakeSubPyg}
+% The Pygments-compatible version is the same.
+% \begin{macrocode}
+\let\pytx@MakeSubPyg\pytx@MakeSubFV
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
% \subsubsection{Console environment constructor}
%
% The |console| environment needs to write all code contained in the environment to the code file, and then bring in the console output.
@@ -3631,6 +3871,7 @@
\setcounter{FancyVerbLine}{\value{\pytx@linecount}}%
\pytx@FVSet
\ifdefstring{\pytx@fvopttmp}{}{}{\expandafter\fvset\expandafter{\pytx@fvopttmp}}%
+ \pytx@ConfigPygments
\ifcsname FV@SV@\pytx@counter @\arabic{\pytx@counter}\endcsname
\UseVerbatim{\pytx@counter @\arabic{\pytx@counter}}%
\DepyMacro{c:\pytx@counter @\arabic{\pytx@counter}}%
@@ -3654,13 +3895,16 @@
%
% \begin{macro}{\makepythontexfamily}
% This macro creates a family of commands. It needs a some |pgfkeys| to handle the optional arguments. The actual creation of all non-code commands and environments is delayed using |\AtBeginDocument|, so that the user has the option to choose whether |fancyvrb| or Pygments is used for the family.
+%
+% We need to create a counter for the default session for each family to avoid (some of the) issues with |\includeonly| and counters. See \url{http://tug.org/pipermail/macostex-archives/2010-December/046007.html} for more on the problematic counter behavior with |\includeonly|.
% \begin{macrocode}
\pgfkeys{
/PYTX/family/.is family,
/PYTX/family,
+ name/.estore in = \pytx@tmp@name,
prettyprinter/.estore in = \pytx@tmp@pprinter,
pyglexer/.estore in = \pytx@tmp@pyglexer,
- pygopt/.estore in = \pytx@tmp@pygopt,
+ pygopt/.code = \def\pytx@tmp@pygopt{#1}\pgfkeys{/PYTX/lopt/pygopt/.cd, #1},
console/.estore in = \pytx@tmp@console,
default/.style = {prettyprinter=auto, pyglexer=text, pygopt={}, console=false}
}
@@ -3707,14 +3951,16 @@
\IfBeginWith{#2}{PYG}%
{\PackageError{\pytx@packagename}%
{Attempt to create macros with reserved prefix PYG}{}}{}%
- \pgfkeys{/PYTX/family, default, #1}
+ \pgfkeys{/PYTX/family, name=#2, default, #1}
\expandafter\xdef\csname pytx@macroformatter@#2\endcsname{\pytx@tmp@pprinter}
\expandafter\gdef\csname pytx@fvsettings@#2\endcsname{}
\expandafter\xdef\csname pytx@pyglexer@#2\endcsname{\pytx@tmp@pyglexer}
\expandafter\xdef\csname pytx@pygopt@#2\endcsname{\pytx@tmp@pygopt}
\expandafter\xdef\csname pytx@console@#2\endcsname{\pytx@tmp@console}
\pytx@MakeInlinecFV{#2}
+ \pytx@MakeInlinesFV{#2}
\pytx@MakeCodeFV{#2}
+ \pytx@MakeSubFV{#2}
\AtBeginDocument{%
\ifcsstring{pytx@macroformatter@#2}{auto}{%
\ifbool{pytx@opt@pygments}%
@@ -3730,6 +3976,7 @@
{\ifcsstring{pytx@console@#2}{true}%
{\pytx@MakeFamilyPygCons{#2}}{\pytx@MakeFamilyPyg{#2}}}{}%
}%
+ \newcounter{pytx@#2@default@default}%
}
\@onlypreamble\makepythontexfamily
% \end{macrocode}
@@ -3760,14 +4007,15 @@
% \begin{macrocode}
\newcommand{\setpythontexpygopt}[2][]{%
\Depythontex{cmd:setpythontexpygopt:om:n}%
- \ifstrempty{#1}{\def\pytx@pygopt{#2}}{%
- \ifcsname pytx@pygopt@#1\endcsname
+ \ifstrempty{#1}%
+ {\def\pytx@pygopt{#2}\pgfkeys{/PYTX/gopt/pygopt/.cd, #2}}%
+ {\ifcsname pytx@pygopt@#1\endcsname
\expandafter\xdef\csname pytx@pygopt@#1\endcsname{#2}%
- \else
+ \pgfkeys{/PYTX/lopt/pygopt/.cd, name=#1, #2}
+ \else
\PackageError{\pytx@packagename}%
- {Cannot modify Pygments options for a non-existent family}{}%
- \fi
- }%
+ {Cannot modify Pygments options for a non-existent family}{}%
+ \fi}%
}
\@onlypreamble\setpythontexpygopt
% \end{macrocode}
@@ -3818,6 +4066,10 @@
\ifstrequal{#1}{jl}{\makepythontexfamily[pyglexer=julia]{jl}}{}%
\ifstrequal{#1}{matlab}{\makepythontexfamily[pyglexer=matlab]{matlab}}{}%
\ifstrequal{#1}{octave}{\makepythontexfamily[pyglexer=octave]{octave}}{}%
+ \ifstrequal{#1}{bash}{\makepythontexfamily[pyglexer=bash]{bash}}{}%
+ \ifstrequal{#1}{sage}{\makepythontexfamily[pyglexer=sage]{sage}}{}%
+ \ifstrequal{#1}{rust}{\makepythontexfamily[pyglexer=rust]{rust}}{}%
+ \ifstrequal{#1}{rs}{\makepythontexfamily[pyglexer=rust]{rs}}{}%
}
\expandafter\docsvlist\expandafter{\pytx@families}
% \end{macrocode}
@@ -4007,6 +4259,7 @@
\setcounter{FancyVerbLine}{\value{\pytx@linecount}}%
\pytx@FVSet
\ifdefstring{\pytx@fvopttmp}{}{}{\expandafter\fvset\expandafter{\pytx@fvopttmp}}%
+ \pytx@ConfigPygments
\ifcsname FV@SV@\pytx@counter @\arabic{\pytx@counter}\endcsname
\UseVerbatim{\pytx@counter @\arabic{\pytx@counter}}%
\else
@@ -4117,6 +4370,7 @@
\begingroup
\pytx@FVSet
\fvset{firstnumber=auto}%
+ \pytx@ConfigPygments
\ifcsname FV@SV@pytx@\pytx@type @\pytx@session @\pytx@group
@\arabic{\pytx@counter}\endcsname
\UseVerbatim[##1]{pytx@\pytx@type @\pytx@session @\pytx@group
@@ -4160,8 +4414,10 @@
% \begin{macrocode}
\newcommand{\setpygmentspygopt}[2][]{%
\Depythontex{cmd:setpygmentspygopt:om:n}%
- \ifstrempty{#1}{\def\pytx@pygopt{#2}}{%
- \expandafter\gdef\csname pytx@pygopt@PYG#1\endcsname{#2}}%
+ \ifstrempty{#1}%
+ {\def\pytx@pygopt{#2}\pgfkeys{/PYTX/gopt/pygopt/.cd, #2}}%
+ {\expandafter\gdef\csname pytx@pygopt@PYG#1\endcsname{#2}%
+ \pgfkeys{/PYTX/popt/pygopt/.cd, name=#1, #2}}%
}
\@onlypreamble\setpygmentspygopt
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/pythontex/pythontex.ins b/Master/texmf-dist/source/latex/pythontex/pythontex.ins
index 7eb253091a8..605cf4cc9b2 100644
--- a/Master/texmf-dist/source/latex/pythontex/pythontex.ins
+++ b/Master/texmf-dist/source/latex/pythontex/pythontex.ins
@@ -1,4 +1,4 @@
-%% Copyright (C) 2012-2013 by Geoffrey M. Poore <gpoore@gmail.com>
+%% Copyright (C) 2012-2016 by Geoffrey M. Poore <gpoore@gmail.com>
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -25,7 +25,7 @@
This is a generated file.
-Copyright (C) 2012-2013 by Geoffrey M. Poore <gpoore@gmail.com>
+Copyright (C) 2012-2016 by Geoffrey M. Poore <gpoore@gmail.com>
--------------------------------------------------------------------------
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
@@ -45,9 +45,9 @@ version 2005/12/01 or later.
\Msg{* To finish the installation you have to move the following *}
\Msg{* file into a directory searched by TeX: *}
\Msg{* *}
-\Msg{* pythontex.sty *}
+\Msg{* pythontex.sty *}
\Msg{* *}
-\Msg{* To produce the documentation run the file pythontex.dtx *}
+\Msg{* To produce the documentation run the file pythontex.dtx *}
\Msg{* through LaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}