1

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*}
5
  • 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. – M. Toya Jul 21 '12 at 10:07
2

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.

2
  • 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
3

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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