3

I would like to use \overset and \underset together on this formula but it gives me an error. As soon as I change the equality sign (=) and use max instead it is fixed. Can you help me with that?

\[
 \lim_{x\to 0}{\frac{e^x-1}{2x}}

\overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}}

\lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}} ]

Werner
  • 603,163

2 Answers2

7

You can't have blank lines in math displays. Also amsmath offers \overunderset.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

[ \lim_{x\to 0}{\frac{e^x-1}{2x}} \overunderset{\left[\frac{0}{0}\right]}{\mathrm{H}}{=} \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}} ]

\end{document}

enter image description here

egreg
  • 1,121,712
  • your code did fine even though my problem was \usepackage{breqn} which prevented my code to compile. but your code is fine with that thanks ;) – Roozbeh Ranjbar Sep 08 '21 at 22:18
4

You can't have empty (blank) lines inside a display math environment \[...\]. Remove those and your minimal code will compile.

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

[ \lim_{x \to 0}{\frac{e^x - 1}{2x}} \overset{\left[ \frac{0}{0} \right]}{\underset{\mathrm{H}}{=}} \lim_{x \to 0}{\frac{e^x}{2}} = {\frac{1}{2}} ]

\end{document}

Werner
  • 603,163
  • yes yes my code is without blank, but funny thing was that when i compile your code with only amsmath it worked but it did not work on my .tex file. so i removed some packages one by one and '\usepackage{breqn}' was preventing the code to compile. why?! – Roozbeh Ranjbar Sep 08 '21 at 22:14
  • 1
    @RoozbehRanjbar: Not sure why. Use egreg's answer instead since it seems to work with breqn. – Werner Sep 08 '21 at 22:20