pylatex.headfoot

This module implements the classes that deal with creating headers and footers.

class PageStyle(name, *, header_thickness=0, footer_thickness=0, data=None)[source]

Bases: pylatex.base_classes.containers.ContainerCommand

Allows the creation of new page styles.

Parameters:
  • name (str) – The name of the page style
  • header_thickness (float) – Value to set for the line under the header
  • footer_thickness (float) – Value to set for the line over the footer
  • data (str or LatexObject) – The data to place inside the PageStyle
change_thickness(element, thickness)[source]

Change line thickness.

Changes the thickness of the line under/over the header/footer to the specified thickness.

Parameters:
  • element (str) – the name of the element to change thickness for: header, footer
  • thickness (float) – the thickness to set the line to
omit_if_empty = False
simple_page_number()[source]

Get a string containing commands to display the page number.

Returns:The latex string that displays the page number
Return type:str
class Head(position=None, *, data=None)[source]

Bases: pylatex.base_classes.containers.ContainerCommand

Allows the creation of headers.

Parameters:
  • position (str) – the headers position: L, C, R
  • data (str or LatexObject) – The data to place inside the Head element
omit_if_empty = False
class Foot(position=None, *, data=None)[source]

Bases: pylatex.headfoot.Head

Allows the creation of footers.

Parameters:
  • position (str) – the headers position: L, C, R
  • data (str or LatexObject) – The data to place inside the Head element
omit_if_empty = False