Debian Codegraph @

texmf-dist/doc/latex/pythontex/NEWS.rst

raw
1 ==================================================
2 PythonTeX News
3 ==================================================
4
5
6 Version History
7 ===============
8
9
10 v0.19 (2026/02/15)
11 ------------------
12
13 * Fixed backslash escapes in docstrings and regexes for syntax compatibility
14 with Python 3.11+.
15
16 * ``js`` now works as a command family for JavaScript (#197).
17
18 * Python console commands and environments are now compatible with Python
19 3.14 (#229).
20
21 * Fixed a bug that could cause non-Windows operating systems to attempt to
22 invoke a nonexistent batch file when the executable associated with a
23 language is not found (#225).
24
25 * Replaced doctype ``tex`` with ``texminted`` for ``Weave.jl`` (#219).
26
27 * Fixed a bug that resulted in uncaught exceptions when ``\inputpygments``
28 was used with files that do not exist (#64).
29
30 * Fixed a bug in tracking the number of Pygments errors (#206).
31
32 * Improved error messages (#207, #209). Improved documentation for
33 ``--error-exit-code`` (#208).
34
35 * Several minor improvements to documentation.
36
37
38
39 v0.18 (2021/06/06)
40 ------------------
41
42 * ``\inputpygments`` now checks inputted files for modification, so that
43 typeset code will correctly update when the source is changed (#162).
44
45 * Julia now uses project flag "``--project=@.``" (#157, #158).
46
47 * Fixed bug in processing Pygments options (``pygopt``) when a key is used
48 without a value (#181).
49
50 * Some error handling for Windows was incompatible with other operating
51 systems: replaced checks for ``WindowsError`` with checks for ``OSError``
52 (#177).
53
54 * Rust support is now compatible with document and working directory paths
55 that contain spaces (#167).
56
57
58
59 v0.17 (2019/09/22)
60 ------------------
61
62 * Pygments syntax highlighting for the Python console (``pycon`` lexer) now
63 uses the ``python3`` option, and the default Python lexer is now
64 ``python3`` (#156).
65
66 * Added support for JavaScript (#147; thanks to Nathan Carter).
67
68 * Updated Julia support for Julia versions 0.6 (#107), and 0.7 and 1.0 (#126,
69 #130).
70
71 * There are now meaningful error messages for the Julia console when Weave.jl
72 is not installed or raises errors (#131).
73
74 * ``pythontexcustomcode`` and ``\pythontexcustomc`` now set
75 ``pytex.context`` (#65).
76
77 * Added support for R. The ``R`` family of commands and environments
78 (``\R``, ``\Rc``, ``Rcode``, ...) executes code as a script.
79 There is currently no utilities class or equivalent. The ``Rcon`` family
80 (``Rconsole``) executes code to emulate an interactive R session (#121).
81
82 * ``fancyvrb`` settings from ``\setpythontexfv`` and console
83 environments now work with Julia and R consoles.
84
85 * ``pythontexcustomcode`` now works with ``juliacon``. There are now proper
86 ``juliaconcode`` and ``Rconcode`` environments that execute code but
87 typeset nothing, to parallel ``pyconcode`` (#134).
88
89 * Added support for Perl with the ``perl`` and ``pl`` families of commands
90 and environments. There is currently no utilities class or equivalent.
91
92 * Added support for Perl 6 with the ``perlsix`` and ``psix`` families of
93 commands and environments (#104). There is currently no utilities class or
94 equivalent.
95
96 * Updated Rust support by using ``dyn`` with traits in utilities object.
97
98 * Under Windows, capitalization of script paths in ``stderr`` is now
99 preserved.
100
101 * Fixed a bug that prevented the ``sub`` environment from working with
102 ``depythontex`` (#155).
103
104 * Fixed a bug in checking mtime of dependencies to see if they have been
105 modified while ``pythontex`` is running. The check failed for dependencies
106 that do not exist or were deleted before ``pythontex`` can read them
107 (#136).
108
109
110
111 v0.16 (2017/07/20)
112 ------------------
113
114 * Added preliminary console support for Julia (#98).
115
116 * Fixed Python console compatibility with Python 3.6 by setting the ``code``
117 module's new ``exitmsg`` argument to suppress the exit message (#100).
118
119 * Improved Rust support, including tracking of created files and
120 dependencies (#91).
121
122
123
124 v0.15 (2016/07/21)
125 ------------------
126
127 New features
128 ~~~~~~~~~~~~
129
130 * The ``fvextra`` package is now required. This provides line breaking with
131 fine-grained control over break locations, the ability to highlight
132 specific lines or ranges of lines, improved handling of tabs, and several
133 additional features.
134
135 * Added ``sub`` commands and environments (``\pys``, ``pysub``, ...). These
136 commands and environments perform string interpolation on text. Fields
137 delimited by ``!{...}`` are replaced by the result of evaluating and then
138 printing their content. This works for all families of commands and
139 environments, not just Python. See the documentation for details about
140 field delimiters and escaping.
141
142 * Added ``rust`` and ``rs`` families of commands and environments. These
143 provide essentially complete support for Rust, except that
144 ``rstex.formatter()``, ``rstex.before()``, and ``rstex.after()`` will
145 likely need additional refinement (#90).
146
147 * Added the ``sage`` family of commands and environments, which provide
148 support for Sage (#63).
149
150 * Added ``bash`` family of commands and environments. This provides basic
151 support for bash (no utilities class or equivalent). Bash works with
152 Windows if it is installed.
153
154 * Improved ``console`` compatibility under Linux with Python 3 (#70).
155
156 * Counters for default sessions are now created automatically. This prevents
157 counter errors under some circumstances when working with ``\includeonly``.
158
159 * Commands like ``\py`` can now output verbatim content under LuaTeX.
160
161 Bugfixes
162 ~~~~~~~~
163
164 * Fixed a bug that could cause an endless loop when a ``code`` command or
165 environment printed a ``code`` command or environment of the same family
166 with ``autoprint=true``.
167
168
169
170 v0.14 (2014/07/17)
171 ------------------
172
173 New features
174 ~~~~~~~~~~~~
175
176 * All commands for working with code inline are now robust, via
177 ``etoolbox``'s ``\newrobustcmd``. Among other things, this allows
178 commands like ``\py`` to work in standard captions that have not been
179 redefined to avoid protection issues.
180 * Upgraded ``syncpdb`` to v0.2, which provides better list formatting.
181
182 Backward-incompatible changes
183 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184
185 * The default working directory is now the main document directory instead
186 of the output directory. Using the output directory was a common source
187 of confusion for new users and was incompatible with plans for future
188 development. Old documents in which the working directory was not
189 specified will continue to use the output directory, but PythonTeX will
190 print an upgrade message; new documents will use the new setting. The
191 output directory may be selected as the working directory manually, or
192 with the shorthand
193 "``\setpythontexworkingdir{<outputdir>}``".
194
195 * Standardized version numbering by removing the "v" prefix from the stored
196 version numbers in Python variables and LaTeX macros. Standardized the
197 PythonTeX scripts by renaming ``version`` to ``__version__``.
198
199
200
201 v0.13 (2014/07/14)
202 ------------------
203
204 New features
205 ~~~~~~~~~~~~
206
207 * Added ``--interactive`` command-line option. This runs a single
208 session in interactive mode, allowing user input. Among other things,
209 this is useful when working with debuggers.
210
211 * Added ``--debug`` command-line option. This runs a single session
212 with the default debugger in interactive mode. Currently, only
213 standard (non-console) Python sessions are supported. The default
214 Python debugger is the new ``syncpdb``, which wraps ``pdb`` and
215 synchronizes code line numbers with document line numbers. All
216 ``pdb`` commands that take a line number or filename:lineno as an
217 argument will refer to document files and line numbers when the
218 argument has a percent symbol (``%``) as a prefix. For example,
219 ``list %50`` lists code that came from around line 50 in the
220 document. The ``--debug`` option will support other languages and
221 provide for customization in the future.
222
223 * Added command-line option ``--jobs``, which allows the maximum number
224 of concurrent processes to be specified (#35).
225
226 * Added support for GNU Octave, via the ``octave`` family of commands
227 and environments (#36). Parsing of Octave stderr is not ideal, though
228 synchronization works in most cases; this will be addressed by a
229 future rewrite of the stderr parser.
230
231 * Installer now automatically works with MiKTeX, not just TeX Live.
232
233 * The PythonTeX utilities class has a new ``open()`` method that opens
234 files and automatically tracks dependencies/created files.
235
236 * When ``pythontex2.py`` and ``pythontex3.py`` are run directly, the
237 Python interpreter is automatically set to a reasonable default
238 (``py -2`` or ``py -3`` under Windows, using the Python 3.3+ wrapper;
239 ``python2`` or ``python3`` under other systems).
240
241 * The installer now creates symlinks for the numbered scripts
242 ``pythontex*.py`` and ``depythontex*.py``.
243
244 * Added Python version checking to all numbered scripts.
245
246 * Under Python, the type of data passed via ``\setpythontexcontext`` may
247 now be set using YAML-style tags (``!!str``, ``!!int``, ``!!float``). For
248 example, ``{myint=!!int 123}``.
249
250 * The ``fancyvrb`` options ``firstline`` and ``lastline`` now work with
251 the ``pygments`` environment and ``\inputpygments`` command. This required
252 some additional patching of ``fancyvrb``.
253
254 * The ``pytx@Verbatim`` and ``pytx@SaveVerbatim`` environments are now
255 used for typesetting verbatim code. These are copies of the
256 ``fancyvrb`` environments. This prevents conflicts when literal
257 ``Verbatim`` and ``SaveVerbatim`` environments need to be typeset.
258
259 * Improved ``latexmk`` compatibility (#40). Added discussion of
260 ``latexmk`` usage to documentation.
261
262 * Tildes ``~`` may now be used in ``outputdir`` and ``workingdir`` to
263 refer to the user�s home directory, even under Windows.
264
265 Bugfixes
266 ~~~~~~~~
267
268 * Fixed a bug that prevented created files from being cleaned up when
269 the working directory was not the document root directory and the
270 full path to the files was not provided.
271
272 * Fixed a bug that prevented the ``fvextfile`` option from working when
273 external files were highlighted.
274
275
276
277 v0.13-beta (2014/02/06)
278 -----------------------
279
280 New features
281 ~~~~~~~~~~~~
282
283 * Switching to GitHub's Releases for downloads.
284
285 * TeX information such as page dimensions may now be easily passed to the
286 programming-language side, using the new ``\setpythontexcontext`` command.
287 Contextual information is stored in the ``context`` attribute of the
288 utilities class, which is a dictionary (and also has attributes in Python).
289
290 * The utilities class now has ``pt_to_in()``, ``pt_to_cm()``, and
291 ``pt_to_mm()`` methods for converting units of TeX points into inches,
292 centimeters, and millimeters. These work with integers and floats, as
293 well as strings that consist of numbers and optionally end in "pt". There
294 is also a ``pt_to_bp()`` for converting TeX points (1/72.27 inch) into big
295 (DTP or PostScript) points (1/72 inch).
296
297 * Expanded Quickstart. Quickstart is now compatible with all LaTeX engines.
298 Quickstart now avoids ``microtype`` issues on some systems (#32).
299
300 * Added information on citing PythonTeX (#28).
301
302 * Utilities class has a new attribute ``id``, which is a string that joins
303 the command family name, session name, and session restart parameters with
304 underscores. This may be used in creating files that need a name that
305 contains a unique, session-based identifier (for example, names for
306 figures that are saved automatically).
307
308 Backward-incompatible changes
309 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310
311 * All utilities-class attributes with names of the form ``input_*`` have
312 been renamed with the "``input_``" removed. Among other things, this
313 makes it easier to access the ``context`` attribute (``pytex.context``
314 vs. ``pytex.input_context``).
315
316 * ``depythontex`` now has ``-o`` and ``--output`` command-line options for
317 specifying the name of the output file. If an output file is not
318 specified, then output is written to ``stdout``. This allows
319 ``depythontex`` output to be piped to another program.
320
321 * All scripts ``*2.py`` now have shebangs with ``env python2``, and all
322 scripts ``*3.py`` now have shebangs with ``env python3``. This allows the
323 wrapper scripts (``env python`` shebang) to be used with the default
324 Python installation, and the numbered scripts to be used with specific
325 versions. Remember that except for console content, the ``--interpreter``
326 option is what determines the Python version that actually executes code.
327 The version of Python used to launch ``pythontex.py`` merely determines
328 the version that manages code execution. (``--interpreter`` support for
329 console content is coming.)
330
331 * Changed the template style used in the ``CodeEngine`` class. Replacement
332 fields are now surrounded by single curly braces (as in Python's format
333 string syntax), rather than double curly braces. Literal curly braces are
334 obtained by doubling braces. This allows the use of literal adjacent
335 double braces in templates, which was not possible previously.
336
337 * The Julia template now uses the new ``in()`` function, replacing
338 ``contains()``. This requires Julia v0.2.0+.
339
340 Bugfixes
341 ~~~~~~~~
342
343 * Modified test for LuaTeX, so that ``\directlua`` is not ``\let`` to
344 ``\relax`` if it does not exist. This was causing incompatibility with
345 ``babel`` under pdfTeX and XeTeX (#33).
346
347 * Added missing shebangs to ``depythontex*.py``. Handling of ``utilspath``
348 is now more forgiving, so that ``pythontex_utils.py`` can be installed in
349 alternate locations (#23).
350
351 * ``depythontex`` no longer leaves a blank line where
352 ``\usepackage{pythontex}`` was removed.
353
354 * Console environments typeset with ``fancyvrb`` no longer end with an
355 unnecessary empty line.
356
357 * Fixed bug in installer when ``kpsewhich`` was not found (#21).
358
359
360
361 v0.12 (2013/08/26)
362 ------------------
363
364 * Added support for the Julia language, with the ``julia`` and ``jl``
365 families of commands and environments. (Note that Pygments only added
366 Julia support in version 1.6.)
367
368 * Warnings and errors are now synchronized with the line numbers of files
369 brought in via ``\input``, ``\include``, etc. This is accomplished using
370 the ``currfile`` package.
371
372 * Added package option ``gobble``. When ``gobble=auto``, all code is
373 dedented before being executed and/or typeset. The current
374 implementation is functional but basic; it will be improved and extended
375 in the future.
376
377 * The document root directory is now always added to ``sys.path`` (or its
378 equivalent), even when it is not the working directory. (The working
379 directory has been added to ``sys.path`` since v0.12beta.) The document
380 directory is added after the working directory, so that the working
381 directory has precedence.
382
383 * Fixed a bug in ``console`` commands and environments; ``sys.path`` now
384 contains the working and document directories, and the working directory
385 is now the output directory by default. This parallels the behavior of
386 non-``console`` commands and environments.
387
388 * Added command-line option ``--interpreter`` that allows an interpreter to
389 be invoked via a specific command. This allows, for example, a specific
390 version of Python to be invoked.
391
392 * Improved synchronization of stderr in cases when an error is triggered
393 far after its origin (for example, an error caused by a multiline string
394 that is lacking a closing quote/delimiter, and thus may span several
395 chunks of user code).
396
397 * Modified usage of the ``shlex`` module to work around its lack of Unicode
398 support in Python versions prior to 2.7.3.
399
400 * Fixed a bug from v0.12beta that prevented ``\inputpygments`` from working
401 when ``pygments=true``.
402
403 * Fixed a bug with counters that caused errors when content spanning
404 multiple columns was created within a ``tabular`` environment.
405
406 * Added checking for compatible Python versions in ``pythontex.py``.
407
408 * Improved execution of ``*.bat`` and ``*.cmd`` files under Windows. The
409 solution from v0.12beta allowed ``*.bat`` and ``*.cmd`` to be found and
410 executed when the extension was not given, but did not give correct
411 return codes.
412
413
414 v0.12beta (2013/06/24)
415 ----------------------
416
417 * Merged ``pythontex_types*.py`` into a single replacement
418 ``pythontex_engines.py`` compatible with both Python 2 and 3. It is
419 now much simpler to add support for additional languages.
420
421 * Added support for the Ruby language as a demonstration of new
422 capabilities. The ``ruby`` and ``rb`` families of commands and
423 environments may be enabled via the new ``usefamily`` package option.
424 Support for additional languages is coming soon. See the new section
425 in the documentation on support for other languages for more
426 information.
427
428 * Reimplemented treatment of Pygments content for better efficiency.
429 Now a Pygments process only runs if there is content to highlight.
430 Eliminated redundant highlighting of unmodified code.
431
432 * Improved treatment of dependencies. If a dependency is modified
433 (``os.path.getmtime()``) after the current PythonTeX run starts, then
434 code that depends on it will be re-executed the next time PythonTeX
435 runs. A message is also issued to indicate that this is the case.
436
437 * The utilities class now has ``before()`` and ``after()`` methods that
438 are called immediately before and after user code. These may be
439 redefined to customize output. For example, LaTeX commands could be
440 printed before and after user code; stdout could be redirected to
441 ``StringIO`` for further processing; or matplotlib figures could be
442 automatically detected, saved, and included in the document.
443
444 * Added explanation of how to track dependencies and created files
445 automatically, and how to include matplotlib figures automatically,
446 to the documentation for the PythonTeX utilities class.
447
448 * Created a new system for parsing and synchronizing stderr.
449
450 - Exceptions that do not reference a line number in user code (such
451 as those from ``warnings.warn()`` in a module) are now traced back
452 to a single command or environment. Previously no synchronization
453 was attempted. This is accomplished by writing delimiters to
454 stderr before executing the code from each command/environment.
455
456 - Exceptions that do reference a line in user code are more
457 efficiently synchronized with a document line number. This is
458 accomplished by careful record keeping as each script is
459 assembled. Line number synchronization no longer involves parsing
460 the script that was executed.
461
462 - Improved and generalized parsing of stderr, in preparation for
463 supporting additional languages. Exceptions that cannot be
464 identified as errors or warnings are treated based on
465 ``Popen.returncode``.
466
467 * Created a new system for ``console`` content.
468
469 - There are now separate families of ``console`` commands and
470 environments. No Pygments or ``fancyvrb`` settings are shared with
471 the non-``console`` families, as was previously the case. There
472 is a new family of commands and environments based on ``pycon``,
473 including the ``\pycon`` command (inline reference to console variable),
474 ``pyconsole`` environment (same as the old one), ``\pyconc`` and
475 ``pyconcode`` (execute only), and ``\pyconv`` and ``pyconverbatim``
476 (typeset only). There are equivalent families based on
477 ``pylabcon`` and ``sympycon``.
478
479 - Each console session now runs in its own process and is cached
480 individually. Console output is now cached so that changing
481 Pygments settings no longer requires re-execution.
482
483 - Unicode is now supported under Python 2.
484
485 - The new package option ``pyconfuture`` allows automatic imports
486 from ``__future__`` for ``console`` families under Python 2,
487 paralleling the ``pyfuture`` option.
488
489 - Any errors or warnings caused by code that is not typeset
490 (``code`` command and environment, startup code) are reported in
491 the run summary. This ensures that such code does not create
492 mischief.
493
494 - ``customcode`` is now supported for ``console`` content.
495
496 * Better support for ``latexmk`` and similar build tools. PythonTeX
497 creates a file of macros (``*.pytxmcr``) that is always included in a
498 document, and thus can be automatically detected and tracked by
499 ``latexmk``. This file now contains the time at which PythonTeX last
500 created files. When new files are created, the macro file will have a
501 new hash, triggering another document compile.
502
503 * Improved the way in which the PythonTeX ``outputdir`` is added to the
504 graphics path. This had been done with ``\graphicspath``, but that
505 overwrites any graphics path previously specified by the user. Now the
506 ``outputdir`` is appended to any pre-existing path.
507
508 * Added the ``depythontex`` option ``--graphicspath``. This adds the
509 ``outputdir`` to the graphics path of the ``depythontex`` document.
510
511 * The installer now provides more options for installation locations.
512 It will now create missing directories if desired.
513
514 * The working directory (``workingdir``) is now appended to
515 ``sys.path``, so that code there may be imported.
516
517 * Under Windows, ``subprocess.Popen()`` is now invoked with
518 ``shell=True`` if ``shell=False`` results in a WindowsError. This
519 allows commands involving ``*.bat`` and ``*.cmd`` files to be
520 executed when the extension is not specified; otherwise, only ``*.exe``
521 can be found and run.
522
523 * The path to utils is now found in ``pythontex.py`` via
524 ``sys.path[0]`` rather than ``kpsewhich``. This allows the PythonTeX
525 scripts to be executed in an arbitrary location; they no longer must
526 be installed in a texmf tree where ``kpsewhich`` can find them.
527
528 * Added ``rerun`` value ``never``.
529
530 * At the end of each run, data and macros are only saved if modified,
531 improving efficiency.
532
533 * The number of temporary files required by each process was reduced by
534 one. All macros for commands like ``\py`` are now returned within
535 stdout, rather than in their own file.
536
537 * Fixed a bug with ``\stderrpythontex``; it was defaulting to ``verb``
538 rather than ``verbatim`` mode.
539
540
541 v0.11 (2013/04/21)
542 ------------------
543
544 * As the first non-beta release, this version adds several features and introduces several changes. You should read these release notes carefully, since some changes are not backwards-compatible. Changes are based on a thorough review of all current and planned features. PythonTeX's capabilities have already grown beyond what was originally intended, and a long list of features still remains to be implemented. As a result, some changes are needed to ensure consistent syntax and naming in the future. Insofar as possible, all command names and syntax will be frozen after this release.
545 * Added the ``pythontex.py`` and ``depythontex.py`` wrapper scripts. When run, these detect the current version of Python and import the correct PythonTeX code. It is still possible to run ``pythontex*.py`` and ``depythontex*.py`` directly, but the new wrapper scripts should be used instead for simplicity. There is now only a single ``pythontex_utils.py``, which works with both Python 2 and Python 3.
546 * Added the ``beta`` package option. This makes the current version behave like v0.11beta, for compatibility. This option is temporary and will probably only be retained for a few releases.
547 * Backward-incompatible changes (require the ``beta`` option to restore old behavior)
548
549 - The ``pyverb`` environment has been renamed ``pyverbatim``. The old name was intended to be concise, but promoted confusion with LaTeX's ``\verb`` macro.
550 - For ``\printpythontex``, ``\stdoutpythontex``, and ``\stderrpythontex``, the modes ``inlineverb`` and ``v`` have been replaced by ``verb``, and the old mode ``verb`` has been replaced by ``verbatim``. This brings naming conventions in line with standard LaTeX ``\verb`` and ``verbatim``, avoiding a source of potential confusion.
551 - The ``\setpythontexpyglexer``, ``\setpythontexpygopt``, and ``\setpygmentspygopt`` commands now take an optional argument and a mandatory argument, rather than two mandatory arguments. This creates better uniformity among current and planned settings macros.
552 - The ``\setpythontexformatter`` and ``\setpygmentsformatter`` commands have been replaced by the ``\setpythontexprettyprinter`` and ``\setpygmentsprettyprinter`` commands. This anticipates possible upcoming features. It also avoids potential confusion with Pygments's formatters and the utilities class's ``formatter()`` method.
553
554 * Deprecated (still work, but raise warnings; after a few releases, they will raise errors instead, and after that eventually be removed)
555
556 - The ``rerun`` setting ``all`` was renamed ``always``, in preparation for upcoming features.
557 - The ``stderr`` option is replaced by ``makestderr``. The ``print``/``stdout`` option is replaced by ``debug``. These are intended to prevent confusion with future features.
558 - The ``fixlr`` option is deprecated. It was originally introduced to deal with some of SymPy's LaTeX formatting, which has since changed.
559 - The utilities class method ``init_sympy_latex()`` is deprecated. The ``sympy_latex()`` and ``set_sympy_latex()`` methods now automatically initialize themselves on first use.
560
561 * Added ``autostdout`` package option and ``\setpythontexautostdout``, to complement ``autoprint``. Added ``prettyprinter`` and ``prettyprintinline`` package options to complement new settings commands.
562 * Added quickstart guide.
563 * Installer now installs gallery and quickstart files, if present.
564
565
566 v0.11beta (2013/02/17)
567 ----------------------
568
569 * Commands like ``\py`` can now bring in any valid LaTeX code, including verbatim content, under the pdfTeX and XeTeX engines. Verbatim content was not allowed previously. LuaTeX cannot bring in verbatim, due to a known bug.
570 * Added package option ``depythontex`` and scripts ``depythontex*.py``. These allow a PythonTeX document to be converted into a pure LaTeX document, with no Python dependency. The package option creates an auxiliary file with extension ``.depytx``. The ``depythontex*.py`` scripts take this auxiliary file and the original LaTeX document, and combine the two to produce a new document that does not rely on the PythonTeX package. All PythonTeX commands and environments are replaced by their output. All Python-generated content is substituted directly into the document. By default, all typeset code is wrapped in ``\verb`` and ``verbatim``, but ``depythontex*.py`` has a ``--listing`` option that allows ``fancyvrb``, ``listings``, ``minted``, or ``pythontex`` to be used instead.
571 * The current PythonTeX version is now saved in the ``.pytxcode``. If this does not match the version of the PythonTeX scripts, a warning is issued. This makes it easier to determine errors due to version mismatches.
572 * Fixed an incompatibility with the latest release of ``xstring`` (version 1.7, 2013/01/13).
573 * Fixed a bug in the ``console`` environment that could cause problems when switching from Pygments highlighting to ``fancyvrb`` when using the ``fvextfile`` option. Fixed a bug introduced in the v0.10beta series that prevented the ``console`` environment from working with ``fancyvrb``.
574 * Fixed a bug with PythonTeX verbatim commands and environments that use Pygments. The verbatim commands and environments were incorrectly treated as if they had the attributes of executed code in the v0.10beta series.
575 * Fixed a bug from the v0.10beta series that sometimes prevented imports from ``__future__`` from working when there were multiple sessions.
576 * Fixed a bug related to hashing dependencies' mtime under Python 3.
577
578
579 v0.10beta2 (2013/01/23)
580 -----------------------
581
582 * Improved ``pythontex*.py``'s handling of the name of the file being processed. A warning is no longer raised if the name is given with an extension; extensions are now processed (stripped) automatically. The filename may now contain a path to the file, so you need not run ``pythontex*.py`` from within the document's directory.
583 * Added command-line option ``--verbose`` for more verbose output. Currently, this prints a list of all processes that are launched.
584 * Fixed a bug that could crash ``pythontex*.py`` when the package option ``pygments=false``.
585 * Added documentation about ``autoprint`` behavior in the preamble. Summary: ``code`` commands and environments are allowed in the preamble as of v0.10beta. ``autoprint`` only applies to the body of the document, because nothing can be typeset in the preamble. Content printed in the preamble can be brought in by explicitly using ``\printpythontex``, but this should be used with great care.
586 * Revised ``\stdoutpythontex`` and ``\printpythontex`` so that they work in the preamble. Again, this should be used with great care if at all.
587 * Revised treatment of any content that custom code attempts to print. Custom code is not allowed to print to the document (see documentation). If custom code attempts to print, a warning is raised, and the printed content is included in the ``pythontex*.py`` run summary.
588 * One-line entries in stderr, such as those produced by Python's ``warnings.warn()``, were not previously parsed because they are of the form ``:<linenumber>:`` rather than ``line <linenumber>``. These are now parsed and synchronized with the document. They are also correctly parsed for inclusion in the document via ``\stderrpythontex``.
589 * If the package option ``stderrfilename`` is changed, all sessions that produced errors or warnings are now re-executed automatically, so that their stderr content is properly updated with the new filename.
590
591
592 v0.10beta (2013/01/09)
593 ----------------------
594
595 * Backward-incompatible: Redid treatment of command-line options for
596 ``pythontex*.py``, using Python's ``argparse`` module. Run
597 ``pythontex*.py`` with option ``-h`` to see new command line options.
598 * Deprecated: ``\setpythontexcustomcode`` is deprecated in favor of the
599 ``\pythontexcustomc`` command and ``pythontexcustomcode``
600 environment. These allow entry of pure code, unlike
601 ``\setpythontexcustomcode``. These also allow custom code to be
602 added to the beginning or end of a session, via an optional argument.
603 Improved treatment of errors and warnings associated with custom
604 code.
605 * The summary of errors and warnings now correctly differentiates
606 errors and warnings produced by user code, rather than treating all
607 of them as errors. By default, ``pythontex*.py`` now returns an
608 exit code of 1 if there were errors.
609 * The PythonTeX utilities class now allows external file dependencies
610 to be specified via ``pytex.add_dependencies()``, so that sessions
611 are automatically re-executed when external dependencies are
612 modified (modification is determined via either hash or mtime; this
613 is governed by the new ``hashdependencies`` option).
614 * The PythonTeX utilities class now allows created files to be
615 specified via ``pytex.add_created()``, so that created files may be
616 automatically cleaned up (deleted) when the code that created them
617 is modified (for example, name change for a saved plot).
618 * Added the following package options.
619
620 - ``stdout`` (or ``print``): Allows input of stdout to be disabled.
621 Useful for debugging.
622 - ``runall``: Executes everything. Useful when code depends on
623 external data.
624 - ``rerun``: Determines when code is re-executed. Code may be set
625 to always run (same as ``runall`` option), or only run when it is
626 modified or when it produces errors or warnings. By default,
627 code is always re-executed if there are errors or modifications,
628 but not re-executed if there are warnings.
629 - ``hashdependencies``: Determines whether external dependencies
630 (data, external code files highlighted with Pygments, etc.) are
631 checked for modification via hashing or modification time.
632 Modification time is default for performance reasons.
633
634 * Added the following new command line options. The options that are
635 equivalent to package options are overridden by the package options
636 when present.
637
638 - ``--error-exit-code``: Determines whether an exit code of 1 is
639 returned if there were errors. On by default, but can be turned
640 off since it is undesirable when working with some editors.
641 - ``--runall``: Equivalent to new package option.
642 - ``--rerun``: Equivalent to new package option.
643 - ``--hashdependencies``: Equivalent to new package option.
644
645 * Modified the ``fixlr`` option, so that it only patches commands if
646 they have not already been patched (avoids package conflicts).
647 * Added ``\setpythontexautoprint`` command for toggling autoprint
648 on/off within the body of the document.
649 * Installer now attempts to create symlinks under OS X and Linux with
650 TeX Live, and under OS X with MacPorts Tex Live.
651 * Performed compatibility testing under lualatex and xelatex
652 (previously, had only tested with pdflatex). Added documentation
653 for using these TeX engines; at most, slightly different preambles
654 are needed. Modified the PythonTeX gallery to support all three
655 engines.
656 * Code commands and environments may now be used in the preamble.
657 This, combined with the new treatment of custom code, allows
658 PythonTeX to be used in creating LaTeX packages.
659 * Added documentation for using PythonTeX in LaTeX programming.
660 * Fixed a bug that sometimes caused incorrect line numbers with
661 ``stderr`` content. Improved processing of stderr.
662 * Fixed a bug in automatic detection of pre-existing listings
663 environment.
664 * Improved the detection of imports from ``__future__``. Detection
665 should now be stricter, faster, and more accurate.
666
667
668 v0.9beta3 (2012/07/17)
669 ----------------------
670
671 * Added Unicode support, which required the Python code to be split into
672 one set for Python 2 and another set for Python 3. This will require
673 any old installation to be completely removed, and a new installation
674 created from scratch.
675 * Refactoring of Python code. Documents should automatically re-execute
676 all code after updating to the new version. Otherwise, you should delete
677 the PythonTeX directory and run PythonTeX.
678 * Improved installation script.
679 * Added package options: ``pyfuture``, ``stderr``, ``upquote``,
680 ``pyglexer``, ``pyginline``. Renamed the ``pygextfile`` option to
681 ``fvextfile``.
682 * Added custom code and workingdir commands.
683 * Added the ``console`` environment and associated options.
684 * Rewrote ``pythontex_utils*.py``, creating a new, context-aware interface to
685 SymPy's LatexPrinter class.
686 * Content brought in via macros no longer uses labels. Rather, long defs
687 are used, which allows line breaks.
688 * Pygments highlighting is now default for PythonTeX commands and environments.
689
690
691 v0.9beta2 (2012/05/09)
692 ----------------------
693
694 * Changed Python output extension to ``.stdout``.
695
696
697 v0.9beta (2012/04/27)
698 ---------------------
699
700 * Initial public beta release.