8

I'm having some troubles with the square root symbol within a fraction. This code

\documentclass{book}

\begin{document}
\begin{equation}
h_4 = \frac{\sqrt{1.5 \gamma_4 -3.5}-1}{18}
 \end{equation}
\begin{equation}
h_3 = \frac{\gamma_3}{4+ \sqrt{6\gamma_4-14}}
\end{equation}
\end{document}

returns this

square root within a fraction

Now, is it just me, or the horizontal line of the square root is really close both to the numbers below it and to the fraction line above it?

I find this a little clumsy.

Is there a solution? Or this is just my paranoia? :P

Thank you very much

1
  • 1
    Since you said I have to agree: it is your paranoia. lol
    – Sigur
    Commented Jun 24, 2014 at 21:24

2 Answers 2

8

If it is not too large, \strut may be a solution (an original one left for comparision). According Mico's sugestion, \mathstrut gives a value between them. You can also adjust vertical spacing exactly to expected values, using e.g. \rule.

\documentclass{book}
\newcommand\uprule{\rule{0mm}{1.9ex}} %shortcut macro
\begin{document}
\begin{equation}
h_4 = \frac{\sqrt{1.5 \gamma_4 -3.5}-1}{18}
 \end{equation}
\begin{equation}
h_3 = \frac{\gamma_3}{4+ \sqrt{6\gamma_4-14}}
\end{equation}

strut

\begin{equation}
h_4 = \frac{\sqrt{\strut1.5 \gamma_4 -3.5}-1}{18}
 \end{equation}
\begin{equation}
h_3 = \frac{\gamma_3}{4+ \sqrt{\strut6\gamma_4-14}}
\end{equation}

mathstrut

\begin{equation}
h_4 = \frac{\sqrt{\mathstrut1.5 \gamma_4 -3.5}-1}{18}
 \end{equation}
\begin{equation}
h_3 = \frac{\gamma_3}{4+ \sqrt{\mathstrut6\gamma_4-14}}
\end{equation}

rule

\begin{equation}
h_4 = \frac{\sqrt{\uprule1.5 \gamma_4 -3.5}-1}{18}
 \end{equation}
\begin{equation}
h_3 = \frac{\gamma_3}{4+ \sqrt{\uprule 6\gamma_4-14}}
\end{equation}
\end{document}

enter image description here

1
  • I just learned what struts and rules are. Thank you very much, this indeed is the solution to my "problem" (or paranoia hihi :P).
    – Luca
    Commented Jun 25, 2014 at 7:49
5

With \mathstrut the size of the square root sign would increase. In these cases, masking the descender is probably the best way around:

\documentclass{book}
\usepackage{amsmath}

\begin{document}
\begin{align}
h_4 &= \frac{\sqrt{1.5 \smash[b]{\gamma^{}_4} -3.5}-1}{18}
\\[1ex]
h_3 &= \frac{\gamma_3}{4+ \sqrt{6\smash[b]{\gamma^{}_4}-14}}
\end{align}
\end{document}

enter image description here

Here is the same with \mathstrut:

\begin{align}
h_4 &= \frac{\sqrt{\mathstrut 1.5 \gamma^{}_4 -3.5}-1}{18}
\\[1ex]
h_3 &= \frac{\gamma_3}{4+ \sqrt{\mathstrut 6 \gamma^{}_4-14}}
\end{align}

enter image description here

1
  • The extra vertical space between the radicand and the square root sign's horizontal bar afforded by \mathstrut may just be what the OP is hoping to achieve.
    – Mico
    Commented Jun 24, 2014 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .