Exemple #1
0
def visit_desc(translator: LaTeXTranslator, node: addnodes.desc) -> None:
    """
	Visit an :class:`addnodes.desc` node and add a custom table of contents label for the item, if required.

	:param translator:
	:param node:
	"""

    if node["domain"] == "py":
        translator.body.append(r"\needspace{5\baselineskip}")

    if "sphinxcontrib.toctree_plus" in translator.config.extensions:
        # 3rd party
        from sphinxcontrib import toctree_plus  # nodep

        toctree_plus.visit_desc(translator, node)
    else:
        LaTeXTranslator.visit_desc(translator, node)
def visit_desc(translator: LaTeXTranslator, node: addnodes.desc) -> None:
    translator.body.append('\n\n\\vspace{5px}')
    LaTeXTranslator.visit_desc(translator, node)