1

I have a large matrix with 2 small matrices and I try to align it in the following way:

enter image description here

I had like matrix C to be under B instead of in a new row.

The code now is:

\begin{center}
\begin{tabular}{ c  c }\hspace*{-1.5cm}
$A^{T}(t)=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 \\       
    0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & -\frac{1}{\tau} & 0 \\  
    0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & -\frac{1}{\tau} \\                      
\end{bmatrix}
\qquad
B^{T}(t)=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} \\
\end{bmatrix}$
\\
\\
$C(t)=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0
\end{bmatrix}$
\end{tabular}
\end{center}

Thank you!

  • 1
    Why exactly do you use a tabular, if you do not use it? And please make your example compilable. – TeXnician Oct 21 '17 at 11:55
  • the tabular is there because B is in a different column, however not sure hot to make 2 rows in 1 column while in the other there is only 1 row. – Ben Oct 21 '17 at 12:20
  • You did NOT put B in a different column (\qquad is just space, no different column). If you'd put it into the second column you could put C below, e.g. using the multirow package. – TeXnician Oct 21 '17 at 12:26
0

This is still 70pt too wide, but you haven't said how wide your page is, so perhaps it may work...

enter image description here

\documentclass[a4paper]{article}

\usepackage{amsmath}
\setcounter{MaxMatrixCols}{20}

\begin{document}

something
\[\setlength\arraycolsep{3pt}
A^{T}(t)=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 \\       
    0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & -\frac{1}{\tau} & 0 \\  
    0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & -\frac{1}{\tau} \\                      
\end{bmatrix}
%
\begin{aligned}
B^{T}(t)&=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} \\
\end{bmatrix}\\
C(t)&=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0
\end{bmatrix}
\end{aligned}
\]

\end{document}
2

Unless either your document's text block is unusually wide or you're willing to use a very small font size, it's not likely that the matrix expressions for B and C will fit to the right of the expression for A

I would use a simple align* environment to typeset the three matrices, one below the other.

enter image description here

\documentclass{article}
\usepackage{mathtools}
\setcounter{MaxMatrixCols}{13}
\newcommand\trans{^{T\mkern-5mu}} % transpose oper.

\begin{document}
\begin{align*}
A\trans(t) &=
\begin{bmatrix*}[r]
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 \\       
    0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & -\frac{1}{\tau} & 0 \\  
    0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & -\frac{1}{\tau} \\                      
\end{bmatrix*} \\
B\trans(t) &=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} \\
\end{bmatrix} \\
C(t) &=
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0
\end{bmatrix}
\end{align*}

\end{document}
2

It hardly fits text width. I can do it using the mmatrix environment from nccmath (medium-sized matrices), reducing the value of \arraycolsep and loading geometry to have more a sensible outer margin. I also used the bmatrix* environment fom mathtools, which accepts an optional argument for the alignment of the columns (in my opinion, right-aligned looks better, due to the signs in some columns):

    \documentclass{article}
    \usepackage{mathtools, nccmath, bigstrut}
\usepackage[showframe]{geometry}
\setcounter{MaxMatrixCols}{20}

    \begin{document}

\[ \setlength{\arraycolsep}{5pt}
  A^{T}(t) =
\begin{mmatrix}
\begin{bmatrix*}[r]
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \bigstrut[t]\\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 & \mathllap{-\mkern-1.5mu}1 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 1 & 0 & 0 & 0 & \mathllap{-\mkern-1.5mu}1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & \mathllap{-\mkern-1.5mu}\frac{1}{\tau} & 0 \\
    0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & \mathllap{-\mkern-1.5mu}\frac{1}{\tau}\bigstrut[b] \\
\end{bmatrix*}
\end{mmatrix}
\quad
 \begin{aligned}
B^{T}(t) & =
\begin{mmatrix}
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} & 0 \bigstrut[t]\\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} \\
\end{bmatrix}
\end{mmatrix}
\\
\\
C(t) & =
\begin{mmatrix}
\begin{bmatrix}
    0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \bigstrut[t]
\end{bmatrix}
\end{mmatrix}
\end{aligned}
\]

\end{document} 

enter image description here

0

I did what you supposed to want using array instead of bmatrix + tabular. By the way, if you use these three matrix with the default font size of LaTeX, the paper margins have to be reduced. I used:

\usepackage{geometry}
\geometry{a4paper,left=5mm,top=5mm,bottom=5mm,right=5mm}

\begin{document}

\begin{center}

$A^{T}(t)=\left[\begin{array}{c c c c c c c c c c c c c}
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 \\       
    0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\        
    0 & 0 & 0 & 1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\   
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\    
    0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & -\frac{1}{\tau} & 0 \\  
    0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & -\frac{1}{\tau} \\  
\end{array}\right]
\qquad
\begin{array}{l} {B^{T}(t)= \left[\begin{array}{c c c c c c c c c c c c c}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau} & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{\tau}  \end{array}\right]} \\
\\
{C(t)=\left[\begin{array}{c c c c c c c c c c c c c}
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \end{array} \right]} \end{array}$

\end{center}

\end{document}

The result was:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.