code: def add_latex_package(
      self,
      name: str,
      options: str | None,
      after_hyperref: bool = False,
  ) -> None:
      if self.has_latex_package(name):
          logger.warning("latex package '%s' already included", name)
  
      logger.debug("[app] adding latex package: %r", name)
      if after_hyperref:
          self.latex_packages_after_hyperref.append((name, options))
      else:
          self.latex_packages.append((name, options))
  
imports: from __future__ import annotations
  import sys
  import traceback
  from importlib import import_module
  from types import MethodType
  from typing import TYPE_CHECKING, Any, Callable
  from sphinx.domains import Domain, Index, ObjType
  from sphinx.domains.std import GenericObject, Target
  from sphinx.errors import ExtensionError, SphinxError, VersionRequirementError
  from sphinx.extension import Extension
  from sphinx.io import create_publisher
  from sphinx.locale import __
  from sphinx.parsers import Parser
  from sphinx.roles import XRefRole
  from sphinx.util import logging
  from sphinx.util.logging import prefixed_warnings
label_desc: Use image node_id 31 for calling the SphinxComponentRegistry obj's underlying member method code with example usage: obj.add_latex_package(name, options, after_hyperref) without return types