pyexlatex.models.format package

Subpackages

Submodules

pyexlatex.models.format.adjustbox module

class pyexlatex.models.format.adjustbox.AdjustBox(contents, adjust_options)[source]

Bases: pyexlatex.models.section.base.TextAreaBase

__init__(contents, adjust_options)[source]
name = 'adjustbox'
property options_str: str
Return type

str

pyexlatex.models.format.breaks module

class pyexlatex.models.format.breaks.Break[source]

Bases: pyexlatex.models.mixins.StringAdditionMixin

class pyexlatex.models.format.breaks.LineBreak[source]

Bases: pyexlatex.models.format.breaks.Break

__init__()[source]
class pyexlatex.models.format.breaks.OutputLineBreak(size_adjustment=None)[source]

Bases: pyexlatex.models.format.breaks.Break, mixins.repr.ReprMixin

Create an intentional line break in text

__init__(size_adjustment=None)[source]
repr_cols: List[str] = ['size_adjustment']
class pyexlatex.models.format.breaks.TableLineBreak(size_adjustment=None)[source]

Bases: pyexlatex.models.format.breaks.Break, mixins.repr.ReprMixin

A line break character to be used in LaTeX tables

__init__(size_adjustment=None)[source]
repr_cols: List[str] = ['size_adjustment']

pyexlatex.models.format.captionsetup module

class pyexlatex.models.format.captionsetup.CaptionSetup(target='figure', relative_sizes=None, options=None)[source]

Bases: pyexlatex.models.item.SimpleItem

Control formatting of captions for tables and figures

__init__(target='figure', relative_sizes=None, options=None)[source]
name = 'captionsetup'

pyexlatex.models.format.centering module

class pyexlatex.models.format.centering.Center(content, **kwargs)[source]

Bases: pyexlatex.models.section.base.TextAreaBase

Align the passed contents to the center of the container

__init__(content, **kwargs)[source]
name = 'center'
class pyexlatex.models.format.centering.Centering(overlay=None)[source]

Bases: pyexlatex.models.item.NoOptionsNoContentsItem

__init__(overlay=None)[source]
name = 'centering'

pyexlatex.models.format.fills module

class pyexlatex.models.format.fills.HFill[source]

Bases: pyexlatex.models.item.NoOptionsNoContentsItem

Horizontal fill, put between items to put horizontal spacing between them.

__init__()[source]
name = 'hfill'
class pyexlatex.models.format.fills.VFill[source]

Bases: pyexlatex.models.item.NoOptionsNoContentsItem

Vertical fill, put between items to put vertical spacing between them.

__init__()[source]
name = 'vfill'

pyexlatex.models.format.hangindent module

class pyexlatex.models.format.hangindent.HangIndent(hang_by=1)[source]

Bases: pyexlatex.models.item.EqualsItem

__init__(hang_by=1)[source]
name = 'hangindent'

pyexlatex.models.format.hline module

class pyexlatex.models.format.hline.HLine(thickness=0.4)[source]

Bases: pyexlatex.models.format.rule.Rule

Draws a horizontal line across the text width.

__init__(thickness=0.4)[source]

pyexlatex.models.format.hspace module

class pyexlatex.models.format.hspace.HSpace(height=0.5, units='cm')[source]

Bases: pyexlatex.models.item.SimpleItem

Manually insert horizontal spacing, of a given length.

__init__(height=0.5, units='cm')[source]
name = 'hspace'

pyexlatex.models.format.join module

class pyexlatex.models.format.join.Joined(contents, join_with='')[source]

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

Applies string.join on contents when output string is created, but retains content objects.

__init__(contents, join_with='')[source]

pyexlatex.models.format.noindent module

class pyexlatex.models.format.noindent.NoIndent(contents, **kwargs)[source]

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

Do not have an indent for the current paragraph

__init__(contents, **kwargs)[source]
name = 'noindent'

pyexlatex.models.format.nolinebreak module

class pyexlatex.models.format.nolinebreak.NoLineBreak(contents, alternative='ragged')[source]

Bases: pyexlatex.models.template.Template

Prevents a line break within text, where a hyphen would normally be placed.

Notes:

Using this will have side effects to the entire paragraph, depending on the alternative chosen. See the docstring for alternative.

__init__(contents, alternative='ragged')[source]
Parameters
  • contents

  • alternative (str) – ‘ragged’ or ‘sloppy’. As the word won’t be broken, there must be some alternative. Passing ‘ragged’ will make all the other words on the first line stay in the same position, so that a gap will appear at the end of the line where the NoLineBreak word would have started originally. Passing ‘sloppy’ will make it so that the first line’s words spacing gets stretched so that there is still right alignment on that line, despite the NoLineBreak word being moved to the next line. Note: This will affect the entire paragraph, not just the NoLineBreak word.

name = 'nohyphens'

pyexlatex.models.format.nopagebreak module

class pyexlatex.models.format.nopagebreak.NoPageBreak(contents, **kwargs)[source]

Bases: pyexlatex.models.environmenttemplate.EnvironmentTemplate

Contents within this environment will not have a page break come in the middle. Contents will instead be moved onto the next page if a break would have occurred.

begin_def = '\\par\\nobreak\\vfil\\penalty0\\vfilneg\\vtop\\bgroup'
end_def = '\\par\\xdef\\tpd{\\the\\prevdepth}\\egroup\\prevdepth=\\tpd'
name = 'absolutelynopagebreak'

pyexlatex.models.format.paragraphindent module

class pyexlatex.models.format.paragraphindent.ParagraphIndent(contents, left_adjust=1, right_adjust=0)[source]

Bases: pyexlatex.models.section.base.TextAreaBase, pyexlatex.models.item.Item

Used for setting paragraph indents, from the left or right.

__init__(contents, left_adjust=1, right_adjust=0)[source]
name = 'adjustwidth'
property options_str: str
Return type

str

pyexlatex.models.format.raw module

class pyexlatex.models.format.raw.Raw(contents)[source]

Bases: pyexlatex.models.mixins.IsSpecificClassMixin, pyexlatex.models.item.IsLatexItemMixin, mixins.attrequals.EqOnAttrsMixin

Don’t replace latex characters in this blocks such as or %, useful for adding latex commands or comments manually.

__init__(contents)[source]
equal_attrs = ('contents',)

pyexlatex.models.format.rule module

class pyexlatex.models.format.rule.Rule(length=2, thickness=0.4)[source]

Bases: pyexlatex.models.item.MultiOptionSimpleItem

Draw a horizontal line of given length and thickness

__init__(length=2, thickness=0.4)[source]
property length_str
name = 'rule'
property thickness_str

pyexlatex.models.format.sectionnum module

class pyexlatex.models.format.sectionnum.SectionNumberingFormatter(section_type, section_format)[source]

Bases: pyexlatex.models.commands.renewcommand.ReNewCommand

applies formatting for section numbers

__init__(section_type, section_format)[source]
classmethod list_from_string_format_dict(string_format_dict)[source]
Args:
string_format_dict: e.g. dict(

section=r’Roman{section}’, subsection=r’Alph{subsection}’

)

Returns:

Return type

List[SectionNumberingFormatter]

pyexlatex.models.format.vspace module

class pyexlatex.models.format.vspace.VSpace(height=0.5, units='cm')[source]

Bases: pyexlatex.models.item.SimpleItem

Manually insert vertical spacing, of a given height.

__init__(height=0.5, units='cm')[source]
name = 'vspace'