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?

1
  • 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
    Commented Jan 7, 2011 at 3:46

3 Answers 3

136

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.

7
  • how do I have single equation number exactly in the middle? I don't want to use `\nonumber'
    – John Smith
    Commented Jan 7, 2013 at 2:48
  • @JohnSmith Use an equation environment, within that use an aligned or split environment.
    – Stefan Kottwitz
    Commented Jan 7, 2013 at 6:56
  • 1
    I tried that before but with aligned or split within equation environment the equations are aligned to the right. I want centering+single equation number. Any ideas?
    – John Smith
    Commented Jan 7, 2013 at 8:29
  • 6
    @JohnSmith With aligned or split use & for marking an alignment position (relation symbol). For centering, use gathered within equation.
    – Stefan Kottwitz
    Commented Jan 7, 2013 at 9:20
  • 1
    Gathered and upvoted ;) Commented Mar 30, 2022 at 10:11
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}).

1
  • Great Sophie! I didn't consider this point of view till I see this answer.
    – Mikasa
    Commented Jun 11, 2021 at 18:04
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}}\]

4
  • 3
    The question doesn't deal with a single equation, but with multiple ones.
    – egreg
    Commented Apr 30, 2023 at 9: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. Commented Oct 31, 2023 at 6:14
  • No, the vertical spacing between consecutive \[...\] displays is wrong.
    – egreg
    Commented Oct 31, 2023 at 7:55
  • Pls can you explain it better so we can all can understand ? I use it from long time. Thanks Commented Nov 1, 2023 at 8:11

You must log in to answer this question.