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.

Upon compiling, one of my equations extends out of my column width in my final output. Options I tried--

  1. breqn package asks for expl3.sty file which the compiler is unable to locate, (would have been the easiest way in the {dmath} environment
  2. // in the equation,
  3. {split}, {multiline} environment of amsmath but none of the 3 approaches seem to work.

Any tip from your Texperience(!)?

PS: I use latest version of TexnicCenter (+MikTeX 2.9) and the equation is in the {equation} environment right now.

share|improve this question
    
MikTeX should automatically install expl3. If not, you can always add it via its package manager. –  Caramdir Aug 6 '11 at 17:09
    
TeXnicCenter (TXC) has difficulties with automatic package installation. See MiKTeX 2.9 Issues for the details and a possible remedy. –  Thorsten Donig Aug 6 '11 at 17:12
    
I find it odd that // did not work. Are you perhaps using \[ \] for this equation in which case you can't use //? –  Peter Grill Aug 6 '11 at 17:26
1  
maybe it is because the correct syntax is \\ ? –  percusse Aug 13 '11 at 19:21
add comment

2 Answers

none of the 3 approaches seem to work

That is a bad sentence. Do you get any errors?

Here is an example of the documentation of amsmath with split

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}\label{e:barwq}
\begin{split}
 H_c&=\frac{1}{2n} \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2}
     \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} \binom{n_i}{l _i}\\
    &\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot
      \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr].
\end{split}
\end{equation}

\end{document}

A split equation using amsmath

share|improve this answer
    
Thanks everyone,have been struggling with it for almost 2 days now, but no success yet. Here are the results of your kind suggestions:@caramdir The pckge mgr shws an eror whle installing expl3 "Unknown archive file size", @Thorsten I am afraid I do not see how to change "MikTex Options",@Peter Yup, // doesn't work, could you pls explain what do you mean by...[ ] for this equation...?@Werner The problem/error I face when I use split is that no pdf output is created. Also for some mysterious reason my error output window has disappeared and can't get it via tools>wind>cmpl reslt. Cheers –  Abhimanyu Arora Aug 6 '11 at 23:18
    
@Thorsten posted a comment about "Unknown archive file size" of the expl3 package update using MiKTeX Package Manager suggesting that you Syncronize your repository. See/try his answer at the bottom of the link provided. –  Werner Aug 6 '11 at 23:51
    
@Abhimanyu: Did you include the amsmath package (for split, etc.)? –  Caramdir Aug 7 '11 at 2:55
    
Is there any way to put the reference number at the bottom of the equation? –  MOLi Oct 4 '13 at 9:52
1  
@MOLi: Yes. Therefore you don't need the environment split. You can work with align and \notag: tex.stackexchange.com/questions/26425/… –  Marco Daniel Oct 4 '13 at 9:56
add comment

This at least compiles and produces output. Removed the extra closing brace in \usepackage{breqn}} and the extra \ in \end{\equation}, and commented out the \begin{comment}, \end{comment} blocks. Plus I think you had some extra blank lines that I removed, and I think the quad was intended to be \quad. Hope this gets you going...

\documentclass{article}%
\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}
\usepackage{verbatim}
\usepackage{breqn}
%-------------------------------------------

\begin{document}
%this equation 1 is ok
    \begin{equation}
        g\left[Pr(happy_{im}=1)\right]=\alpha_{0i}+\alpha_{1}.\left|living\_shock_{im}\right|+\epsilon_{im}
        \label{Original}
    \end{equation}
%this equation 2 is ok
\begin{equation}
        g\left[Pr(happy_{im}=1)\right]=\alpha_{0i}+\alpha_{1}.\left|living\_shock_{im}\right|+\beta.{year}+\epsilon_{im}
        \label{yearlytrend}
    \end{equation}


%to split3
%have commented it out as no pdf output is produced otherwise
%\begin{comment}
\begin{equation}
\begin{split}
        g\left[Pr(happy_{im}=1)\right]=\alpha_{0i}+\alpha_{1}.
            \left|living\_shock_{im}\right|+\\
        \quad+\beta.{year}+\gamma.region.
            \left|living\_shock_{im}\right|+\delta{region}+\epsilon_{im}
        \label{region}
\end{split}
\end{equation} 
%\end{comment}

%again no output produced when {dmath} environment of breqn used; commented out
%\begin{comment}
%to split4
\begin{dmath}
g\left[Pr(happy_{im}=1)\right]=\alpha_{0i}+\alpha_{1}.\left|
    living\_shock_{im}\right|+\beta.{year}+//+\gamma.demo_{iy}.\left|
    living\_shock_{im}\right|+\delta_{iy}.demo_{iy}+\epsilon_{im}
    \label{demo}
\end{dmath}
%\end{comment}

%to split5
\begin{equation}
\begin{split}
        g\left[Pr(happy_{im}=1)\right]=\alpha_{0i}+\alpha_{1}.\left|living\_shock_{im}\right|+\beta.{year}+\gamma_{1}.demo_{iy}.\\
\left|living\_shock_{im}\right|+\gamma_{2}.urbanpop\%_{iy}.\left|living\_shock_{im}    \right|+\delta_{1}.demo_{iy}+\delta_{2}.urbanpop\%_{iy}+\delta_{3}.population+\epsilon_{im}
        \label{size}
\end{split}
\end{equation}

\end{document}
share|improve this answer
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.