Math & Sciencesystem of equations won't get aligned

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
rayman
Posts: 24
Joined: Thu Feb 24, 2011 11:53 am

system of equations won't get aligned

Post by rayman »

I would like all components of each equation to be aligned with one another. The first 3 rows are ok, but the last two are not. What can be done to align them with the rest? I would like to stick to ''aligned'' if possible as I only want one numbering that is placed in the middle. I tried with begin split but it does not make any difference. Also is there a good way to produce a vertical line? Using \begin{vmatrix} produces too long vertical lines.

Code: Select all

\documentclass[11pt,a4paper,oneside]{report} 
\usepackage[pdftex]{graphicx} 
\usepackage[T1]{fontenc} 
\usepackage{fouriernc}
\usepackage{mathtools}
\usepackage{amsfonts,amsmath,amssymb,amsthm}
 \begin{document}
\begin{equation}
\begin{aligned}
&-\omega\cdot \alpha_{1}=\bigl|B_{1}A_{2}A_{3}\bigr|\cdot \alpha_{1}+\bigl|A_{1}B_{1}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{1}\bigr|\cdot \alpha_{3}
\\ 
&-\omega\cdot \alpha_{2}=\bigl|B_{2}A_{2}A_{3}\bigr|\cdot \alpha_{1}+\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}
\\
&-\omega\cdot \alpha_{3}=\bigl|B_{3}A_{2}A_{3}\bigr|\cdot \alpha_{1}+\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}
\\
&-\theta\cdot \alpha_{1}=\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}+\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}
\\
&-\theta\cdot \alpha_{1}=\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}+\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}
\end{aligned}
\end{equation}


\begin{equation}
\begin{split}
&-\omega\cdot \alpha_{1}=\bigl|B_{1}A_{2}A_{3}\bigr|\cdot \alpha_{1}+\bigl|A_{1}B_{1}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{1}\bigr|\cdot \alpha_{3}
\\ 
&-\omega\cdot \alpha_{2}=\bigl|B_{2}A_{2}A_{3}\bigr|\cdot \alpha_{1}+\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}
\\
&-\omega\cdot \alpha_{3}=\bigl|B_{3}A_{2}A_{3}\bigr|\cdot \alpha_{1}+\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}
\\
&-\theta\cdot \alpha_{1}=\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}+\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}
\\
&-\theta\cdot \alpha_{1}=\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}+\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}
\end{split}
\end{equation}
\end{document}
Thank you
Attachments
eq1.jpg
eq1.jpg (88.06 KiB) Viewed 5627 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

system of equations won't get aligned

Post by Johannes_B »

You can use multiple alignment hooks for the aligned environment. You may also have a look at array, which is basically a tabular in math mode.

Code: Select all

\documentclass[11pt,a4paper,oneside]{report}
\usepackage[pdftex]{graphicx}
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
\usepackage{mathtools}
\usepackage{amsfonts,amsmath,amssymb,amsthm}
\begin{document}
\begin{equation}
	\begin{array}{l@{\quad=\quad}c@{\enspace+\hspace{1cm}}cc}
		-\omega\cdot \alpha_{1}&\bigl|B_{1}A_{2}A_{3}\bigr|\cdot \alpha_{1}&\bigl|A_{1}B_{1}A_{3}\bigr|\cdot \alpha_{2}&+\bigl|A_{1}A_{2}B_{1}\bigr|\cdot \alpha_{3}
		\\
		-\omega\cdot \alpha_{2}&\bigl|B_{2}A_{2}A_{3}\bigr|\cdot \alpha_{1}&\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}&+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}
		\\
		-\omega\cdot \alpha_{3}&\bigl|B_{3}A_{2}A_{3}\bigr|\cdot \alpha_{1}&\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}&+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}
		\\
		-\theta\cdot \alpha_{1}&\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}&\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}&+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}
		\\
		-\theta\cdot \alpha_{1}&\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}&\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}&+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}
	\end{array}
\end{equation}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
rayman
Posts: 24
Joined: Thu Feb 24, 2011 11:53 am

system of equations won't get aligned

Post by rayman »

Thank you. Is it possible to remove the extra space in from of all +'s ? Also, the last two rows are still not aligned with the above ones (I refer here to the vertical bars...) I tried with alignat

Code: Select all

\documentclass[11pt,a4paper,oneside]{report} 
\usepackage[pdftex]{graphicx} 
\usepackage[T1]{fontenc} 
\usepackage{fouriernc}
\usepackage{mathtools}
\usepackage{amsfonts,amsmath,amssymb,amsthm} 
\begin{alignat*}{3}
  &-\omega\cdot \alpha_{1}=&&\bigl|B_{1}A_{2}A_{3}\bigr|\cdot \alpha_{1}+&&\bigl|A_{1}B_{1}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{1}\bigr|\cdot \alpha_{3}  \\
  &-\omega\cdot \alpha_{2}=&&\bigl|B_{2}A_{2}A_{3}\bigr|\cdot \alpha_{1}+&&\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3} \\
  & -\theta\cdot \alpha_{3}=&&\bigl|B_{3}A_{2}A_{3}\bigr|\cdot \alpha_{1}+&&\bigl|A_{1}B_{2}A_{3}\bigr|\cdot \alpha_{2}+\bigl|A_{1}A_{2}B_{2}\bigr|\cdot \alpha_{3}  \\
  &-\theta\cdot \alpha_{1}=&&\bigl|A_{1}B_{2}B_{3}\bigr|\cdot \alpha_{1}+&&\bigl|B_{1}A_{1}B_{3}\bigr|\cdot \alpha_{2}+\bigl|B_{1}B_{2}A_{1}\bigr|\cdot \alpha_{3}  
\end{alignat*}
which almost does everything except that in the last row, the second and the last column do not get alinged. Also no numbering is produced.
Attachments
eq3.jpg
eq3.jpg (35.22 KiB) Viewed 5622 times
Last edited by rayman on Fri Sep 12, 2014 12:20 pm, edited 2 times in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

system of equations won't get aligned

Post by Johannes_B »

You can split the tabular material at the vertical bars as well. The space between the columns is inserted inside the @{}. The alignment in each column is done with the regular specifiers c(entral), l(eft) and r(ight). But since the material inside the bars have different width (because of different kernings) you might have to tweak the output a little bit.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
rayman
Posts: 24
Joined: Thu Feb 24, 2011 11:53 am

Re: system of equations won't get aligned

Post by rayman »

Thank you.
Post Reply