Minor point about LaTeX that bothers me. When one writes
a^b^c, a_b_c
or
a'^b
in math mode, LaTeX gives an error message complaining about multiple super/subscripts. This is particularly annoying after replacing a string containing a super/subscript or when using the apostrophe, '
.
Is there a way to override the error and have LaTeX simply output
a^{bc} a_{bc} {a'}^b
and so on?
The following is what you wish
\catcode`\^ = 13 \def^#1{\sp{#1}{}}
\catcode`\_ = 13 \def_#1{\sb{#1}{}}
This is one of those cases where you really should be warned, and have to place the braces the way you want them - or write something without a double sub/superscript, if that's what you mean. Generally, when you're using superscript to indicate exponentiation, not indexing, a^b^c = a^{b^c}
, so the output you describe is definitely incorrect in some cases. Sure, if they're superscript indices, you might mean a^{bc}
, but how's LaTeX to know? And for subscripts, what if you really do mean a_{n_k}
, not a_{nk}
? (that is, double-indexing vs. a sequence of indices)
(And of course, if this crops up as part of a substitution, you can probably figure out a way to fix it as part of the substitution.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With