class_docstr: Class for converting input `\mathrm{\LaTeX}` strings into SymPy Expressions.
  It holds all the necessary internal data for doing so, and exposes hooks for
  customizing its behavior.
  
  Parameters
  ==========
  
  print_debug_output : bool, optional
  
      If set to ``True``, prints debug output to the logger. Defaults to ``False``.
  
  transform : bool, optional
  
      If set to ``True``, the class runs the Transformer class on the parse tree
      generated by running ``Lark.parse`` on the input string. Defaults to ``True``.
  
      Setting it to ``False`` can help with debugging the `\mathrm{\LaTeX}` grammar.
  
  grammar_file : str, optional
  
      The path to the grammar file that the parser should use. If set to ``None``,
      it uses the default grammar, which is in ``grammar/latex.lark``, relative to
      the ``sympy/parsing/latex/lark/`` directory.
  
  transformer : str, optional
  
      The name of the Transformer class to use. If set to ``None``, it uses the
      default transformer class, which is :py:func:`TransformToSymPyExpr`.
code: def __init__(
      self,
      print_debug_output=False,
      transform=True,
      grammar_file=None,
      transformer=None,
  ):
      grammar_dir_path = os.path.join(
          os.path.dirname(__file__), "grammar/"
      )
  
      if grammar_file is None:
          with open(
              os.path.join(grammar_dir_path, "latex.lark"),
              encoding="utf-8",
          ) as f:
              latex_grammar = f.read()
      else:
          with open(grammar_file, encoding="utf-8") as f:
              latex_grammar = f.read()
  
      self.parser = _lark.Lark(
          latex_grammar,
          source_path=grammar_dir_path,
          parser="earley",
          start="latex_string",
          lexer="auto",
          ambiguity="explicit",
          debug=True,
          propagate_positions=False,
          maybe_placeholders=False,
          keep_all_tokens=True,
      )
  
      self.print_debug_output = print_debug_output
      self.transform_expr = transform
  
      if transformer is None:
          self.transformer = TransformToSymPyExpr()
      else:
          self.transformer = transformer()
  
file_path: sympy/sympy/parsing/latex/lark/latex_parser.py
imports: import os
  import logging
  import re
  from sympy.external import import_module
  from sympy.parsing.latex.lark.transformer import TransformToSymPyExpr
label_desc: Use image node_id 1 to create a new LarkLaTeXParser object  with example: obj = LarkLaTeXParser(print_debug_output, transform, grammar_file, transformer)