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 used the split command to break my equation but I receive the error:

! Missing } inserted.
<inserted text> 
                }
l. \end {split}

The code in .tex file is as follows:

\begin{equation} \label{eq:5} 
\begin{split} 
A =1-&\frac{h_{FS}p_{I}p_{DN}p_{FS} +h_{F}p_{I}p_{DN}p_{F} + h_{UNC}p_{I}p_{UN}}{h_{G}+h_{V}+p_{I}(h_{I}+h_{DMC}p_{DM}+h_{UNC}p_{UN}+h_{UMC}p_{UM}+h_{DNC}p_{DN}+h_{FS}p_{DN}p_{FS} +\\
 &h_{GD}p_{DN}p_{GD} + h_{F}p_{DN}p_{F})}  
\end {split}
\end{equation}

Actually, I can see the produced equation in the PDF and it's
correct but this error exists. I want to submit my source file to a journal, but the PDF cannot be generated in the submission process. Any help is really appreciated.

share|improve this question
    
\begin{equation}\label{eq:5} \begin{split} A =1-&\frac{h_{FS}p_{I}p_{DN}p_{FS} +h_{F}p_{I}p_{DN}p_{F} + h_{UNC}p_{I}p_{UN}}{h_{G}+h_{V}+p_{I}(h_{I}+h_{DMC}p_{DM}+h_{UNC}p_{UN}+h_{UMC}p‌​_{UM}+h_{DNC}p_{DN}+h_{FS}p_{DN}p_{FS} +\\ &h_{GD}p_{DN}p_{GD} + h_{F}p_{DN}p_{F})} \end {split} \end{equation} –  Mary Sep 27 '12 at 2:20
    
You can't split the second part of a \frac on two line unless you put it inside something like a \parbox –  Peter Grill Sep 27 '12 at 2:23
add comment

4 Answers 4

You could use the \splitfrac instruction of the mathtools package to split the long denominator into two lines. Note that you needn't employ a split environment in this case. I've increased the size of the round parentheses used in the denominator (via \big instructions) to give them a bit more visibility.

enter image description here

\documentclass{article}
\usepackage{mathtools} % mathtools builds on and extends amsmath package
\begin{document}

\begin{equation} \label{eq:5} 
A = 1-\frac{h_{FS}p_{I}p_{DN}p_{FS} +h_{F}p_{I}p_{DN}p_{F} + h_{UNC}p_{I}p_{UN}}{
\splitfrac{h_{G}+h_{V}+p_{I}\big( h_{I}+h_{DMC}p_{DM}+h_{UNC}p_{UN}+h_{UMC}p_{UM}}
   {+h_{DNC}p_{DN}+h_{FS}p_{DN}p_{FS} +h_{GD}p_{DN}p_{GD} + h_{F}p_{DN}p_{F}\big)}}  
\end{equation}
\end{document}
share|improve this answer
add comment

The other answers give you what you wanted (+1 to both), but for what it's worth, I would consider tackling this using local definitions to make it a little easier to read

screenshot

\documentclass{article}
\usepackage{mathtools} % mathtools builds on and extends amsmath package
\begin{document}

\begin{equation} \label{eq:5} 
    A = 1-\frac{f(h,p)}{g(h,p)}
\end{equation}
where
\begin{align*}
    f(h,p) & =h_{FS}p_{I}p_{DN}p_{FS} +h_{F}p_{I}p_{DN}p_{F} + h_{UNC}p_{I}p_{UN}                                    \\
    g(h,p) & =h_{G}+h_{V}+p_{I}\left( h_{I}+h_{DMC}p_{DM}+h_{UNC}p_{UN}+h_{UMC}p_{UM}\right.                         \\
           & \phantom{ {}= } + \left. h_{DNC}p_{DN}+h_{FS}p_{DN}p_{FS} +h_{GD}p_{DN}p_{GD} + h_{F}p_{DN}p_{F}\right) 
\end{align*}
\end{document}
share|improve this answer
    
In the present case, the \left( ... \right. and \left. ... \right) don't actually increase the size of the parentheses. It may be better to use \big statements instead. –  Mico Sep 27 '12 at 13:47
    
@Mico thanks for the feedback; I view \big as a bit too manual though, perhaps that's just me :) –  cmhughes Sep 27 '12 at 15:58
    
Great answer, Chris! :) I think this is the cleanest way to tackle this expression. :) –  Paulo Cereda Sep 28 '12 at 1:08
    
@PauloCereda thanks a lot :) I always appreciate your positivity :) –  cmhughes Sep 28 '12 at 1:26
add comment

If you place the denominator of the \frac with a \parbox then you can have a new line in it:

enter image description here

Code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation} \label{eq:5} 
A =1-\frac{h_{FS}p_{I}p_{DN}p_{FS} +h_{F}p_{I}p_{DN}p_{F} + h_{UNC}p_{I}p_{UN}}{\parbox{4.2in}{$h_{G}+h_{V}+p_{I}(h_{I}+h_{DMC}p_{DM}+h_{UNC}p_{UN}+h_{UMC}p_{UM}+h_{DNC}p_{DN} +$ \\
 \hspace*{2.1cm}$h_{FS}p_{DN}p_{FS} + h_{GD}p_{DN}p_{GD} + h_{F}p_{DN}p_{F})$}} 
\end{equation}
\end{document}
share|improve this answer
add comment

Here's a TeXy way (amsmath will nag though if you're using it, IIRC.):

A = 1-{h_{FS}p_Ip_{DN}p_{FS} +h_Fp_Ip_{DN}p_F + h_{UNC}p_Ip_{UN}
  \over\displaystyle{
  h_G+h_V+p_I\big( h_I+h_{DMC}p_{DM}+h_{UNC}p_{UN}+h_{UMC}p_{UM}
  \atop\quad
  {}+h_{DNC}p_{DN}+h_{FS}p_{DN}p_{FS}+h_{GD}p_{DN}p_{GD}+h_Fp_{DN}p_F\big)}}

enter image description here

share|improve this answer
1  
Even if it doesn't change anything in this case, I'd use \bigl and \bigr instead of \big. –  Hendrik Vogt Sep 28 '12 at 7:54
add comment

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.