neldredge / mathgen

Generate random nonsense math papers
https://thatsmathematics.com/mathgen/
GNU General Public License v2.0
561 stars 72 forks source link

Protect math in bibtex titles #4

Closed neldredge closed 4 years ago

neldredge commented 4 years ago

If a reference title contains math, it needs to be protected by { }. Currently we can generate something like

@article{cite:21,
  ...
  title = {${\mathscr{{Q}}}$-Trivially Co-{E}uclid Matrices and Concrete {P}DE},

which is downcased by BibTeX and becomes

\newblock ${\mathscr{{q}}}$-trivially co-{E}uclid matrices and concrete {P}de.

in the bbl file. There is no lower-case q in the mathscr font so it's just omitted. For other fonts like mathcal we could get strange characters.

What we should produce instead would be

  title = {{${\mathscr{{Q}}}$}-Trivially Co-{E}uclid Matrices and Concrete {P}DE},
neldredge commented 4 years ago

The {P}DE appearing above is an instance of #5.