Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following equation (as you can see I have used split):

\begin{equation}\label{testequation}
\begin{split}
d_{m}^{\phi}\left(A,f\right)=\sqrt[m]{\mid A\left(pi\right)-f\left(pi\right)\mid^{4}+\sum_{i=1;i\neq pi}^{length\left(R\right)}\mid M\left(i\right)- \\ f\left(i\right)\mid^{7}}
\end{split}
\end{equation}

I want this part of the equation to be on a new line:

-f\left(i\right)\mid^{7}

And, as you can see, I have used \\. But, it didn't work, although I have used the same method for another formula in the same LaTex document and it worked.

What would be the issue here?

Thanks.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

It is because you can not split a square root. One way of resolve the problem is to use ()^{1/m} instead of \sqrt[m]{}:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
\begin{split}
d_{m}^{\phi}\left(A,f\right) = \left( \mid A\left(pi\right) - f\left(pi\right)\mid^{4} + \sum_{i=1;i\neq pi}^{length\left(R\right)} \mid M\left(i\right)+\right. \\
\left. \vphantom{\sum_{i=1;i\neq pi}^{length\left(R\right)}} -f\left(i\right)\mid^{7}\right)^{1/m}
\end{split}
\end{equation}
\end{document}

enter image description here

You can not either split parenthesis in two different rows, for this reason I used \right. and \left. to close and open the parenthesis without typing them. I also used the \vphantom command to insert an invisible sum in the second row in order to have the parenthesis with the same high in the two row.

By the way, in your situation I will split the equation just before the sum.

share|improve this answer

Another solution is as follows:

\documentclass{article}

\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclareMathOperator*\length{length}

\begin{document}

\begin{equation}
\begin{split}
  d_{m}^{\phi}(A,f)
  &= \Biggl(\abs{A(ip) - f(ip)}^{4}\\
  &\hphantom{{}= \Biggl(} + \sum_{i = 1 \neq p}^{\length(R)} \abs{M(i) \underbrace{+-}_{?} f(i)}^{7}\Biggr)^{\mkern -4mu 1/m}
\end{split}
\end{equation}

\end{document}

output

Comments:

(1) The point of the linebreak is not good.

(2) Don't use \mid as delimiter for absolute values; use \lvert and \rvert.

(3) I assume length is an operator; if I'm wrong, use \text{length} instead.

(4) Only use \left/\right constructions when needed; when add some extra horizontal space.

(5) In the summand, you have +-; this is a pointless statement.

(6) The statement i=1;i\neq pi seems rather wierd to me. If I'm not mistaken, this is the same as i = 1 \neq p.

(7) Use ip instead of pi; the latter can easily mislead one to think that you actually mean \pi but have forgotten the frontslash (\).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.