Internal cross-references
We should have references to theorems, sections, equations, etc, within the paper, e.g.
By Theorem 2.8, ...
As shown in Section 3.4, ...
Applying (13) ...
This would require putting a \label on each \section, \begin{theorem}, \begin{equation}, etc, and using \ref to refer back to them. Probably the grammar rules should just insert a placeholder and let latex_pretty_print generate numbered labels.
In principle the perl code could keep track of whether each one is a theorem, lemma, etc, and adjust the wording at each \ref, but I think there may also be a LaTeX package to do this automatically.
Actually the generation of numbered labels is exactly what the + and # rule mechanism does.
It will be more annoying, in fact as a customer here, I feel a burden to remove recognizable fake references, Please do something about this.