Figs

Tags for figure environments.

class disseminate.tags.figs.BaseFigure(*args, **kwargs)

Bases: disseminate.tags.tag.Tag

A base class for a figure tag.

The BaseFigure initializes figures by adding ‘id’ attributes to labels in the label manager and reorganizing captions to the bottom of the figure.

html_fmt(attributes=None, method='html', **kwargs)

Convert the tag to an html string or html element.

Parameters
contentOptional[Union[str, List[Union[str, list, Tag]]]

Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.

attributesOptional[Union[str, Attributes]]

Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.

format_funcOptional[str]

The format function to use with by formatted_content when formatting sub-tags.

methodOptional[str]

The rendering method for the string. ex: ‘html’ or ‘xml’

levelOptional[int]

The level of the tag.

Returns
htmlstr or html element

A string in HTML format or an HTML element (lxml.builder.E).

class disseminate.tags.figs.Figure(*args, **kwargs)

Bases: disseminate.tags.figs.BaseFigure

The @figure/@fig tag

class disseminate.tags.figs.FullFigure(*args, **kwargs)

Bases: disseminate.tags.figs.BaseFigure

The @fullfigure/@ffig tag

class disseminate.tags.figs.MarginFigure(*args, **kwargs)

Bases: disseminate.tags.figs.BaseFigure

The @marginfig tag

xhtml_fmt(attributes=None, **kwargs)

Convert the tag to an xhtml string or html element.

Returns
xhtmlstr or xhtml element

A string in XHTML format or an XHTML element ( lxml.builder.E).

class disseminate.tags.figs.Panel(name, content, attributes, context)

Bases: disseminate.tags.tag.Tag

A panel (sub-figure) for a figure.

html_fmt(attributes=None, method='html', **kwargs)

Convert the tag to an html string or html element.

Parameters
contentOptional[Union[str, List[Union[str, list, Tag]]]

Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.

attributesOptional[Union[str, Attributes]]

Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.

format_funcOptional[str]

The format function to use with by formatted_content when formatting sub-tags.

methodOptional[str]

The rendering method for the string. ex: ‘html’ or ‘xml’

levelOptional[int]

The level of the tag.

Returns
htmlstr or html element

A string in HTML format or an HTML element (lxml.builder.E).

tex_fmt(attributes=None, **kwargs)

Format the tag in LaTeX format.

Parameters
contentOptional[Union[str, List[Union[str, list, Tag]]]

Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.

attributesOptional[Union[str, Attributes]]

Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.

mathmodeOptional[bool]

If True, the tag will be rendered in math mode. Otherwise (default) latex text mode is assumed.

levelOptional[int]

The level of the tag.

Returns
tex_stringstr

The formatted tex string.