pyexlatex.layouts package

Submodules

pyexlatex.layouts.base module

class pyexlatex.layouts.base.LayoutBase(content, **kwargs)[source]

Bases: pyexlatex.models.section.base.TextAreaMixin, pyexlatex.models.item.ItemBase

__init__(content, **kwargs)[source]
content: Any = None

pyexlatex.layouts.grid module

class pyexlatex.layouts.grid.CellLayout(content, grid_shape, **kwargs)[source]

Bases: pyexlatex.layouts.base.LayoutBase

Lay content out in a grid where each cell is arbitrarily sized

__init__(content, grid_shape, **kwargs)[source]
Args:

content: grid_shape: list of list of tuples of (width, height), e.g. [

[(0.3, 0.4), (0.7, 0.4)], [(0.3, 0.6), (0.7, 0.6)],

] would create a 2x2 grid with 40% of height in the first row, 60% in the second row. 30% width in the first column, 70% width in the second column.

**kwargs:

class pyexlatex.layouts.grid.GridLayout(content, **kwargs)[source]

Bases: pyexlatex.layouts.grid.CellLayout

Evenly spaced grid layout.

Creates a CellLayout, automatically setting widths and heights as an even split based on the shape of the content passed to make a grid

__init__(content, **kwargs)[source]
Args:

content: grid_shape: list of list of tuples of (width, height), e.g. [

[(0.3, 0.4), (0.7, 0.4)], [(0.3, 0.6), (0.7, 0.6)],

] would create a 2x2 grid with 40% of height in the first row, 60% in the second row. 30% width in the first column, 70% width in the second column.

**kwargs:

pyexlatex.layouts.multicol module

class pyexlatex.layouts.multicol.MultiCol(content, **kwargs)[source]

Bases: pyexlatex.layouts.base.LayoutBase

Multi-column layout that does not make any constraints on vertical sizing.

__init__(content, **kwargs)[source]
property column_width: float
Return type

float

pyexlatex.layouts.spaced module

class pyexlatex.layouts.spaced.HorizontallySpaced(content, pad_ends=False)[source]

Bases: pyexlatex.layouts.spaced.SpacedBase

Inserts horiztonal spacing between items until they fill the content area

__init__(content, pad_ends=False)[source]
Parameters
  • content

  • pad_ends (bool) – whether to add spacing outside the content as well

class pyexlatex.layouts.spaced.SpacedBase(content, vertically_space, pad_ends)[source]

Bases: pyexlatex.models.template.Template

Base class for VerticallySpaced and HorizontallySpaced. Handles the logic of adding VFill and HFill between and around items.

__init__(content, vertically_space, pad_ends)[source]
property spacer: Union[pyexlatex.models.format.fills.VFill, pyexlatex.models.format.fills.HFill]
Return type

Union[VFill, HFill]

class pyexlatex.layouts.spaced.VerticallySpaced(content, pad_ends=False)[source]

Bases: pyexlatex.layouts.spaced.SpacedBase

Inserts vertical spacing between items until they fill the content area

__init__(content, pad_ends=False)[source]
Parameters
  • content

  • pad_ends (bool) – whether to add spacing outside the content as well