arpes.plotting.utils.latex_escape(text: str, force: bool = False) str[source]

Conditionally escapes a string based on the matplotlib settings.

If you need the escaped string even if you are not using matplotlib with LaTeX support, you can pass force=True.

Adjusted from suggestions at:

  • text – The contents which should be escaped

  • force – Whether we should perform escaping even if matplotlib is not being used with LaTeX support.


The escaped string which should appear in LaTeX with the same contents as the original.