I've been having a bit of trouble typesetting (n-th power) Legendre symbols. I've set up the command
\newcommand{\Leg}[3][]{\left(\frac{#2}{#3}\right)_{#1}}
But, when I type e.g.
$$\Leg[3]{\pi}{\theta} = \Leg[3]{\theta}{\pi}$$
the symbol on the left is smaller than the one on the right:
I'd be very grateful if someone could suggest a way to make the symbols the same size. (Either a way to set up the \Leg
command so it always outputs symbols of the same size, or an ad hoc way of adjusting the size each time I use \Leg
would be great.)
Best Answer
You can (and should) use
\genfrac
:The command
\legendre
,\dlegendre
and\tlegendre
act the same as\frac
,\dfrac
and\tfrac
.The
\genfrac
command takes six arguments:Thus we get
\legendre
from\genlegendre
by passing nothing as fourth argument to\genfrac
,\dlegendre
by passing0
.The
\if\relax\detokenize{#1}\relax
trick is for avoiding an empty subscript that would generate\scriptspace
nonetheless.