Change Log¶
All notable changes to this project will be documented on this page. This project adheres to Semantic Versioning.
Unreleased - docs¶
See these docs for changes that have not yet been released and are only present in the development version. This version might not be stable, but to install it use:
pip install git+https://github.com/JelteF/PyLaTeX.git
1.4.2 - docs - 2023-10-19¶
Fixed¶
- Fix installation on Python 3.12
Cleanup¶
- Update tooling (use black and isort and remove custom flake8 stuff)
1.4.1 - docs - 2020-10-18¶
Fixed¶
- Fixes filename generation with dots in the final filename on Windows.
- Fixes regression in 1.4.0 where empty
geometry_optionswould throw an error.
1.4.0 - docs - 2020-09-16¶
Added¶
- Add
Fragmentclass which is aContainerwithout any LaTeX code surrounding its content.
Fixed¶
- Escape newlines in
ContainerCommand - Fix bug where the geometry options were not applied in some cases
1.3.4 - docs - 2020-07-29¶
Fixed¶
- Use known working versions for Python 3.5 and lower of ordered-set dependency
1.3.3 - docs - 2020-06-20¶
Fixed¶
- The ‘at’ parameter for TikZNode should now work.
- Use a different temporary directory per user.
1.3.2 - docs - 2020-05-16¶
Fixed¶
- On python 3.6+ support multhreaded use of PyLaTeX, by not calling
os.chdir
1.3.0 - docs - 2017-05-19¶
Added¶
- Longtables now have end_foot() and end_last_foot() functions.
- Added TikZ basic drawing functions for nodes and paths, with minimal coordinate support.
- More section levels
Part,Chapter,Paragraph,Subparagraph. - Add label and cross reference support.
Changed¶
- More descriptive error when no compatible LaTeX compiler was found.
1.2.1 - docs - 2017-05-19¶
Fixed¶
- Filenames with a
~(tilde) in them now also work as figure paths. This caused issues when using temp directories on Windows.
1.2.0 - docs - 2017-05-06¶
Added¶
- Escape flag to
Mathcontainer _star_latex_nameattribute ofLatexObjectto append a starAlignatmath environmentFigure.add_plotmethod looks for extension in kwargsTabuandLongTabuenvironments learn ‘spread’ and ‘to’ syntax to control their width.
Fixed¶
- Escape
[and](left and right bracket). - Allow mappers of
dumps_listto return aLatexObject. - Section numbering default behaviour fixed
- Setter method for
escapeproperty added
1.1.1 - docs - 2016-12-10¶
Changed¶
- Installs from git now get installed as a special version based on the commit. This is done by using versioneer.
- Releases can be done with much less manual work for the maintainer in the future.
Fixed¶
- Install now works on python 3.6+
- Pypi installs will not fail anymore for python 2.7, when
3to2andfuturewere installed.
1.1.0 - docs - 2016-12-09¶
Changed¶
- Allow overriding of the default numbering of
Sectionclass. Parametersnow unpacks a dict as keyword arguments when passed a single dictionary as argument.- Escape generated
\ncharacters by PyLaTeX by placing a%sign in front of them. - For better readability let
escape_latexchange a newline to\\%\ninstead of simply\\. Documentpackages now get propagated from the preamble elements as well.- Changed
Figure.add_imageto add aStandAloneGraphic Tabular.add_rownow accepts a list of mappersTabular.add_rownow accepts cells as arguments, so they don’t have to be wrapped in alistortupleanymore.- Changed from using
$$ ... $$for displaymath to using\[ ... \].
Added¶
- Add the
textcomppackage by default. This way some special glyphs, like the Euro (€) Symbol can be used in the source. Quantitygot a newoptionskeyword argument and learned to handle uncertain quantities.- Added
PageStyleclass to support the creation of various page styles. In addition to this classHeadandFootwere added for creating unique headers and footers within the page styles. Asimple_page_numberfunction was also added for easy displaying of a simple page number. - Added a new type of container
ContainerCommandfor supporting commands with data. - Added new options to the
Documentconstructor:geometry_options(a list of options for the geometry package),document_options(a list of options to place in the document class),indent(an option to select whether the documents elements are indented),page_numbers(an option to choose whether to use page numbers or not),font_size(the font size to set at the beggining of the document). - Added several new methods to the
Document:change_page_style,change_document_style,add_color,change_length,set_variable. - Added a new
positionpackage with the following classes:Center(an environment with centered content),FlushLeft(an environment with left aligned content),FlushRight(an environment with right aligned content),MiniPage(a portion of the document with a certain width and height),TextBlock(a portion of the document for which the position can be selected using x,y coordinates),VerticalSpaceandHorizontalSpace(add space of a certain size by using vspace and hspace) - Added
StandAloneGraphicto support the creation of images outside of figure environments. - Added the ability to change the
row_heightof a table within theTabularconstructor. - Added a new type of table
Tabularx. - Added the option to select a color when adding an hline or adding a row to
any
Tabularenvironment. - Added the ability to add your own column types through the
ColumnTypeclass. - Added the ability to end the header of a
LongTablewhich repeats on every consecutive page. - Added the ability to choose the enumeration symbol in a list using the
enumeration_symbolkeyword argument ofEnumerate. - Added a
pylatex.basicmodule with the following commands:NewLine,NewPage,LineBreak,HFill. - Added several environments to
pylatex.basic:HugeText,LargeText,MediumText,SmallText,FootnoteText,TextColor. Tabularcan now have a width specified to override the calculated width based on thetable_specargument.- Default configuration for certain options can be overwritten with the new
pylatex.configmodule. - Add support for booktabs tables, which look nicer than normal tables.
- Add support for the microtype package.
1.0.0 - docs - 2015-11-25¶
This realease brings some great changes. The whole package has been refactored and actual documentation has been added. Because of this, things have been moved an renamed. One of the most notable changes is that all normal text is now escaped by default.
Changed¶
- The base_classes submodule has been split into multiple sub-submodules.
- The old baseclasses have been renamed as well. They now have easier names that better show their purpose.
- The command and parameters submodules have been merged into one command submodule in the base_classes submodule.
- The numpy classes have been moved to the math submodule.
- For all of the previous changes the old submodules and names should still work during the transition period, but they will be removed before the final release.
- The
Pltclass has been merged with theFigureclass. Itsadd_plotmethod also doesn’t take a plt argument anymore. The plt module is now imported when theadd_plotmethod is used. This also allows for adding plots in theSubFigureclass. - Compiling is more secure now and it doesn’t show output unless an error occurs or explicitly specified.
- The internal method
propegate_packageshas been spelled correctly and made “internal” by adding an underscore in front of the name, resulting in_propagate_packages - The default allignment of a multicolumn is not
cinstead of|c|, since vertical lines in tables are ugly most of the time. - Make the list method of
Parametersa private method. - Make the
get_table_widthfunction private. - Make
widthandplacementkeyword only arguments for theadd_plotmethod. - The old
Tableclass is renamed toTabular. A newTableclass has been created that represents thetableLaTeX environment, which can be used to create a floating table. - Fixed a bug in the
Documentclass, that lead to an error if a filepath without basename was provided. - Fixed the testall.sh script such that sphinx and nosetests get called with the correct python version.
- The graphics submodule has been renamed to figure.
- The pgfplots submodule has been renamed to tikz.
- Rename the
seperate_paragraphkeyword argument to the correctly spelledseparate_paragraph. - The
container_nameattribute has been changed tolatex_nameso it can be used more than containers. By default it is still the lowercase version of the classname. To change the default for a class you should set_latex_name - Made
Document.select_filepathprivate. Containernow has adumps_contentmethod, which dumps it content instead of a dumps method. This allows to override just that method when subclassingEnvironmentso you can do dump in some special inside the environment, while still keeping the\beginand\endstuff provided byEnvironment.- When subclassing a class and special LaTeX packages are needed, you now have
to specify the packages class attribute instead of passing packages along
with the
__init__method. - Content of subclasses of
Containeris now automatically escaped. Content ofArgumentsorOptionsis not escaped by default. - Made
separate_paragraph,begin_paragraphandend_paragraphclass attributes instead of instance attributes. - The default of the
filepathargument for theDocument.generate_pdfandDocument.generate_texhave been changed toNone. The response to the default is not changed, so this is a fairly invisible change. - Moved
separate_paragraph,begin_paragraphandend_paragraphattributes toLatexObject. - Use
latexmkto compile to pdf when available, otherwise fallback topdflatex. - Change the order of arguments of the
Axisconstructor. - Tables like
Tabularnow raise an exception when rows with wrong size are added - Made lots of keyword arguments keyword only arguments. This was needed to make it easy to keep the API the same in the future.
- Removed the submodules
pylatex.parameters,pylatex.commandandpylatex.numpy. The content of the first two was moved topylatex.base_classes.commandand the content of the last one was moved topylatex.math.
Removed¶
- The add
add_multicolumnandadd_multirowmethods on tabular classes are removed in favor of the much more robust and easier to useMultiRowandMultiColumnclasses. - Removed unused
nameargument of theMatrixclass. - Removed base keyword argument of the
Packageclass.Commandshould be used when changing of the base is needed. - Removed the
title,author,dateandmaketitlearguments from theDocumentconstructor. They were from a time when it was not possible to change the preamble, which is now very easy. They are not so commonly used that they should be part of the mainDocumentobject. - Removed useless list class constructor arguments for list_spec and pos. These
were probably copied from the
Tabularclass.
Added¶
- Lots of documentation!!!!!
- A float environment base class.
- An unfinished Quantity class that can be used in conjunction with the quantitities package. https://pythonhosted.org/quantities/
- Allow supplying a mapper function to dumps_list and the add_row method for tabular like objects.
- An
extra_argumentsargument toCommand. See docs for description. - Add
CommandBase, which can be easily subclassed for a command that is used more than once. - Add
NoEscapestring class, which can be used to make sure a raw LaTeX string is not escaped. - A
__repr__method, so printing LaTeX objects gives more useful information now.
0.8.0 - 2015-05-23¶
Added¶
- List classes (enumerate, itemize, description)
- Arguments for plt.savefig
- SubFigure class for use with subcaption package
- Command line argument for ./testall.sh to supply a custom python command
- The generate_tex method is now usable in every class, this makes making snippets even easier.
- MultiColumn and MultiRow classes for generalized table layouts.
Changed¶
- BaseLaTeXNamedContainer now uses the name of the class as the default container_name
- The
Tableobject is going to be deprecated in favor of the better namedTabularobject. This will take a couple of releases. - Allow the data keyword argument of containers to be a single item instead of a list. If this is the case it will be wrapped in a list on initialization.
Fixed¶
- Propagate packages recursively add packages of sub containers
- Make cleanup of files Windows compatible
- Filenames can be paths (
foo/bar/my_pdf). - Replace
filenamebyfilepathin the names of the arguments. - Matplotlib support now uses the tmpfile module, this fixes permission issues with the badly previously badly located tmp directory.
- The temp directory is only removed in generate_pdf when cleaning is enabled
0.7.1 - 2015-03-21¶
Added¶
- Contributing guidelines.
Changed¶
- The non keyword argument for filename is now called path instead of filename to show it can also be used with paths.
- Travis now checks for Flake8 errors.
Fixed¶
- Fix a bug in Plt and one in fix_filename that caused an error when using them with some filenames (dots in directories and a file without an extension)
0.7.0 - 2015-03-17¶
Added¶
- Matplotlib support
- Quite a bit of basic docstrings
Changed¶
- Filenames should now be specified to the
generate_pdf/generate_texmethods of document. If this is not done thedefault_filenameattribute will be used.
Fixed¶
- Fix a lot of bugs in the
escape_latexfunction