Math & ScienceEquation number position is wrong

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
yohan
Posts: 4
Joined: Thu Jan 28, 2010 6:33 am

Equation number position is wrong

Post by yohan »

Hi,


I am writing a paper in Latex. Everything looks fine, however the position of the equation number in two of my equations is wrong. I want the numbers on the right side of the page. But at this moment they are located under right under equation 1 and under left for equation 2.

The equations are:

\begin{equation}\label{1}
\[{\textbf{D} = \left[
\begin{array}{ccc}
#D_{xx} & #D_{xy} & #D_{xz} \\
#D_{yx} & #D_{yy} & #D_{yz} \\
#D_{zx} & #D_{zy} & #D_{zz} \\
\end{array}
\right]}\]
\end{equation}

And.

\begin{equation}\label{2}
\[{\textbf{\left[\epsilon_{i}}\epsilon_{i}^{T}\right]} = \left[
\begin{array}{ccc}
#\epsilon_{ix}^{2} & #\epsilon_{ix}\epsilon_{iy}} & #\epsilon_{ix}\epsilon_{iz} \\
#\epsilon_{ix}\epsilon_{iy} & #\epsilon_{iy}^{2} & #\epsilon_{iy}\epsilon_{iz} \\
#\epsilon_{ix}\epsilon_{iz} & #\epsilon_{iy}\epsilon_{iz} & #\epsilon_{iz}^{2}
\end{array} \right]} = \frac{1}{N}\displaystyle\sum_{j=1}^N \epsilon_{i}^j{\epsilon_{i}^{j}}^{T}\]
\end{equation}

The number of my other equations is at the correct position. I guess it has something to do with the array inside the equations. But I've been searching for the solution for a long time now and can not find any.

So I would really appreciate it if someone could help me out. Thank you very much in advance!


Yohan

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

yohan
Posts: 4
Joined: Thu Jan 28, 2010 6:33 am

Re: Equation number position is wrong

Post by yohan »

O yeah, the equations represent tensors (matrices)
yohan
Posts: 4
Joined: Thu Jan 28, 2010 6:33 am

Re: Equation number position is wrong

Post by yohan »

\documentclass[a4paper, leqno, fleqn,10pt]{article}

\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{fullpage}
\usepackage{float}
\usepackage{subfig}
\usepackage{fancyhdr}

\sloppy

\begin{document}

some extra info
magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

Re: Equation number position is wrong

Post by magicmoose »

If you want equation numbers on the right why are you using leqno in your documentclass options? Also, pleas post a complete compilable example, I tried putting all your fragments together but got lots and lots of errors with unbalanced brackets etc.
yohan
Posts: 4
Joined: Thu Jan 28, 2010 6:33 am

Re: Equation number position is wrong

Post by yohan »

Well, the leqno is accidently there becaue I was trying several different things to make everything look nice.
So indeed that should be changed into reqno or left away.

I have a lot of errors as well. But when I keep pressing enter, a nice document is produced. Except the floating numbers.

When I was making a complete compilable example, I copied the equations in a new Tex document and put some time in correcting errors. After that.. the numberes appeared on the right place, right on the page.

I can not believe that it worked. Because the tensors were displayed correctly and the only bad thing were the numbers. That's why I tried to fix the commands, but the problem was the math code.

Here is the correct version, only some brackets are removed:

\documentclass[a4paper, reqno, fleqn,10pt]{article}

\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{fullpage}
\usepackage{float}
\usepackage{subfig}
\usepackage{fancyhdr}

\sloppy

\begin{document}

\begin{equation}\label{3}
\kappa = 1 - \sqrt{\frac{\beta_{2}+\beta_{3}}{2\beta_{1}}}
\end{equation}

\begin{equation}\label{1}
\textbf{D} = \left[
\begin{array}{ccc}
D_{xx} & D_{xy} & D_{xz} \\
D_{yx} & D_{yy} & D_{yz} \\
D_{zx} & D_{zy} & D_{zz} \\
\end{array}
\right]
\end{equation}

\begin{equation}\label{2}
\left[\epsilon_{i}\epsilon_{i}^{T}\right] = \left[
\begin{array}{ccc}
\epsilon_{ix}^{2} & \epsilon_{ix}\epsilon_{iy} & \epsilon_{ix}\epsilon_{iz} \\
\epsilon_{ix}\epsilon_{iy} & \epsilon_{iy}^{2} & \epsilon_{iy}\epsilon_{iz} \\
\epsilon_{ix}\epsilon_{iz} & \epsilon_{iy}\epsilon_{iz} & \epsilon_{iz}^{2}
\end{array} \right] = \frac{1}{N}\displaystyle\sum_{j=1}^N \epsilon_{i}^j{\epsilon_{i}^{j}}^{T}
\end{equation}

\end{document}







Thanks for the help. It did the job.
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Equation number position is wrong

Post by kaiserkarl13 »

This is precisely why the forum rules ask you for a minimal working example---sometimes all you need to do is attempt to produce one and you solve the problem yourself!

Welcome to the community!
Post Reply