TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By "bind more tightly" I refer to the order in which operations are carried out by default.

Experimenting shows that if \ab is ab and \cd is cd then \ab^\cd is ab^cd. I would like it to be {ab}^{cd}. Of course, I can do this by defining \ab to {ab} and \cd to {cd} but that's not always an acceptable solution; for example, if \cd is actually c^d then \cd_2 is c^d_2 but if \cd is {c^d} then \cd_2 is {c^d}_2. Indeed, if \cd is c^d then with the current precedence, \ab^\cd produces a complaint about double superscripts but changing the precedence would make it {ab}^{c^d} which is fine.

(NB I've tried to present the simplest case that I can; the actual macros that I'm using are considerably more complicated and introducing braces into these macros is much more problematic than in the simplistic case above. In particular, they are recursively defined and so introducing new braces at the outside actually introduces new braces at several inconvenient spots inside as well.)

share|improve this question
up vote 5 down vote accepted

You can't change this behaviour directly, no. However, the breqn package makes ^ and _ active characters that behave as macros that take arguments ‘like normal’, which then has the effect you're looking for. So if you're happy to load breqn, that should fix your problem:

share|improve this answer
Perfect! I notice that the actual bit that I want is handled by the mathstyle package; but the whole mh package looks like one that I'd consider loading by default. (Bizarrely, on Ubuntu I had to install a package called "texlive-latex3" to get this lot.) – Loop Space Jul 28 '10 at 11:37

Another option is to add an extra group in the definition of the macros. For example


However, depending on the actual usage, an additional group may not be desirable.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.