class_docstr: Builds LaTeX output to create PDF.
class_docstr_tok: ["Builds","LaTeX","output","to","create","PDF","."]
code: def write(self, *ignored: Any) -> None:
      docwriter = LaTeXWriter(self)
      with warnings.catch_warnings():
          warnings.filterwarnings("ignore", category=DeprecationWarning)
          # DeprecationWarning: The frontend.OptionParser class will be replaced
          # by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
          docsettings: Any = OptionParser(
              defaults=self.env.settings,
              components=(docwriter,),
              read_config_files=True,
          ).get_default_values()
  
      self.init_document_data()
      self.write_stylesheet()
      self.copy_assets()
  
      for entry in self.document_data:
          docname, targetname, title, author, themename = entry[:5]
          theme = self.themes.get(themename)
          toctree_only = False
          if len(entry) > 5:
              toctree_only = entry[5]
          destination = SphinxFileOutput(
              destination_path=path.join(self.outdir, targetname),
              encoding="utf-8",
              overwrite_if_changed=True,
          )
          with progress_message(__("processing %s") % targetname):
              doctree = self.env.get_doctree(docname)
              toctree = next(doctree.findall(addnodes.toctree), None)
              if toctree and toctree.get("maxdepth") > 0:
                  tocdepth = toctree.get("maxdepth")
              else:
                  tocdepth = None
  
              doctree = self.assemble_doctree(
                  docname,
                  toctree_only,
                  appendices=(
                      self.config.latex_appendices
                      if theme.name != "howto"
                      else []
                  ),
              )
              doctree["docclass"] = theme.docclass
              doctree["contentsname"] = self.get_contentsname(docname)
              doctree["tocdepth"] = tocdepth
              self.post_process_images(doctree)
              self.update_doc_context(title, author, theme)
              self.update_context()
  
          with progress_message(__("writing")):
              docsettings._author = author
              docsettings._title = title
              docsettings._contentsname = doctree["contentsname"]
              docsettings._docname = docname
              docsettings._docclass = theme.name
  
              doctree.settings = docsettings
              docwriter.theme = theme
              docwriter.write(doctree, destination)
  
imports: from __future__ import annotations
  import os
  import warnings
  from os import path
  from typing import TYPE_CHECKING, Any
  from docutils.frontend import OptionParser
  import sphinx.builders.latex.nodes
  from sphinx import addnodes, highlighting, package_dir
  from sphinx.builders import Builder
  from sphinx.builders.latex.constants import ADDITIONAL_SETTINGS, DEFAULT_SETTINGS, SHORTHANDOFF
  from sphinx.builders.latex.theming import Theme, ThemeFactory
  from sphinx.builders.latex.util import ExtBabel
  from sphinx.config import ENUM, Config
  from sphinx.environment.adapters.asset import ImageAdapter
  from sphinx.errors import NoUri, SphinxError
  from sphinx.locale import _, __
  from sphinx.util import logging, texescape
  from sphinx.util.console import bold, darkgreen
  from sphinx.util.display import progress_message, status_iterator
  from sphinx.util.docutils import SphinxFileOutput, new_document
  from sphinx.util.fileutil import copy_asset_file
  from sphinx.util.i18n import format_date
  from sphinx.util.nodes import inline_all_toctrees
  from sphinx.util.osutil import SEP, make_filename_from_project
  from sphinx.util.template import LaTeXRenderer
  from sphinx.writers.latex import LaTeXTranslator, LaTeXWriter
  from docutils import nodes
label_desc: Use image node_id 12 for calling the LaTeXBuilder obj's underlying member method code with example usage: obj.write() without return types