code: def _latex_format(obj: Any) -> str:
      
      if isinstance(obj, float):
          try:
              return sympy.latex(symbolize(obj))
          except ValueError:
              return "{0:.4g}".format(obj)
  
      return str(obj)
docs: Format an object as a latex string.