"""
This type stub file was generated by pyright.
"""

from typing import Any, TYPE_CHECKING
from docutils import nodes, writers
from sphinx.errors import SphinxError
from sphinx.util.docutils import SphinxTranslator
from docutils.nodes import Element, Text
from sphinx.builders.latex import LaTeXBuilder
from sphinx.builders.latex.theming import Theme

"""Custom docutils writer for LaTeX.

Much of this code is adapted from Dave Kuhlman's "docpy" writer from his
docutils sandbox.
"""
if TYPE_CHECKING:
    ...
logger = ...
MAX_CITATION_LABEL_LENGTH = ...
LATEXSECTIONNAMES = ...
ENUMERATE_LIST_STYLE = ...
CR = ...
BLANKLINE = ...
EXTRA_RE = ...
class collected_footnote(nodes.footnote):
    """Footnotes that are collected are assigned this class."""
    ...


class UnsupportedError(SphinxError):
    category = ...


class LaTeXWriter(writers.Writer):
    supported = ...
    settings_spec = ...
    settings_defaults: dict[str, Any] = ...
    theme: Theme
    def __init__(self, builder: LaTeXBuilder) -> None:
        ...
    
    def translate(self) -> None:
        ...
    


class Table:
    """A table data"""
    def __init__(self, node: Element) -> None:
        ...
    
    def is_longtable(self) -> bool:
        """True if and only if table uses longtable environment."""
        ...
    
    def get_table_type(self) -> str:
        """Returns the LaTeX environment name for the table.

        The class currently supports:

        * longtable
        * tabular
        * tabulary
        """
        ...
    
    def get_colspec(self) -> str:
        """Returns a column spec of table.

        This is what LaTeX calls the 'preamble argument' of the used table environment.

        .. note::

           The ``\\X`` and ``T`` column type specifiers are defined in
           ``sphinxlatextables.sty``.
        """
        ...
    
    def add_cell(self, height: int, width: int) -> None:
        """Adds a new cell to a table.

        It will be located at current position: (``self.row``, ``self.col``).
        """
        ...
    
    def cell(self, row: int | None = ..., col: int | None = ...) -> TableCell | None:
        """Returns a cell object (i.e. rectangular area) containing given position.

        If no option arguments: ``row`` or ``col`` are given, the current position;
        ``self.row`` and ``self.col`` are used to get a cell object by default.
        """
        ...
    


class TableCell:
    """Data of a cell in a table."""
    def __init__(self, table: Table, row: int, col: int) -> None:
        ...
    
    @property
    def width(self) -> int:
        """Returns the cell width."""
        ...
    
    @property
    def height(self) -> int:
        """Returns the cell height."""
        ...
    


def escape_abbr(text: str) -> str:
    """Adjust spacing after abbreviations."""
    ...

def rstdim_to_latexdim(width_str: str, scale: int = ...) -> str:
    """Convert `width_str` with rst length to LaTeX length."""
    ...

class LaTeXTranslator(SphinxTranslator):
    builder: LaTeXBuilder
    secnumdepth = ...
    ignore_missing_images = ...
    def __init__(self, document: nodes.document, builder: LaTeXBuilder, theme: Theme) -> None:
        ...
    
    def pushbody(self, newbody: list[str]) -> None:
        ...
    
    def popbody(self) -> list[str]:
        ...
    
    def astext(self) -> str:
        ...
    
    def hypertarget(self, id: str, withdoc: bool = ..., anchor: bool = ...) -> str:
        ...
    
    def hypertarget_to(self, node: Element, anchor: bool = ...) -> str:
        ...
    
    def hyperlink(self, id: str) -> str:
        ...
    
    def hyperpageref(self, id: str) -> str:
        ...
    
    def escape(self, s: str) -> str:
        ...
    
    def idescape(self, id: str) -> str:
        ...
    
    def babel_renewcommand(self, command: str, definition: str) -> str:
        ...
    
    def generate_indices(self) -> str:
        ...
    
    def render(self, template_name: str, variables: dict[str, Any]) -> str:
        ...
    
    @property
    def table(self) -> Table | None:
        """Get current table."""
        ...
    
    def visit_document(self, node: Element) -> None:
        ...
    
    def depart_document(self, node: Element) -> None:
        ...
    
    def visit_start_of_file(self, node: Element) -> None:
        ...
    
    def depart_start_of_file(self, node: Element) -> None:
        ...
    
    def visit_section(self, node: Element) -> None:
        ...
    
    def depart_section(self, node: Element) -> None:
        ...
    
    def visit_problematic(self, node: Element) -> None:
        ...
    
    def depart_problematic(self, node: Element) -> None:
        ...
    
    def visit_topic(self, node: Element) -> None:
        ...
    
    def depart_topic(self, node: Element) -> None:
        ...
    
    visit_sidebar = ...
    depart_sidebar = ...
    def visit_glossary(self, node: Element) -> None:
        ...
    
    def depart_glossary(self, node: Element) -> None:
        ...
    
    def visit_productionlist(self, node: Element) -> None:
        ...
    
    def depart_productionlist(self, node: Element) -> None:
        ...
    
    def visit_production(self, node: Element) -> None:
        ...
    
    def depart_production(self, node: Element) -> None:
        ...
    
    def visit_transition(self, node: Element) -> None:
        ...
    
    def depart_transition(self, node: Element) -> None:
        ...
    
    def visit_title(self, node: Element) -> None:
        ...
    
    def depart_title(self, node: Element) -> None:
        ...
    
    def visit_subtitle(self, node: Element) -> None:
        ...
    
    def depart_subtitle(self, node: Element) -> None:
        ...
    
    def visit_desc(self, node: Element) -> None:
        ...
    
    def depart_desc(self, node: Element) -> None:
        ...
    
    def visit_desc_signature(self, node: Element) -> None:
        ...
    
    def depart_desc_signature(self, node: Element) -> None:
        ...
    
    def visit_desc_signature_line(self, node: Element) -> None:
        ...
    
    def depart_desc_signature_line(self, node: Element) -> None:
        ...
    
    def visit_desc_content(self, node: Element) -> None:
        ...
    
    def depart_desc_content(self, node: Element) -> None:
        ...
    
    def visit_desc_inline(self, node: Element) -> None:
        ...
    
    def depart_desc_inline(self, node: Element) -> None:
        ...
    
    def visit_desc_name(self, node: Element) -> None:
        ...
    
    def depart_desc_name(self, node: Element) -> None:
        ...
    
    def visit_desc_addname(self, node: Element) -> None:
        ...
    
    def depart_desc_addname(self, node: Element) -> None:
        ...
    
    def visit_desc_type(self, node: Element) -> None:
        ...
    
    def depart_desc_type(self, node: Element) -> None:
        ...
    
    def visit_desc_returns(self, node: Element) -> None:
        ...
    
    def depart_desc_returns(self, node: Element) -> None:
        ...
    
    def visit_desc_parameterlist(self, node: Element) -> None:
        ...
    
    def depart_desc_parameterlist(self, node: Element) -> None:
        ...
    
    def visit_desc_type_parameter_list(self, node: Element) -> None:
        ...
    
    def depart_desc_type_parameter_list(self, node: Element) -> None:
        ...
    
    def visit_desc_parameter(self, node: Element) -> None:
        ...
    
    def depart_desc_parameter(self, node: Element) -> None:
        ...
    
    def visit_desc_type_parameter(self, node: Element) -> None:
        ...
    
    def depart_desc_type_parameter(self, node: Element) -> None:
        ...
    
    def visit_desc_optional(self, node: Element) -> None:
        ...
    
    def depart_desc_optional(self, node: Element) -> None:
        ...
    
    def visit_desc_annotation(self, node: Element) -> None:
        ...
    
    def depart_desc_annotation(self, node: Element) -> None:
        ...
    
    def visit_seealso(self, node: Element) -> None:
        ...
    
    def depart_seealso(self, node: Element) -> None:
        ...
    
    def visit_rubric(self, node: Element) -> None:
        ...
    
    def depart_rubric(self, node: Element) -> None:
        ...
    
    def visit_footnote(self, node: Element) -> None:
        ...
    
    def depart_footnote(self, node: Element) -> None:
        ...
    
    def visit_label(self, node: Element) -> None:
        ...
    
    def visit_tabular_col_spec(self, node: Element) -> None:
        ...
    
    def visit_table(self, node: Element) -> None:
        ...
    
    def depart_table(self, node: Element) -> None:
        ...
    
    def visit_colspec(self, node: Element) -> None:
        ...
    
    def depart_colspec(self, node: Element) -> None:
        ...
    
    def visit_tgroup(self, node: Element) -> None:
        ...
    
    def depart_tgroup(self, node: Element) -> None:
        ...
    
    def visit_thead(self, node: Element) -> None:
        ...
    
    def depart_thead(self, node: Element) -> None:
        ...
    
    def visit_tbody(self, node: Element) -> None:
        ...
    
    def depart_tbody(self, node: Element) -> None:
        ...
    
    def visit_row(self, node: Element) -> None:
        ...
    
    def depart_row(self, node: Element) -> None:
        ...
    
    def visit_entry(self, node: Element) -> None:
        ...
    
    def depart_entry(self, node: Element) -> None:
        ...
    
    def visit_acks(self, node: Element) -> None:
        ...
    
    def visit_bullet_list(self, node: Element) -> None:
        ...
    
    def depart_bullet_list(self, node: Element) -> None:
        ...
    
    def visit_enumerated_list(self, node: Element) -> None:
        ...
    
    def depart_enumerated_list(self, node: Element) -> None:
        ...
    
    def visit_list_item(self, node: Element) -> None:
        ...
    
    def depart_list_item(self, node: Element) -> None:
        ...
    
    def visit_definition_list(self, node: Element) -> None:
        ...
    
    def depart_definition_list(self, node: Element) -> None:
        ...
    
    def visit_definition_list_item(self, node: Element) -> None:
        ...
    
    def depart_definition_list_item(self, node: Element) -> None:
        ...
    
    def visit_term(self, node: Element) -> None:
        ...
    
    def depart_term(self, node: Element) -> None:
        ...
    
    def visit_classifier(self, node: Element) -> None:
        ...
    
    def depart_classifier(self, node: Element) -> None:
        ...
    
    def visit_definition(self, node: Element) -> None:
        ...
    
    def depart_definition(self, node: Element) -> None:
        ...
    
    def visit_field_list(self, node: Element) -> None:
        ...
    
    def depart_field_list(self, node: Element) -> None:
        ...
    
    def visit_field(self, node: Element) -> None:
        ...
    
    def depart_field(self, node: Element) -> None:
        ...
    
    visit_field_name = ...
    depart_field_name = ...
    visit_field_body = ...
    depart_field_body = ...
    def visit_paragraph(self, node: Element) -> None:
        ...
    
    def depart_paragraph(self, node: Element) -> None:
        ...
    
    def visit_centered(self, node: Element) -> None:
        ...
    
    def depart_centered(self, node: Element) -> None:
        ...
    
    def visit_hlist(self, node: Element) -> None:
        ...
    
    def depart_hlist(self, node: Element) -> None:
        ...
    
    def visit_hlistcol(self, node: Element) -> None:
        ...
    
    def depart_hlistcol(self, node: Element) -> None:
        ...
    
    def latex_image_length(self, width_str: str, scale: int = ...) -> str | None:
        ...
    
    def is_inline(self, node: Element) -> bool:
        """Check whether a node represents an inline element."""
        ...
    
    def visit_image(self, node: Element) -> None:
        ...
    
    def depart_image(self, node: Element) -> None:
        ...
    
    def visit_figure(self, node: Element) -> None:
        ...
    
    def depart_figure(self, node: Element) -> None:
        ...
    
    def visit_caption(self, node: Element) -> None:
        ...
    
    def depart_caption(self, node: Element) -> None:
        ...
    
    def visit_legend(self, node: Element) -> None:
        ...
    
    def depart_legend(self, node: Element) -> None:
        ...
    
    def visit_admonition(self, node: Element) -> None:
        ...
    
    def depart_admonition(self, node: Element) -> None:
        ...
    
    visit_attention = ...
    depart_attention = ...
    visit_caution = ...
    depart_caution = ...
    visit_danger = ...
    depart_danger = ...
    visit_error = ...
    depart_error = ...
    visit_hint = ...
    depart_hint = ...
    visit_important = ...
    depart_important = ...
    visit_note = ...
    depart_note = ...
    visit_tip = ...
    depart_tip = ...
    visit_warning = ...
    depart_warning = ...
    def visit_versionmodified(self, node: Element) -> None:
        ...
    
    def depart_versionmodified(self, node: Element) -> None:
        ...
    
    def visit_target(self, node: Element) -> None:
        ...
    
    def depart_target(self, node: Element) -> None:
        ...
    
    def visit_attribution(self, node: Element) -> None:
        ...
    
    def depart_attribution(self, node: Element) -> None:
        ...
    
    def visit_index(self, node: Element) -> None:
        ...
    
    def visit_raw(self, node: Element) -> None:
        ...
    
    def visit_reference(self, node: Element) -> None:
        ...
    
    def depart_reference(self, node: Element) -> None:
        ...
    
    def visit_number_reference(self, node: Element) -> None:
        ...
    
    def visit_download_reference(self, node: Element) -> None:
        ...
    
    def depart_download_reference(self, node: Element) -> None:
        ...
    
    def visit_pending_xref(self, node: Element) -> None:
        ...
    
    def depart_pending_xref(self, node: Element) -> None:
        ...
    
    def visit_emphasis(self, node: Element) -> None:
        ...
    
    def depart_emphasis(self, node: Element) -> None:
        ...
    
    def visit_literal_emphasis(self, node: Element) -> None:
        ...
    
    def depart_literal_emphasis(self, node: Element) -> None:
        ...
    
    def visit_strong(self, node: Element) -> None:
        ...
    
    def depart_strong(self, node: Element) -> None:
        ...
    
    def visit_literal_strong(self, node: Element) -> None:
        ...
    
    def depart_literal_strong(self, node: Element) -> None:
        ...
    
    def visit_abbreviation(self, node: Element) -> None:
        ...
    
    def depart_abbreviation(self, node: Element) -> None:
        ...
    
    def visit_manpage(self, node: Element) -> None:
        ...
    
    def depart_manpage(self, node: Element) -> None:
        ...
    
    def visit_title_reference(self, node: Element) -> None:
        ...
    
    def depart_title_reference(self, node: Element) -> None:
        ...
    
    def visit_thebibliography(self, node: Element) -> None:
        ...
    
    def depart_thebibliography(self, node: Element) -> None:
        ...
    
    def visit_citation(self, node: Element) -> None:
        ...
    
    def depart_citation(self, node: Element) -> None:
        ...
    
    def visit_citation_reference(self, node: Element) -> None:
        ...
    
    def depart_citation_reference(self, node: Element) -> None:
        ...
    
    def visit_literal(self, node: Element) -> None:
        ...
    
    def depart_literal(self, node: Element) -> None:
        ...
    
    def visit_footnote_reference(self, node: Element) -> None:
        ...
    
    def visit_footnotemark(self, node: Element) -> None:
        ...
    
    def depart_footnotemark(self, node: Element) -> None:
        ...
    
    def visit_footnotetext(self, node: Element) -> None:
        ...
    
    def depart_footnotetext(self, node: Element) -> None:
        ...
    
    def visit_captioned_literal_block(self, node: Element) -> None:
        ...
    
    def depart_captioned_literal_block(self, node: Element) -> None:
        ...
    
    def visit_literal_block(self, node: Element) -> None:
        ...
    
    def depart_literal_block(self, node: Element) -> None:
        ...
    
    visit_doctest_block = ...
    depart_doctest_block = ...
    def visit_line(self, node: Element) -> None:
        ...
    
    def depart_line(self, node: Element) -> None:
        ...
    
    def visit_line_block(self, node: Element) -> None:
        ...
    
    def depart_line_block(self, node: Element) -> None:
        ...
    
    def visit_block_quote(self, node: Element) -> None:
        ...
    
    def depart_block_quote(self, node: Element) -> None:
        ...
    
    def visit_option(self, node: Element) -> None:
        ...
    
    def depart_option(self, node: Element) -> None:
        ...
    
    def visit_option_argument(self, node: Element) -> None:
        """The delimiter between an option and its argument."""
        ...
    
    def depart_option_argument(self, node: Element) -> None:
        ...
    
    def visit_option_group(self, node: Element) -> None:
        ...
    
    def depart_option_group(self, node: Element) -> None:
        ...
    
    def visit_option_list(self, node: Element) -> None:
        ...
    
    def depart_option_list(self, node: Element) -> None:
        ...
    
    def visit_option_list_item(self, node: Element) -> None:
        ...
    
    def depart_option_list_item(self, node: Element) -> None:
        ...
    
    def visit_option_string(self, node: Element) -> None:
        ...
    
    def visit_description(self, node: Element) -> None:
        ...
    
    def depart_description(self, node: Element) -> None:
        ...
    
    def visit_superscript(self, node: Element) -> None:
        ...
    
    def depart_superscript(self, node: Element) -> None:
        ...
    
    def visit_subscript(self, node: Element) -> None:
        ...
    
    def depart_subscript(self, node: Element) -> None:
        ...
    
    def visit_inline(self, node: Element) -> None:
        ...
    
    def depart_inline(self, node: Element) -> None:
        ...
    
    def visit_generated(self, node: Element) -> None:
        ...
    
    def depart_generated(self, node: Element) -> None:
        ...
    
    def visit_compound(self, node: Element) -> None:
        ...
    
    def depart_compound(self, node: Element) -> None:
        ...
    
    def visit_container(self, node: Element) -> None:
        ...
    
    def depart_container(self, node: Element) -> None:
        ...
    
    def visit_decoration(self, node: Element) -> None:
        ...
    
    def depart_decoration(self, node: Element) -> None:
        ...
    
    def visit_header(self, node: Element) -> None:
        ...
    
    def visit_footer(self, node: Element) -> None:
        ...
    
    def visit_docinfo(self, node: Element) -> None:
        ...
    
    def encode(self, text: str) -> str:
        ...
    
    def encode_uri(self, text: str) -> str:
        ...
    
    def visit_Text(self, node: Text) -> None:
        ...
    
    def depart_Text(self, node: Text) -> None:
        ...
    
    def visit_comment(self, node: Element) -> None:
        ...
    
    def visit_meta(self, node: Element) -> None:
        ...
    
    def visit_system_message(self, node: Element) -> None:
        ...
    
    def depart_system_message(self, node: Element) -> None:
        ...
    
    def visit_math(self, node: Element) -> None:
        ...
    
    def visit_math_block(self, node: Element) -> None:
        ...
    
    def visit_math_reference(self, node: Element) -> None:
        ...
    
    def depart_math_reference(self, node: Element) -> None:
        ...
    


