I'm basically brand new to Latex, so maybe this has a really simple answer I'm not seeing, but I'm having a problem where \frac isn't putting my first input over the numerator but instead to the side of the fraction.
the code looks like this
$\limi a_n=\limi \frac{1}{2} $
but it ends up looking like this
It's worth noting that \limi
is a custom command I made with code
\newcommand{\limi}{$\lim\limits_{n\to\infty}$}
In addition, If I change \frac
to be \tfrac
or \dfrac
it works just fine
Ex.
$\limi a_n=\limi \dfrac{1}{2} $
And last thing I've noticed is that if I delete my \limi
command it fixes the problem, and \frac
works like normal. So I'm guessing that it has something to do with my command code, but I can't figure out what's causing it. Help would be very much appreciated.
P.S.(I know that this equation doesn't make any sense, I changed the fraction to test the code, and so it would be easier to see)
Best Answer
With the simple example
and hit return when errors are raised, I get the following on the console
When TeX issues an error message, it's essentially impossible to obtain correct output if one simply scrolls past errors.
Modify your code into
and you'll get no error, but dubiously useful output, because
\limits
will make the formula too big vertically to fit in a line. Example:Output
Remove also
\limits
.