
我在分數內的平方根符號上遇到了一些麻煩。這段程式碼
\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}
返回這個
現在,是只有我覺得,還是平方根的水平線真的很接近它下面的數字和上面的分數線?
我覺得這有點笨拙。
有解決辦法嗎?或者這只是我的偏執? :P
非常感謝
答案1
如果不是太大,\strut
可能是一種解決方案(留下原始方案進行比較)。根據Mico的建議,\mathstrut
給出它們之間的一個值。您也可以使用例如將垂直間距精確調整為預期值\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}
答案2
隨著\mathstrut
平方根符號的大小會增加。在這些情況下,掩蓋下降部分可能是最好的方法:
\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}
這裡與 相同\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}