code: def genelatex(body, wrap):
      """Generate LaTeX document for dvipng backend."""
      lt = LaTeXTool.instance()
      breqn = wrap and lt.use_breqn and kpsewhich("breqn.sty")
      yield u(r"\documentclass{article}")
      packages = lt.packages
      if breqn:
          packages = packages + ["breqn"]
      for pack in packages:
          yield u(r"\usepackage{{{0}}}".format(pack))
      yield u(r"\pagestyle{empty}")
      if lt.preamble:
          yield lt.preamble
      yield u(r"\begin{document}")
      if breqn:
          yield u(r"\begin{dmath*}")
          yield body
          yield u(r"\end{dmath*}")
      elif wrap:
          yield "$${0}$$".format(body)
      else:
          yield body
      yield "\end{document}"
  
file_path: catboost/contrib/python/ipython/py2/IPython/lib/latextools.py
imports: from io import BytesIO, open
  import os
  import tempfile
  import shutil
  import subprocess
  from IPython.utils.process import find_cmd, FindCmdError
  from traitlets.config import get_config
  from traitlets.config.configurable import SingletonConfigurable
  from traitlets import List, Bool, Unicode
  from IPython.utils.py3compat import cast_unicode, cast_unicode_py2, PY3
label_desc: Use image node_id 5 for calling a global function with example usage: genelatex(body, wrap) without return types