How to make fractions be different sizes depending on situation

Hi! How can I make my fractions look like

$display(1/2)$
$display(1/2)^inline(2/3)$
$2_(1/2)$

if I write

$1/2$
$(1/2)^(2/3)$
$2_(1/2)$

?

So, if it is in display mode, unless it’s in the exponent (where it’s inline) or an index

1 Like

This will make all your fractions use the display size:

#show math.frac: it => $display(it)$
$1/2$
$(1/2)^(2/3)$
$2_(1/2)$

image

But it also makes it impossible to specifically call out a fraction as using inline sizing.


#show math.attach: it => it

matches both a^b and c_d, but I didn’t find a good way to affect the sizing of only the attached objects and not the base object.


I debated whether I should post this because it doesn’t solve any of your problems, but maybe it is helpful in some small way.