Graphics, Figures & TablesHow to extend the equation alignment a little bit?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
wolfrain
Posts: 20
Joined: Wed Aug 25, 2010 2:42 am

How to extend the equation alignment a little bit?

Post by wolfrain »

Hi all,

I have a quite long equation in my work, and unfortunately it extends 'too right' to the paper alignment with respect to the page number in the header.
Capture.PNG
Capture.PNG (17.67 KiB) Viewed 2572 times
Is there any command to make it centered without aligning to that right?

Code: Select all

\begin{equation*}
\begin{matrix}
\ i = 1 : & \begin{vmatrix} a_{32} & a_{33} & a_{34} \\ a_{22} & a_{23} & a_{24} \\ a_{12} & a_{13} & a_{14} 												\end{vmatrix}	& & & & & \\
\ i = 2 : & \begin{vmatrix} a_{31} & a_{33} & a_{34} \\ a_{21} & a_{23} & a_{24} \\ a_{11} & a_{13} & a_{14} 												\end{vmatrix} & \emph{compare with} & 
						\begin{vmatrix} a_{31} & a_{32} & a_{33} \\ a_{21} & a_{22} & a_{23} \\ a_{11} & a_{12} & a_{13} 												\end{vmatrix}	& \implies 
					& \begin{tabular}{c|ccc}
						\backslashbox[6pt][l]{i}{j} & 1 & 2 & 3\\\hline
						1 & 1 & 1 & 1 \\	
						2 & 0 & 1 & 1 \\	
						3 & 0 & 0 & 1 \\
						4 & 0 & 0 & 0
						\end{tabular}	
						\xRightarrow[Table]{Simplified}
					& \begin{tabular}{|c|c|c|}
						\hline
						1 & 1 & 1 \\	\hline
						0 & 1 & 1 \\	\hline
						0 & 0 & 1 \\	\hline
						0 & 0 & 0	\\	\hline
						\end{tabular}	\\
\ i = 3 : & \begin{vmatrix} a_{31} & a_{32} & a_{33} \\ a_{21} & a_{22} & a_{23} \\ a_{11} & a_{12} & a_{13} 												\end{vmatrix} & & & & 
\end{matrix}
\end{equation*}

EDIT: Also, can we include tabular or matrix equation (not the 'envioronment' but things like \begin{matrix} ... \end{matrix}) in environment figure?

Basically I want to programme some matrix equation, but instead of referring as equation, figure reference is needed. So I am thinking putting \begin{matrix} ... \end{matrix} in \begin{figure} ... \end{figure}, but it doesn't work...

Code: Select all

\begin{figure}
\begin{matrix} 
... 
\end{matrix}
\end{figure}
Any idea?

Thank you :)
wolfrain
Last edited by wolfrain on Wed Sep 08, 2010 2:42 pm, edited 1 time in total.

Recommended reading 2024:

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

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

wolfrain
Posts: 20
Joined: Wed Aug 25, 2010 2:42 am

How to extend the equation alignment a little bit?

Post by wolfrain »

With my friends' assistance,
1) Question 1

I find a way to move it a little left using

Code: Select all

\hspace{-3cm}
\begin{minipage}[c]{\linewidth}
\begin{equation*}
\begin{matrix}
                ...
\end{matrix}
\end{equation*}
\end{minipage}
And it works fine.

2) Question 2
If you want to add caption to matrix equation, just do this:

Code: Select all

\begin{figure}[!htbp]
$
\begin{matrix}
                ...
\end{matrix}
$
\caption{bla bla...}
\end{figure}
and it will refer it as figure.


3) New question... (asking for help...)
However, on top of that, what I want to do next is combine these two bits of code together. Like, because I have a very long matrix, as shown in the first reply, I need to use \minipage{}; and I also want to add caption to my matrix and refer the whole bit as figure, so I needs to use \begin{figure} ... \end{figure}.

Code: Select all

\hspace{-2cm}
\begin{minipage}[c]{\linewidth}
%\footnotesize
\begin{figure}[!htbp]
$
\begin{matrix}
...
\end{matrix}
$
\caption{bla...}
\label{fig:bla...}
\end{figure}
\end{minipage}
But the compiler looks unhappy with this, saying:

Code: Select all

! LaTeX Error: Not in outer par mode.
! Undefined control sequence.
! Missing number, threated as zero
all of them are pointing at the \begin{figure}[!htbp]

I am under big pressure...:cry: :cry:
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to extend the equation alignment a little bit?

Post by gmedina »

Hi,

you could use something like the following:

Code: Select all

\documentclass{book}
\usepackage{caption}

\begin{document}

\hspace*{-2cm}
\begin{minipage}[c]{\linewidth}
\footnotesize
$
\begin{matrix}
...
\end{matrix}
$
\captionof{figure}{bla...}
\label{fig:bla...}
\end{minipage}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
wolfrain
Posts: 20
Joined: Wed Aug 25, 2010 2:42 am

How to extend the equation alignment a little bit?

Post by wolfrain »

gmedina wrote:Hi,

you could use something like the following:

Code: Select all

\documentclass{book}
\usepackage{caption}

\begin{document}

\hspace*{-2cm}
\begin{minipage}[c]{\linewidth}
\footnotesize
$
\begin{matrix}
...
\end{matrix}
$
\captionof{figure}{bla...}
\label{fig:bla...}
\end{minipage}

\end{document}

Thank you mate!
It works fine so far! :D :D
Post Reply