Math & ScienceGeneral Linear Equation System

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
elim
Posts: 10
Joined: Fri Jan 14, 2011 3:59 pm

General Linear Equation System

Post by elim »

Trying to enter a general linear system like this one.
linear-system-01.gif
linear-system-01.gif (3.33 KiB) Viewed 8952 times
But it turns out like this (see the extra spaces here and there).
linear-system-02.gif
linear-system-02.gif (1.7 KiB) Viewed 8952 times
Here is my code:

Code: Select all

\[
  \begin{array}{ccl}
    a_{11}x_1 & + a_{12}x_2 + \cdots + & a_{1n}x = 0 \\
    \;\vdots &  &\quad\vdots \\
    a_{m1}x_1 &+ a_{m2}x_2 + \cdots +& a_{mn}x_n = 0
  \end{array}
  \tag{1}
\]
I used MathJax rendering LaTeX in web browser. But I think I did something wrong here.

Thanks for your help
Last edited by localghost on Wed Mar 06, 2013 10:43 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

General Linear Equation System

Post by Stefan Kottwitz »

You could use the alignedat environment of amsmath. This environment supports multiple alignment points over several lines.

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}
  \begin{equation}
    \begin{alignedat}{4}
      a_{11}x_1 &+ a_{12}x_2 &&+ \cdots   &&+ a_{1n}x   &&= 0 \\
      \;\vdots  &            &&\quad\vdots \\
      a_{m1}x_1 &+ a_{m2}x_2 &&+ \cdots   &&+ a_{mn}x_n &&= 0
    \end{alignedat}
  \end{equation}
\end{document}
linear-equation-system.png
linear-equation-system.png (4.17 KiB) Viewed 8975 times
Stefan
LaTeX.org admin
elim
Posts: 10
Joined: Fri Jan 14, 2011 3:59 pm

General Linear Equation System

Post by elim »

Thanks a lot Stefan_K!

I'll play with the environment then.
Post Reply