module sphinxext.sphinx_latex_builder

Inheritance diagram of pyquickhelper.sphinxext.sphinx_latex_builder

Short summary

module pyquickhelper.sphinxext.sphinx_latex_builder

Overwrites latex writer as Sphinx’s version is bugged in version 1.8.0.

Classes

class

truncated documentation

CustomizedSphinxFileOutput

Customized FileOutput class for Sphinx.

EnhancedLaTeXBuilder

Overwrites LaTeXBuilder.

EnhancedLaTeXTranslator

Overwrites LaTeXTranslator and modifies …

EnhancedLaTeXWriter

Overwrites LatexWriter.

Functions

function

truncated documentation

setup

Initializes builder EnhancedLaTeXBuilder.

Properties

property

truncated documentation

bibitems

footnotestack

hlsettingstack

in_container_literal_block

next_hyperlink_ids

next_section_ids

Methods

method

truncated documentation

__init__

__init__

Constructor, add a logger.

__init__

__init__

_get_filename

add_text

depart_inheritance_diagram

depart_only

eval_expr

finish

get_outfilename

Overwrites get_target_uri to control file names.

latex_image_length

translate

unknown_visit

visit_document

visit_enumerated_list

visit_inheritance_diagram

visit_only

write

write

Documentation

Overwrites latex writer as Sphinx’s version is bugged in version 1.8.0.

New in version 1.8.

source on GitHub

class pyquickhelper.sphinxext.sphinx_latex_builder.CustomizedSphinxFileOutput(**kwargs)[source][source]

Bases: sphinx.util.docutils.SphinxFileOutput

Customized FileOutput class for Sphinx.

source on GitHub

__init__(**kwargs)[source][source]
Parameters

  • destination: either a file-like object (which is written directly) or None (which implies sys.stdout if no destination_path given).

  • destination_path: a path to a file, which is opened and then written.

  • encoding: the text encoding of the output file.

  • error_handler: the encoding error handler to use.

  • autoclose: close automatically after write (except when sys.stdout or sys.stderr is the destination).

  • handle_io_errors: ignored, deprecated, will be removed.

  • mode: how the file is to be opened (see standard function open). The default is ‘w’, providing universal newline support for text files.

write(data)[source][source]

Encode data, write it to a single file, and return it.

With Python 3 or binary output mode, data is returned unchanged, except when specified encoding and output encoding differ.

class pyquickhelper.sphinxext.sphinx_latex_builder.EnhancedLaTeXBuilder(*args, **kwargs)[source][source]

Bases: sphinx.builders.latex.LaTeXBuilder

Overwrites LaTeXBuilder.

source on GitHub

Constructor, add a logger.

source on GitHub

__init__(*args, **kwargs)[source][source]

Constructor, add a logger.

source on GitHub

_get_filename(targetname, encoding='utf-8', overwrite_if_changed=True)[source][source]
default_translator_class[source]

alias of EnhancedLaTeXTranslator

depart_autosignature_node(node)[source]

What to do when leaving a node autosignature_node.

source on GitHub

depart_bigger_node(node)[source]

depart bigger_node for latex

source on GitHub

depart_blocref_node(node)[source]

depart_blocref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

depart_blocreflist(node)[source]

depart_blocref_node

source on GitHub

depart_blogpost_node(node)[source]

what to do when leaving a node blogpost the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

depart_blogpostagg_node(node)[source]

what to do when leaving a node blogpost, the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

depart_cmdref_node(node)[source]

depart_cmdref_node, see sphinx/writers/html.py.

source on GitHub

depart_cmdreflist(node)[source]

depart_cmdref_node

source on GitHub

depart_collapse_node(node)[source]

depart collapse_node

source on GitHub

Does notthing.

source on GitHub

depart_epkg_node(node)[source]

What to do when leaving a node epkg.

source on GitHub

depart_exref_node(node)[source]

depart_exref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

depart_exreflist(node)[source]

depart_exref_node

source on GitHub

depart_faqref_node(node)[source]

depart_faqref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

depart_faqreflist(node)[source]

depart_faqref_node

source on GitHub

depart_gitlog_node(node)[source]

depart gitlog_node for latex

source on GitHub

depart_mathdef_node(node)[source]

depart_mathdef_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

depart_mathdeflist(node)[source]

depart_mathdef_node

source on GitHub

depart_nbref_node(node)[source]

depart_nbref_node, see sphinx/writers/html.py.

source on GitHub

depart_nbreflist(node)[source]

depart_nbref_node

source on GitHub

depart_postcontents_node(node)[source]

does nothing

source on GitHub

depart_quote_node(node)[source]

depart_quote_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

depart_runpython_node(node)[source]

What to do when leaving a node runpython_node the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

depart_sharenet_node(node)[source]

what to do when leaving a node sharenet the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

It does only html for the time being.

source on GitHub

depart_simpleimage_node(node)[source]

What to do when leaving a node image the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

depart_tocdelay_node(node)[source]

does nothing

source on GitHub

depart_todoext_node(node)[source]

depart_todoext_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

depart_todoextlist(node)[source]

depart_todoext_node

source on GitHub

depart_tpl_node(node)[source]

What to do when leaving a node tpl.

source on GitHub

depart_video_node(node)[source]

What to do when leaving a node video the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

depart_youtube_node(node)[source]

Youtube node.

source on GitHub

finish()[source][source]

Finish the building process.

The default implementation does nothing.

get_outfilename(pagename)[source][source]

Overwrites get_target_uri to control file names.

source on GitHub

visit_autosignature_node(node)[source]

What to do when visiting a node autosignature_node.

source on GitHub

visit_bigger_node(node)[source]

what to do when visiting a node bigger the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

visit_blocref_node(node)[source]

source on GitHub

visit_blocreflist(node)[source]

visit_blocreflist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

visit_blogpost_node(node)[source]

what to do when visiting a node blogpost the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

visit_blogpostagg_node(node)[source]

what to do when visiting a node blogpost the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

visit_cmdref_node(node)[source]

source on GitHub

visit_cmdreflist(node)[source]

visit_cmdreflist_node see sphinx/writers/html.py.

source on GitHub

visit_collapse_node(node)[source]

visit collapse_node

source on GitHub

Does notthing.

source on GitHub

visit_epkg_node(node)[source]

What to do when visiting a node epkg.

source on GitHub

visit_exref_node(node)[source]

source on GitHub

visit_exreflist(node)[source]

visit_exreflist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

visit_faqref_node(node)[source]

source on GitHub

visit_faqreflist(node)[source]

visit_faqreflist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

visit_gitlog_node(node)[source]

what to do when visiting a node gitlog the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

visit_mathdef_node(node)[source]

source on GitHub

visit_mathdeflist(node)[source]

visit_mathdeflist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

visit_nbref_node(node)[source]

source on GitHub

visit_nbreflist(node)[source]

visit_nbreflist_node, see sphinx/writers/html.py.

source on GitHub

visit_postcontents_node(node)[source]

does nothing

source on GitHub

visit_quote_node(node)[source]

source on GitHub

visit_runpython_node(node)[source]

What to do when visiting a node runpython_node the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

visit_sharenet_node(node)[source]

what to do when visiting a node sharenet the function should have different behaviour, depending on the format, or the setup should specify a different function for each.

source on GitHub

visit_simpleimage_node(node)[source]

Visits a image node. Copies the image.

source on GitHub

visit_tocdelay_node(node)[source]

does nothing

source on GitHub

visit_todoext_node(node)[source]

source on GitHub

visit_todoextlist(node)[source]

visit_todoextlist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

visit_tpl_node(node)[source]

What to do when visiting a node tpl.

source on GitHub

visit_video_node(node)[source]

Visits a video node. Copies the video.

source on GitHub

visit_youtube_node(node)[source]

Visit youtube node (html).

source on GitHub

class pyquickhelper.sphinxext.sphinx_latex_builder.EnhancedLaTeXTranslator(builder, document)[source][source]

Bases: sphinx.writers.latex.LaTeXTranslator

Overwrites LaTeXTranslator and modifies a few functions.

source on GitHub

__init__(builder, document)[source][source]

Initialize self. See help(type(self)) for accurate signature.

unknown_visit(node)[source][source]

Called when entering unknown Node types.

Raise an exception unless overridden.

class pyquickhelper.sphinxext.sphinx_latex_builder.EnhancedLaTeXWriter(builder)[source][source]

Bases: sphinx.writers.latex.LaTeXWriter

Overwrites LatexWriter.

source on GitHub

__init__(builder)[source][source]

Initialize self. See help(type(self)) for accurate signature.

translate()[source][source]

Do final translation of self.document into self.output. Called from write. Override in subclasses.

Usually done with a docutils.nodes.NodeVisitor subclass, in combination with a call to docutils.nodes.Node.walk() or docutils.nodes.Node.walkabout(). The NodeVisitor subclass must support all standard elements (listed in docutils.nodes.node_class_names) and possibly non-standard elements used by the current Reader as well.

translator_class[source]

alias of EnhancedLaTeXTranslator

pyquickhelper.sphinxext.sphinx_latex_builder.setup(app)[source][source]

Initializes builder EnhancedLaTeXBuilder.

source on GitHub