Menu

#4725 tex-array creates invalid double subscript

None
open
None
5
2026-04-28
2026-04-27
Leo Butler
No

tex-array is used to implement the (terrible, in my opinion) dwim subscripting and to typeset array arguments as subscripts. This produces invalid TeX:

tex(a_1[4]);
$$a_{1}_{4}$$

or

tex(a1[4]);
$$a_{1}_{4}$$

There are at least two alternatives:

  1. Wrap the output of tex-array in brace brackets. That would produce valid TeX like {{a_{1}}_{4}} in both cases.
  2. Add a switch to disable dwim subscripting. This would also produce valid TeX (like {\it a\_1}_{4} or {\it a1}_{4})

Attached is a patch that implements both (but only does 1. when dwim subscripting is active).

This bug was first observed in bug #4696.

Discussion

  • Leo Butler

    Leo Butler - 2026-04-27

    Patch.

     
  • Robert Dodier

    Robert Dodier - 2026-04-28

    For the record, I also think the DWIM inferred subscript stuff is terrible. That said, I think (1) is better than what we have now (and also preferable to (2)).

     

Log in to post a comment.