Search code examples
latextexmathematical-expressions

Is there a way to override LaTeX's errors about double subscripts and superscripts?


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?


Solution

  • The following is what you wish

    \catcode`\^ = 13 \def^#1{\sp{#1}{}}
    \catcode`\_ = 13 \def_#1{\sb{#1}{}}