Text FormattingEquation Formatting Problem

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
buttnana
Posts: 13
Joined: Mon Sep 28, 2009 10:36 pm

Equation Formatting Problem

Post by buttnana »

Hi,

I have a few questions regarding the format of equations, I have the following code.

Code: Select all

\begin{equation}
\center
$y_i_t$ = $\alpha_i$ + $\gamma_t$ + $X_i_t\beta$ + $\displaystyle\sum_h\sum_k\delta_k^hA_{kit}^h + \varepsilon_{it}$
\label{eq}
\end{equation}
and the output gives me something like the attached picture. I am wondering why there is such a big gap between the text and the equation, and how can I center only the equation while keeping the numbering flushed to the right?

Thank you!
Attachments
Please this picture for my output reference.
Please this picture for my output reference.
tex.jpg (30.85 KiB) Viewed 2417 times
Last edited by buttnana on Tue Nov 22, 2011 10:20 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Equation Formatting Problem

Post by torbjorn t. »

I'm surprised you got any output at all. The \center command isn't really defined, as far as I know, though there is a center environment. But you don't need that, as stuff within equation is centered anyway, unless you specify otherwise. Further, as equation is a displayed math environment, there is no need to use inline math ($...$) or \displaystyle within it -- everything in the environment is displayed math. Lastly, you need extra braces for x_i_t, I got an error message, so write x_{i_t} (Edit: On second thought, glancing at your picture, I guess you're really after x_{it}.).

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{equation}\label{eq}
y_{i_t} = \alpha_i + \gamma_t + X_{i_t}\beta \sum_h\sum_k\delta_k^hA_{kit}^h + \varepsilon_{it}
\end{equation}
\end{document}
2011-11-22_08-17-19.png
2011-11-22_08-17-19.png (16.81 KiB) Viewed 2420 times
buttnana
Posts: 13
Joined: Mon Sep 28, 2009 10:36 pm

Re: Equation Formatting Problem

Post by buttnana »

Ah, thank you. The math environment works like a charm!.
Post Reply