pylatex.math

This module implements the classes that deal with math.

class Alignat(aligns=2, numbering=True, escape=None)[source]

Bases: pylatex.base_classes.containers.Environment

Class that represents a aligned equation environment.

Parameters:
  • aligns (int) – number of alignments
  • numbering (bool) – Whether to number equations
  • escape (bool) – if True, will escape strings
omit_if_empty = True[source]

Alignat environment cause compile errors when they do not contain items. This is why it is omitted fully if they are empty.

class Math(*, inline=False, data=None, escape=None)[source]

Bases: pylatex.base_classes.containers.Container

A class representing a math environment.

Parameters:
  • data (list) – Content of the math container.
  • inline (bool) – If the math should be displayed inline or not.
  • escape (bool) – if True, will escape strings
class VectorName(name)[source]

Bases: pylatex.base_classes.command.Command

A class representing a named vector.

Parameters:name (str) – Name of the vector
class Matrix(matrix, *, mtype='p', alignment=None)[source]

Bases: pylatex.base_classes.containers.Environment

A class representing a matrix.

Parameters:
  • matrix (numpy.ndarray instance) – The matrix to display
  • mtype (str) – What kind of brackets are used around the matrix. The different options and their corresponding brackets are: p = ( ), b = [ ], B = { }, v = | |, V = || ||
  • alignment (str) – How to align the content of the cells in the matrix. This is c by default.

References

omit_if_empty = False