86

I can't seem to center equations without causing some weird formatting problem. The following results in the R being dropped:

\begin{center}
 E(R_{i,t})=E(\alpha_i)+E(\beta_{i,F_1 } F_{1,t})+E(\beta_{i,F_2 } F_{2,t})+\ldots+E(\beta_{i,F_m } F_{m,t})\linebreak
\bar{R}_{i,t}=a+\hat{\beta}_{i,F_1 } E(F_{1,t})+\hat{\beta}_{i,F_2 } E(F_{2,t})+\ldots+\hat{\beta}_{i,F_m } E(F_{m,t})\linebreak
\bar{R}_{i,t}=a+\gamma_1\hat{\beta}_{i,F_1 } +\gamma_2\hat{\beta}_{i,F_2 } F_{2,t}+\ldots+\gamma_m\hat{\beta}_{i,F_m }
\end{center}

Any ideas? Is {center} the wrong thing to use?

lockstep
  • 250,273
  • 6
    Equations in displayed math environments are centered by default, See, e.g., \[ 2+2=4 \]. Are you using the fleqn option to your document class? Please edit your question to show a complete minimal document. Besides document class options, it's isn't clear what math environment the above occurs in (if any!) But, yes \begin{center} ... \end{center} is definitely the wrong thing to use. – frabjous Jan 07 '11 at 03:46

3 Answers3

135

For a series of centered equations use the gather environment of amsmath:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
 E(R_{i,t})=E(\alpha_i)+E(\beta_{i,F_1 } F_{1,t})+E(\beta_{i,F_2 } F_{2,t})+
    \ldots+E(\beta_{i,F_m } F_{m,t})\\
\bar{R}_{i,t}=a+\hat{\beta}_{i,F_1 } E(F_{1,t})+\hat{\beta}_{i,F_2 } E(F_{2,t})+
    \ldots+\hat{\beta}_{i,F_m } E(F_{m,t})\\
 \bar{R}_{i,t}=a+\gamma_1\hat{\beta}_{i,F_1 } +\gamma_2\hat{\beta}_{i,F_2 } F_{2,t}+
    \ldots+\gamma_m\hat{\beta}_{i,F_m }
\end{gather*} 
\end{document}

alt text

Instead of centering you may consider to align all equations at the equal sign and center the whole multiline environment. For this, use the align or align* environment, see the amsmath user's guide (or type texdoc amsldoc at the command prompt).

In any case, use amsmath. That package provides many kinds of multiline diplayed formula environments.

Moriambar
  • 11,466
Stefan Kottwitz
  • 231,401
61

The center environment is for text, not math. What you want here is (this also lines up the equals signs):

\begin{align*}
  E(R_{i,t})    &= E(\alpha_i)+E(\beta_{i,F_1 } F_{1,t})+E(\beta_{i,F_2 } F_{2,t})+\ldots+E(\beta_{i,F_m } F_{m,t}) \\
  \bar{R}_{i,t} &= a+\hat{\beta}_{i,F_1 } E(F_{1,t})+\hat{\beta}_{i,F_2 } E(F_{2,t})+\ldots+\hat{\beta}_{i,F_m } E(F_{m,t}) \\
  \bar{R}_{i,t} &= a+\gamma_1\hat{\beta}_{i,F_1 } +\gamma_2\hat{\beta}_{i,F_2 } F_{2,t}+\ldots+\gamma_m\hat{\beta}_{i,F_m }
\end{align*}

You need the amsmath package for align*, so make sure you have the line \usepackage{amsmath} in your preamble (before \begin{document}).

Moriambar
  • 11,466
Sophie Alpert
  • 15,550
  • 9
  • 37
  • 37
0

The most simple way to center math is the use of backslash and square brakets

\[ k* {{n}\choose{k}} = n*{{n-1}\choose{k-1}}\]

  • 3
    The question doesn't deal with a single equation, but with multiple ones. – egreg Apr 30 '23 at 09:45
  • Yes, but anyway it rest the most simple way to do it, just repeating backslash and square brakets each line that also give the right space to formula and avoid problems f.ex. in Sum, Int... where the operator can be, viceversa, reduced in height. Thanks for the downvote, it is a pleasure to be here. – Stefano Maruelli Oct 31 '23 at 06:14
  • No, the vertical spacing between consecutive \[...\] displays is wrong. – egreg Oct 31 '23 at 07:55
  • Pls can you explain it better so we can all can understand ? I use it from long time. Thanks – Stefano Maruelli Nov 01 '23 at 08:11