4

I intend to create a vertical space between the number 39 and the horizontal bar of the fraction, so as not to get crowded. How can I create the vertical space?

\documentclass[a4paper,11pt]{book}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage[makeroom]{cancel}
\usepackage[normalem]{ulem}
\usepackage{mathtools}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{lmargin=10mm,rmargin=10mm,bmargin=30mm}
\begin{document}
\begin{equation}
A=\left.\dfrac{\dfrac{80}{39}}{\cancel{s}\Bigg(s+\dfrac{17}{39}\Bigg)}\cancel{s}\,\right\vert_{s=0}
=\left.\frac{\dfrac{80}{39}}{s+\dfrac{17}{39}}\right\vert_{s=0}=\frac{\dfrac{80}{39}}{\dfrac{17}{39}}=\dfrac{80}{\cancel{39}}\times \dfrac{\cancel{39}}{17}=\dfrac{80}{17}
\end{equation}
\end{document}

enter image description here

3 Answers 3

1

I propose one oft these solutions: either add a \bigstrut[b] to the fractions in the numerator, a \bigstrut[t] to the fractions in the denominator at the relevant places, or the medium-sized fractions from nccmath. I added various improvements to your code, like using \cfrac in the place of \dfrac for the nested fractions, and the paits \biggl ... \biggr, and the like, for a better vertical spacing of the delimiters.

\documentclass[a4paper, 11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{hmargin=10mm, bmargin=30mm}
\usepackage{amsfonts}
\usepackage[makeroom]{cancel}
\usepackage[normalem]{ulem}
\usepackage{nccmath, mathtools}
\usepackage{bigstrut}

\begin{document}

\begin{equation}
A=\left.\frac{\cfrac{80}{39\bigstrut[b]}}{\cancel{s}\biggl(s+\cfrac{17}{39}\biggr)}\cancel{s}\,\right\rvert_{s=0}
=\left.\frac{\cfrac{80}{39\bigstrut[b]}}{s+\cfrac{17\bigstrut[t]}{39}}\right\vert_{s=0}=\frac{\cfrac{80}{39\bigstrut[b]}}{\cfrac{17}{39}}=\frac{80}{\cancel{39}}\times \frac{\cancel{39}}{17}=\frac{80}{17}
\end{equation}
\bigskip

\begin{equation}
A=\left.\frac{\mfrac{80}{39}}{\cancel{s}\Bigl(s+\mfrac{17}{39}\Bigr)}\cancel{s}\,\right\rvert_{s=0}
=\left.\frac{\mfrac{80}{39}}{s+\mfrac{17}{39}}\right\vert_{s=0}=\frac{\mfrac{80}{39}}{\mfrac{17}{39}}=\frac{80}{\cancel{39}}\times \frac{\cancel{39}}{17}=\frac{80}{17}
\end{equation}
\end{document} 

enter image description here

4

Define a couple of commands to suit your needs:

\documentclass{article}
\usepackage{amsmath}
\usepackage[makeroom]{cancel}

\newcommand{\ufrac}[2]{\dfrac{#1}{#2\mathstrut}} % upper fraction
\newcommand{\lfrac}[2]{\dfrac{#1\mathstrut}{#2}} % lower fraction

\begin{document}

\begin{equation}
A=\left.\frac{\ufrac{80}{39}}{\cancel{s}\biggl(s+\lfrac{17}{39}\biggr)}\cancel{s}\,
  \right\vert_{s=0}
 =\left.\frac{\ufrac{80}{39}}{s+\lfrac{17}{39}}\right\vert_{s=0}
 =\frac{\ufrac{80}{39}}{\lfrac{17}{39}}
 =\dfrac{80}{\cancel{39}}\times \dfrac{\cancel{39}}{17}=\dfrac{80}{17}
\end{equation}
\end{document}

enter image description here

1

Here is one possibility. I use \dpstrut{1ex} in this example and 1ex is too much—this is just to make the effect clearly visible. My \dpstrut command only adds an invisible rule with zero height and width, plus configurable depth where it is used; it doesn't change anything else.

\documentclass{book}
\usepackage{amsmath}
\usepackage[makeroom]{cancel}

\newcommand*{\dpstrut}[1]{\vrule width 0pt height 0pt depth #1\relax}

\begin{document}

\begin{equation}
A=\left.\dfrac{\dfrac{80}{\dpstrut{1ex}39}}{\cancel{s}\Bigg(s+\dfrac{17}{39}\Bigg)}\cancel{s}\,\right\vert_{s=0}
=\left.\frac{\dfrac{80}{39}}{s+\dfrac{17}{39}}\right\vert_{s=0}=\frac{\dfrac{80}{39}}{\dfrac{17}{39}}=\dfrac{80}{\cancel{39}}\times \dfrac{\cancel{39}}{17}=\dfrac{80}{17}
\end{equation}

\end{document}

enter image description here

Unrelated: I believe you would be better off using \Biggl( ... \Biggr) instead of \Bigg( ... \Bigg). This should give better spacing, because \Biggl and \Biggr give the proper \mathopen or \mathclose class to the thing being wrapped, contrary to just \Bigg which is a \mathord (due to the use of \hbox) as seen from outside.

You must log in to answer this question.

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