I am writing a document which contains a lot of half-integer indices.
In display mode, x_{i + \frac {1} {2}} looks fine.
However, in inline mode, having several x_{i + \frac {1} {2}} messes up the interline spacing. x_{i + 1/2} looks fine, though.
I would like a command that allows switching between both:
- x_{i + \frac {1} {2}} when in display mode,
- x_{i + 1/2} when in inline mode.
I tried playing around with the answer from this question, but could not get it to work properly in my case. Any ideas?
\everymath{..}and activating a bool, for instance. Or making_active and hooking a bool in there. – Manuel May 12 '16 at 14:03x_{i + 1/2}when you are in inline math? First, these are fewer letters to type thanx_{i + \frac{1}{2}}and second there is no autodetection for inline math mode, which means you will very soon hit corner cases. – Henri Menke May 12 '16 at 14:26\iphto representi + \frac {1} {2}. My question probably was not clear enough: I would like to replace the\fracin the previous expression by a command that automatically chooses which fraction expression to display. However, since there is no autodetection for inline math mode, it would be hard to get such a behavior... – Victor May 12 '16 at 14:35