2

The following MWE:

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{equation}
\dfrac{dN}{da}=\dfrac{1}{C}\left[\dfrac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}\right]^{m/2}
\end{equation}

\end{document}

which is extracted from a much larger document produces the following result: Ugly equation

How do I fix the vertical spacing of the item within the bracket which has the huge space underneath the denominator of the fraction?

4 Answers4

4

\left and \right are forced to be symmetric about the math axis. I recommend reexpressing the tall fraction in the numerator.

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{equation}
\dfrac{dN}{da}=\dfrac{1}{C}\left[\dfrac{\cos(\pi a/W)}{\pi a\Delta\sigma^2}\right]^{m/2}
\end{equation}

\end{document}

enter image description here

I think the following would be frowned upon, but it gives a different approach that preserves the vertical fraction:

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{scalerel}
\begin{document}

\begin{equation}
\dfrac{dN}{da}=\dfrac{1}{C}
{\stretchleftright[400]{(}{\dfrac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}}{)}}^{m/2}
\end{equation}

\end{document}

enter image description here

3

Thanks everyone. It turns out that changing the \dfrac to \frac fixes the spacing and keeps the vertically stacked fraction. By way of demonstration here is a revised MWE:

\documentclass[fleqn]{minimal}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}
The original:
\begin{equation*}
\dfrac{dN}{da}=\dfrac{1}{C}\left[\dfrac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}\right]^{m/2}
\end{equation*}
The corrected version:
\begin{equation*}
\frac{dN}{da}=\dfrac{1}{C}\left[\frac{\cos\left(\frac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}\right]^{m/2}
\end{equation*}
\end{document}

Comparison of original and corrected versions of equation

So it seems that forcing spacing on LaTeX by using the \dfrac command was a bad idea.

  • Hi, welcome to the site! This doesn't actually answer the question, and we operate on a Q & A basis here, rather than like a discussion forum, or bulletin board. We like to show our appreciation here by upvoting, accepting answers and, if we really have something to say, by leaving a brief comment. We keep this space for answers and strive to have good answers to good questions, giving good information to anybody else who should come along with similar problems (and this is a common problem) :) – Au101 Mar 03 '16 at 00:46
  • I disagree. It is an exact answer to the question which by the way I asked. – Bruce Crawford Mar 03 '16 at 00:51
  • 1
    Erm, yes, you're right actually, I apologise, I read your answer as a simple thank you summarising other poster's advice, which is a common mistake new users make. This relatively old user made the mistake of not thoroughly reading the thread before writing a preachy comment. I'm sorry about that – Au101 Mar 03 '16 at 01:03
  • That's fine. I was only trying to share the solution I found to the problem. – Bruce Crawford Mar 03 '16 at 01:05
  • Which is exactly what this site is for and this is a very well produced answer :) +1. However, you do still have a height problem, the gap down to the bottom of the brackets is larger than the gap up to the top, it's merely less pronounced – Au101 Mar 03 '16 at 02:26
  • Yes, I agree that the vertical spacing is still not optimal but it seems to be predicated on the vertical alignment of the vincula of the fractions inside and outside of the square brackets. I can live with it as it is. – Bruce Crawford Mar 03 '16 at 02:36
1

Probably you should do what Steven suggests, but to answer the question more literally:

enter image description here

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{equation}
\dfrac{dN}{da}
=
\dfrac{1}{C}\left[\dfrac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}\right]^{m/2}
=
\dfrac{1}{C}\Biggl[\dfrac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}\Biggr]^{m/2}
\dfrac{1}{C}
\mathopen{\raisebox{.6ex}{$\Bigg[$}}
\dfrac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}
\mathclose{\raisebox{.6ex}{$\Bigg]$}}^{m/2}
\end{equation}

\end{document}
David Carlisle
  • 757,742
1

Just for fun without doing any guesswork:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}

\newsavebox{\badfrac}
\newsavebox{\badfracleft}
\newsavebox{\badfracright}
\newlength{\badfracheight}

\begin{document}

\begin{equation}
\sbox\badfrac{%
  $\displaystyle
  \frac{\cos\left(\dfrac{\pi a}{W}\right)}{\pi a\Delta\sigma^2}%
  $%
}
\setlength{\badfracheight}{\dimexpr\ht\badfrac-2\fontdimen22\textfont2}
\sbox\badfracleft{$\left(\vbox to\badfracheight{}\right.\kern-\nulldelimiterspace$}
\sbox\badfracright{$\left.\kern-\nulldelimiterspace\vbox to\badfracheight{}\right)^{\!m/2}$}
\frac{dN}{da}=\frac{1}{C}
\raisebox{2\fontdimen22\textfont2}{\usebox\badfracleft}
\usebox\badfrac
\raisebox{2\fontdimen22\textfont2}{\usebox\badfracright}
\end{equation}

\end{document}

enter image description here

But avoid this: it will be much more clearer with a slashed fraction in the argument to the cosine.

egreg
  • 1,121,712