3

I am using this code for a mathematics problem. The code works but the lower fraction looks really dull, the parenthesis is doing something it isn't supposed to. What I can do about this?

\begin{align}
D &= \sum_{i}^{k}\frac{n_i}{\frac{A}({\Delta\sigma_i})^m} \nonumber \\
D &= \sum_{i}^{k}\frac{n_i}{\frac{A}({r_i*\Delta\sigma_{max}})^m} \nonumber \\
D &= \frac{(\Delta\sigma_{max})^m}{A} \sum_{i}^{k}\frac{n_i}{(r_i)^m} \nonumber \\
D &= \frac{(\Delta\sigma_{max})^m}{A} * C \label{eq:constant}
\end{align}

Sample output

5
  • 1
    Welcome to the site. If you indent your code 4 spaces, it shows as code. Alternately, highlight it and click on the {} icon at the top of the editing box. Jan 21, 2015 at 12:33
  • In your first two equations, it is not clear whether you want the whole denominator to have the exponent or only the denominator of the denominator. Jan 21, 2015 at 12:37
  • The problem is {\frac{A}({\Delta\sigma_i})^m}. The correct syntax for \frac is \frac{above}{below}. In your code ( is the denominator, which is not what you want ;)
    – JBantje
    Jan 21, 2015 at 12:40
  • Please include a complete minimum working example. (Your LaTeX is non-standard as it relies on amsmath.)
    – user10274
    Apr 22, 2015 at 11:57
  • Remember to accept the answer you find most useful (if, indeed, any of them are useful to you). May 20, 2015 at 0:22

3 Answers 3

3

Here's an alternative presentation to avoid fractions within fractions. EDITED to reflect clarified intent of the OP in the comment section.

Also, use \max instead of max, since it is a function.

REEDITED to take Mico's suggestion of using \cdot rather than the *. That is, perhaps, assuming something on the intent of the OP, but it seems a reasonable assumption.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
D &= \sum_{i}^{k}n_i\cdot\frac{({\Delta\sigma_i})^m}{A}\nonumber \\
D &= \sum_{i}^{k}n_i\cdot\frac{({r_i\cdot\Delta\sigma_{\max}})^m}{A} \nonumber \\
D &= \frac{(\Delta\sigma_{\max})^m}{A} \sum_{i}^{k}\frac{n_i}{(r_i)^m} \nonumber \\
D &= \frac{(\Delta\sigma_{\max})^m}{A}\cdot C \label{eq:constant}
\end{align}
Here is what you had:
\begin{align}
D &= \sum_{i}^{k}\frac{n_i}{\frac{A}({\Delta\sigma_i})^m} \nonumber \\
D &= \sum_{i}^{k}\frac{n_i}{\frac{A}({r_i*\Delta\sigma_{max}})^m} \nonumber \\
D &= \frac{(\Delta\sigma_{max})^m}{A} \sum_{i}^{k}\frac{n_i}{(r_i)^m} \nonumber \\
D &= \frac{(\Delta\sigma_{max})^m}{A} * C \label{eq:constant}
\end{align}
\end{document}

enter image description here

9
  • Thanks alot, it was the first version i would like to have.
    – user70916
    Jan 21, 2015 at 12:57
  • @user70916 EDITED to reflect your intent. Jan 21, 2015 at 13:18
  • 1
    I'd be tempted either to get rid of the asterisks entirely or to replace them \cdot.
    – Mico
    Apr 22, 2015 at 1:55
  • 1
    @yo' - For a good example of when to use thinspace instead of any kind of multiplication symbol, see the posting tex.stackexchange.com/q/239942/5001...
    – Mico
    Apr 22, 2015 at 23:03
  • 1
    @StevenB.Segletes Excuse me very much. :-( I have not seen the original question. I will delete all.
    – Sebastiano
    Feb 21, 2019 at 17:05
1

I corrected the placement of the parenthesis in your code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
D &= \sum_{i}^{k}\frac{n_i}{\frac{A}{(\Delta\sigma_i)^m}} \nonumber \\
D &= \sum_{i}^{k}\frac{n_i}{\frac{A}{(r_i*\Delta\sigma_{max})^m}} \nonumber \\
D &= \frac{(\Delta\sigma_{max})^m}{A} \sum_{i}^{k}\frac{n_i}{(r_i)^m} \nonumber \\
D &= \frac{(\Delta\sigma_{max})^m}{A} * C \label{eq:constant}
\end{align}
\end{document}

Result:

enter image description here

1

Here is how I would do it:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\noindent Either
\begin{align}
\label{eq:constant:A}
D &= \sum_{i = \cdots}^{k} \frac{n_{i} \cdot (\Delta\sigma_{i})^{m}}{A} \nonumber \\
  &= \sum_{i = \cdots}^{k} \frac{n_{i} \cdot (r_{i} \cdot \Delta\sigma_{\max})^{m}}{A} \nonumber \\
  &= \frac{(\Delta\sigma_{\max})^{m}}{A} \cdot \sum_{i = \cdots}^{k}\frac{n_{i}}{{r_{i}}^{m}} \nonumber \\
  &= \frac{(\Delta\sigma_{\max})^{m}}{A} \cdot C
\end{align}
or
\begin{align}
\label{eq:constant:B}
D &= \sum_{i = \cdots}^{k} \frac{n_{i}(\Delta\sigma_{i})^{m}}{A} \nonumber \\
  &= \sum_{i = \cdots}^{k} \frac{n_{i}(r_{i}\Delta\sigma_{\max})^{m}}{A} \nonumber \\
  &= \frac{(\Delta\sigma_{\max})^{m}}{A}\sum_{i = \cdots}^{k}\frac{n_{i}}{{r_{i}}^{m}} \nonumber \\
  &= \frac{(\Delta\sigma_{\max})^{m}}{A}C
\end{align}

\end{document}

output1

If the margins in your document are a bit smaller, you can consider doing the following:

\documentclass{article}

\usepackage{geometry}
\usepackage{mathtools}

\begin{document}

\noindent Another solutiuon using the \texttt{geometry} package to avoid the formulae going into the margin:
\begin{align}
\label{eq:constant:A}
D &= \sum_{i = \cdots}^{k} \frac{n_{i} \cdot (\Delta\sigma_{i})^{m}}{A}
   = \sum_{i = \cdots}^{k} \frac{n_{i} \cdot (r_{i} \cdot \Delta\sigma_{\max})^{m}}{A}
   = \frac{(\Delta\sigma_{\max})^{m}}{A} \cdot \sum_{i = \cdots}^{k}\frac{n_{i}}{{r_{i}}^{m}}
   = \frac{(\Delta\sigma_{\max})^{m}}{A} \cdot C
\intertext{or}
\label{eq:constant:B}
D &= \sum_{i = \cdots}^{k} \frac{n_{i}(\Delta\sigma_{i})^{m}}{A}
   = \sum_{i = \cdots}^{k} \frac{n_{i}(r_{i}\Delta\sigma_{\max})^{m}}{A}
   = \frac{(\Delta\sigma_{\max})^{m}}{A}\sum_{i = \cdots}^{k}\frac{n_{i}}{{r_{i}}^{m}}
   = \frac{(\Delta\sigma_{\max})^{m}}{A}C
\end{align}

\end{document}

output2

Notes:

  • There is only one D in each approach.
  • There is no fraction within a fraction in either approach.
  • In the solution at the top, the *s are replaced by \cdots.
  • In the solution at the bottom, all the \cdots are removed.

P.S. Rememeber to replace the \cdots.

You must log in to answer this question.

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