Make .plot files mathtext-compatible

This merge request aims to change the labels in all .plot files under analyses/ to make them compatible with mathtext, which is a subset of LaTeX that matplotlib can parse. This is for the upcoming switch of the plotting backend from pstricks to matplotlib. No major (hopefully any) changes to the output in the plots, even when using the current plotting backend, should be seen.

Fixed issues

  • Changed \text to \mathrm.
  • Added curly braces to spots where it is missing from \frac, \sqrt, \text.
  • Changed \ge to \geq, \le to \leq.
  • Fixed edge cases where converting \text to \mathrm does not work.
  • Remove ^ from \perp^ in analyses/pluginCMS/CMS_2014_I1305624.plot.
  • Replace \unit and \si with alternatives, e.g., \unit{10}{\GeV} is converted to 10~\GeV.
  • Spaces inside former \text commands have been replaced by a ~, since \mathrm ignores spaces while \text does not.
  • Enclose LaTeX commands such as \% with $ (i.e. math mode). Otherwise, mathtext will interpret \ as plain text.
  • Replace deprecated \rm command with \mathrm
  • Remove superfluous } in some labels that caused LaTeX syntax errors

Remaining issues

  • \micro in LaTeX will give the same output as $\mathrm{\mu}$ in mathtext. However, $\mathrm{\mu}$ in LaTeX will give a non-sensical output. This can therefore not be changed until the backend has been switched completely to mathtext.
  • \large has no equivalent command in mathtext. Instead, one must pass a fontsize parameter to matplotlib. The details for how such a parameter should be passed to matplotlib has not been decided yet. As such, this cannot be changed for now.

Commands that will not be converted

\GeV, \TeV, \pt and \pT, and potentially some other commonly used simple commands (\PQt?) will not be converted to something else in this merge request. The idea is instead to preprocess each label before it is passed to matplotlib and replace these commands with something that can be parsed by mathtext.

Edited by Simon Thor

Merge request reports

Loading