|
26 | 26 | %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
27 | 27 | %<package>\ProvidesPackage{pythontex} |
28 | 28 | %<*package> |
29 | | - [2019/09/20 v0.17dev execute and typeset Python code and other languages] |
| 29 | + [2019/09/22 v0.17 execute and typeset Python code and other languages] |
30 | 30 | %</package> |
31 | 31 | % |
32 | 32 | %<*driver> |
|
40 | 40 | \usepackage{environ} |
41 | 41 | \usepackage{enumitem} |
42 | 42 | \usepackage{fvextra} |
| 43 | +% The typesetting for macrocode doesn't use \@noligs, which upquote modifies. |
| 44 | +% So apply the upquote fix to \verbatim@nolig@list as well, which is in macrocode. |
| 45 | +\begingroup |
| 46 | +\catcode`'=\active |
| 47 | +\catcode``=\active |
| 48 | +\g@addto@macro\verbatim@nolig@list{% |
| 49 | + \let'\textquotesingle |
| 50 | + \let`\textasciigrave |
| 51 | + \ifx\encodingdefault\upquote@OTone |
| 52 | + \ifx\ttdefault\upquote@cmtt |
| 53 | + \def'{\char13 }% |
| 54 | + \def`{\char18 }% |
| 55 | + \fi\fi} |
| 56 | +\endgroup |
43 | 57 | \usepackage{pythontex} |
44 | 58 | \usepackage{hyperref} |
45 | 59 | \hypersetup{ |
|
154 | 168 | % |
155 | 169 | % |
156 | 170 | % |
157 | | -% \begin{changelog}{v0.17}{2019/09/??} |
| 171 | +% \begin{changelog}{v0.17}{2019/09/22} |
158 | 172 | % \begin{itemize} |
159 | 173 | % \item Pygments syntax highlighting for the Python console (\texttt{pycon} lexer) now uses the \texttt{python3} option, and the default Python lexer is now \texttt{python3} (\#156). |
160 | 174 | % \item Added support for JavaScript (\#147; thanks to Nathan Carter). |
161 | 175 | % \item Updated Julia support for Julia versions 0.6 (\#107), and 0.7 and 1.0 (\#126, \#130). |
162 | | -% \item There are now meaningful error messages for Julia console when Weave.jl is not installed or raises errors (\#131). |
| 176 | +% \item There are now meaningful error messages for the Julia console when Weave.jl is not installed or raises errors (\#131). |
163 | 177 | % \item \texttt{pythontexcustomcode} and \texttt{\string\pythontexcustomc} now set \texttt{pytex.context} (\#65). |
164 | 178 | % \item Added support for R. The \texttt{R} family of commands and environments (\texttt{\string\R}, \texttt{\string\Rc}, \texttt{Rcode}, ...) executes code as a script. There is currently no utilities class or equivalent. The \texttt{Rcon} family (\texttt{Rconsole}) executes code to emulate an interactive R session (\#121). |
165 | 179 | % \item \texttt{fancyvrb} settings from \texttt{\string\setpythontexfv} and console environments now work with Julia and R consoles. |
166 | | -% \item \texttt{pythontexcustomcode} now works with |juliacon|. There are now proper \texttt{juliaconcode} and \texttt{Rconcode} environments that execute code but typeset nothing, to parallel \texttt{pyconcode} (\#134). |
| 180 | +% \item \texttt{pythontexcustomcode} now works with \texttt{juliacon}. There are now proper \texttt{juliaconcode} and \texttt{Rconcode} environments that execute code but typeset nothing, to parallel \texttt{pyconcode} (\#134). |
167 | 181 | % \item Added support for Perl with the \texttt{perl} and \texttt{pl} families of commands and environments. There is currently no utilities class or equivalent. |
168 | 182 | % \item Added support for Perl 6 with the \texttt{perlsix} and \texttt{psix} families of commands and environments (\#104). There is currently no utilities class or equivalent. |
| 183 | +% \item Updated Rust support by using \texttt{dyn} with traits in utilities object. |
169 | 184 | % \item Under Windows, capitalization of script paths in \texttt{stderr} is now preserved. |
170 | 185 | % \item Fixed a bug that prevented the \texttt{sub} environment from working with \texttt{depythontex} (\#155). |
171 | | -% \item Fixed a bug in checking mtime of dependencies to see if they have been modified while \texttt{pythontex} is running. The check failed for dependencies that do not exist or were deleted before \texttt{pythontex} can read them (\#136) |
| 186 | +% \item Fixed a bug in checking mtime of dependencies to see if they have been modified while \texttt{pythontex} is running. The check failed for dependencies that do not exist or were deleted before \texttt{pythontex} can read them (\#136). |
172 | 187 | % \end{itemize} |
173 | 188 | % \end{changelog} |
174 | 189 | % |
|
457 | 472 | % |
458 | 473 | % While Python is the focus of \pytex, adding basic support for an additional language is usually as simple as creating a new class instance and a few templates, usually totaling less than 100 lines of code. The following languages already have built-in support: Ruby, Julia, Octave, Bash, Rust, R, Perl, Perl 6, and JavaScript. |
459 | 474 | % \end{abstract} |
| 475 | +% |
460 | 476 | % |
461 | 477 | % |
462 | 478 | % \section*{\centering Warning} |
|
679 | 695 | % |
680 | 696 | % \DescribeMacro{usefamily=\meta{basename}/\marg{basename1,~basename2,~...}} |
681 | 697 | % |
682 | | -% By default, only the |py|, |sympy|, and |pylab| families of commands and environments are defined, to prevent possible package conflicts.\footnote{For example, a \texttt{\string\ruby} command for Ruby code, and the \texttt{\string\ruby} command defined by the Ruby package in the \href{http://www.ctan.org/pkg/cjk}{CJK package}.} This option defines preconfigured families for other available languages. It takes either a single language base name, or a list of comma-separated names enclosed in curly braces. Currently, the Ruby families |rb| and |ruby|, the Julia families |jl| and |julia|, and the Octave family |octave| may be created. |
| 698 | +% By default, only the |py|, |sympy|, and |pylab| families of commands and environments are defined, to prevent possible package conflicts.\footnote{For example, a \texttt{\string\ruby} command for Ruby code, and the \texttt{\string\ruby} command defined by the Ruby package in the \href{http://www.ctan.org/pkg/cjk}{CJK package}.} This option defines preconfigured families for other available languages. It takes either a single language base name, or a list of comma-separated names enclosed in curly braces. For example, the Ruby families |rb| and |ruby|, the Julia families |jl| and |julia|, and the Octave family |octave| may be enabled. For a full list of supported languages, see \Cref{sec:other-languages}. |
683 | 699 | % |
684 | 700 | % |
685 | 701 | % \DescribeMacro{gobble=none/auto default:none} |
|
1538 | 1554 | % \section{Support for additional languages} |
1539 | 1555 | % \label{sec:other-languages} |
1540 | 1556 | % |
1541 | | -% Beginning with v0.12, it is much simpler to add support for languages beyond Python. Support for several additional languages will be added in coming months. |
| 1557 | +% Details about adding support for additional languages are in \Cref{sec:other-languages:adding}. This section begins with a brief overview of supported languages and available features. |
1542 | 1558 | % |
1543 | | -% In the immediate future, support for additional languages will be part of \pytex. Later, it may make sense to provide an alternative interface for other languages. For example, a package could be created that provides access to \pytex\ internals in a language-agnostic manner, without having the word ``python'' as part of the command names. |
1544 | | -% |
1545 | | -% Languages beyond Python will typically not be enabled by default, to prevent potential macro naming conflicts with other packages. At least two possible base names for commands and environments will be provided for each language. Typically these will be the name of the language and the language's file extension. For example, Ruby has the |ruby| and |rb| base names. You can choose which base name to use for creating a family of commands and environments based on personal preference and potential naming conflicts. |
| 1559 | +% Languages beyond Python are typically not be enabled by default to prevent potential macro naming conflicts with other packages. Languages are enabled via the |usefamily| package option (\Cref{sec:usage}). For example, |
| 1560 | +%\begin{verbatim} |
| 1561 | +%\usepackage[usefamily=ruby]{pythontex} |
| 1562 | +%\end{verbatim} |
| 1563 | +% Usually at least two possible base names for commands and environments will be provided for each language. Typically these will be the name of the language and the language's file extension. For example, Ruby has the |ruby| and |rb| base names. You can choose which base name to use for creating a family of commands and environments based on personal preference and potential naming conflicts. |
1546 | 1564 | % |
1547 | 1565 | % |
1548 | 1566 | % \subsection{Ruby} |
|
1639 | 1657 | % |
1640 | 1658 | % |
1641 | 1659 | % \subsection{Adding support for a new language} |
| 1660 | +% \label{sec:other-languages:adding} |
1642 | 1661 | % |
1643 | 1662 | % Adding support for an additional language involves creating two templates, creating a new instance of a class, and using a \pytex\ macro. In some cases, additional changes may be necessary for full support. The information below does not deal with creating |console| families; additional support for user-defined |console| families will be added in the future. |
1644 | 1663 | % |
|
1866 | 1885 | % We store the name of the package in a macro for later use in warnings and error messages. |
1867 | 1886 | % \begin{macrocode} |
1868 | 1887 | \newcommand{\pytx@packagename}{PythonTeX} |
1869 | | -\newcommand{\pytx@packageversion}{0.17dev} |
| 1888 | +\newcommand{\pytx@packageversion}{0.17} |
1870 | 1889 | % \end{macrocode} |
1871 | 1890 | % |
1872 | 1891 | % \subsection{Required packages} |
|
0 commit comments