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
Changed¶
- Allow overriding of the default numbering of
Sectionclass. Parametersnow unpacks a dict as keyword arguments when passed a single dictionary as argument.
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.
Fixed¶
- Setting the
lmodernkeyword argument ofDocumentto false will not cause invalid LaTeX code anymore.
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)