Page Layout ⇒ Matrices on same line
-
- Posts: 2
- Joined: Wed Nov 25, 2009 2:54 pm
Matrices on same line
I have two 6x6 matrices in a latex document, and I want them to appear on the same line in the document. At the moment, the second one just sits below the first one. Can anyone help?
Thanks,
David
This is the code I have for the matrices:
\[ \left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1
\end{array} \right)\]
\[ \left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0
\end{array} \right)\]
Thanks,
David
This is the code I have for the matrices:
\[ \left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1
\end{array} \right)\]
\[ \left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0
\end{array} \right)\]
NEW: TikZ book now 40% off at Amazon.com for a short time.
Matrices on same line
Hi,
you could try something like the following:
you could try something like the following:
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1
\end{array} \right)
\left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0
\end{array} \right)
\end{equation*}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 2
- Joined: Wed Nov 25, 2009 2:54 pm
Re: Matrices on same line
Thanks for the reply.
Do you know how to space them out across the page more? I want the first one on the left, and the next one on the right of the page (maybe with a bullet point before each or something like '(a)' before the first one and '(b)' before the 2nd one.???
Do you know how to space them out across the page more? I want the first one on the left, and the next one on the right of the page (maybe with a bullet point before each or something like '(a)' before the first one and '(b)' before the 2nd one.???
Matrices on same line
You can modify gmedina's code slightly and put each matrix as a single element of a larger array, with (a) and (b) in the neighbouring cells and use \hspace{} to create a gap between the two, as big or small as you wish.
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{array}{cccc}
(a)&
\left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1
\end{array} \right)\hspace{0.2\textwidth}&
(b)&
\left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0
\end{array} \right)
\end{array}
\end{equation*}
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Matrices on same line
Code: Select all
\documentclass[11p4,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
(a)\quad &
\begin{pmatrix}
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1
\end{pmatrix} \qquad&
(b)\quad &
\begin{pmatrix}
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0
\end{pmatrix}
\end{alignat*}
\end{document}
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Matrices on same line
An alternative to localghost's suggestion:
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{flalign*}
(a)\quad &
\begin{pmatrix}
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1
\end{pmatrix} \qquad&
(b)\quad &
\begin{pmatrix}
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0
\end{pmatrix}
\end{flalign*}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...