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 am using the following code to have a long linear regression model in my two-column latex file. I have used figure * to avoid the overlapping of the equation with the second column. However, it doesn't look good to me. Could you please suggest me any better way for this.

\begin{figure*}[!t]
\begin{equation}
\label{eq:sf}
ua = (49.3) + (-13 * m\_a) + (-0.4 * k\_a) + (-1 * l\_b) + (8 * t\_b) + (-9 * s\_a)
\end{equation}
\end{figure*}
share|improve this question
    
Your code snippet won't compile (after suitable completion) since you are enclosing the equation inside a \mbox. Can you please add turn your code snippet into a minimal compilable example? (Please add the document class used and any relevant package). –  Gonzalo Medina Aug 1 '11 at 21:35
    
@Gonzalo: Could you please check now? –  samarasa Aug 1 '11 at 21:54
    
But you haven't provided the document class used. –  Gonzalo Medina Aug 1 '11 at 22:02
    
@Gonzalo: ACM sig-alternate class. –  samarasa Aug 1 '11 at 22:11
    
Then put it in your example so that people can copy and paste it. –  Alfred M. Jul 21 '12 at 10:07

2 Answers 2

up vote 2 down vote accepted

I am not sure exactly what the problem is, but does this help:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\newcommand{\op}{\,*\,}% Use \: instead of \, if you want larger space

\begin{document}
\begin{figure*}[!t]
\begin{align} 
ua = (49.3) + (-13 * m\_a) + (-0.4 * k\_a) \notag\\
    \phantom{=}+ (-1 * l\_b) + (8 * t\_b) + (-9 * s\_a) \label{eq:sf}
\end{align}

\begin{align} 
ua = (49.3) + (-13 \op m\_a) + (-0.4 \op k\_a) \notag\\
    \phantom{=}+ (-1 \op l\_b) + (8 \op t\_b) + (-9 \op s\_a) \label{eq:sf}
\end{align}

\end{figure*}
\end{document}

If you are looking to automatically break the equation that is a bit more complicated, and perhaps the breqn package may be useful to look into.

share|improve this answer
    
Thanks. Could you also help me to provide some space between the * operator and variables. –  samarasa Aug 1 '11 at 22:18
    
See updated solution. Is this what you are looking for? –  Peter Grill Aug 1 '11 at 22:25
    
Thank you for the code. –  samarasa Aug 1 '11 at 22:28

This may help:

\begin{equation}
  \begin{split}
    ua =&  (49.3) \\
        &+ (-13 * m\_a) \\
        &+ (-0.4 * k\_a) \\
        &+ (-1 * l\_b) \\
        &+ (8 * t\_b) \\
        &+ (-9 * s\_a)
  \end{split}
\end{equation}

You have to \usepackage{amsmath} in the preamble.

The Short Math Guide introduces in page 2 other useful environments for formatting equations.

share|improve this answer
    
Thank you for this simple and good solution. –  samarasa Aug 2 '11 at 2:45

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.