1

Question: I wish to separate given matrices, I mean A on left side and B on right side.

MWE

\documentclass[12pt, a4paper]{article}
\usepackage[top=0.8 in,bottom=0.8 in,left=0.7 in,right=0.6 in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document} 
$$A = \begin{bmatrix}
    1 & 0 & 0           \\[0.3em]
    0 & 1 & 0 \\[0.3em]
    0 & 0 & 1
\end{bmatrix}B = \begin{bmatrix}
1 & 0 & 0           \\[0.3em]
0 & 1 & 0 \\[0.3em]
0 & 0 & 1
\end{bmatrix}$$
\end{document}
Jan
  • 5,293
SandyM
  • 2,757

2 Answers2

1

You could insert either \qquad or \qquad\qquad to achieve some separation:

enter image description here

Incidentally, don't use $$ to initiate and terminate display math mode in a LaTeX document; use \[ and \] instead. For more on this subject, see the posting Why is \[ ... \] preferable to $$ ... $$

\documentclass[12pt, a4paper]{article}
\usepackage[vmargin=0.8in,left=0.7in,right=0.6in]{geometry}
\usepackage[utf8]{inputenc}
%\usepackage[misc]{ifsym} % this package is ancient
\usepackage{amsmath,amsfonts,amssymb}
\renewcommand\arraystretch{1.25}
\begin{document} 
\noindent
Separation by \verb+\qquad+:
\[
A = \begin{bmatrix}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1
\end{bmatrix}
\qquad
B = \begin{bmatrix}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1
\end{bmatrix}
\]
Separation by \verb+\qquad\qquad+:
\[
\renewcommand\arraystretch{1.25}
A = \begin{bmatrix}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1
\end{bmatrix}
\qquad\qquad
B = \begin{bmatrix}
    0 & 0 & 1 \\
    0 & 1 & 0 \\
    1 & 0 & 0
\end{bmatrix}
\]
\end{document}
Mico
  • 506,678
1

You can have the matrices at each margin with \flalign*, from amsmath. Incidentally, if you have several rows to align, you also can use align*, or alignat* to have control on the distance between the matrices:

    \documentclass[12pt, a4paper]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[vmargin=0.8in,left=0.7in,right=0.6in, showframe]{geometry}
    \usepackage{mathtools, amsfonts, amssymb}
    \renewcommand\arraystretch{1.25}

    \begin{document}

    \begin{flalign*}
\shortintertext{\texttt{With flalign*: }}
      A = \begin{bmatrix}
        1 & 0 & 0 \\
        0 & 1 & 0 \\
        0 & 0 & 1
    \end{bmatrix} & & & & & B = \begin{bmatrix}
        1 & 0 & 0 \\
        0 & 1 & 0 \\
        0 & 0 & 1
    \end{bmatrix}
    \end{flalign*}

    \begin{alignat*}{2}
\shortintertext{\texttt{With alignat*: }}
      & A = \begin{bmatrix}
        1 & 0 & 0 \\
        0 & 1 & 0 \\
        0 & 0 & 1
    \end{bmatrix} & \hspace{4em}& B = \begin{bmatrix}
        1 & 0 & 0 \\
        0 & 1 & 0 \\
        0 & 0 & 1
    \end{bmatrix}
    \end{alignat*}

    \begin{align*}
\shortintertext{\texttt{With align*: }}
      & A = \begin{bmatrix}
        1 & 0 & 0 \\
        0 & 1 & 0 \\
        0 & 0 & 1
    \end{bmatrix} & & B = \begin{bmatrix}
        1 & 0 & 0 \\
        0 & 1 & 0 \\
        0 & 0 & 1
    \end{bmatrix}
    \end{align*}

    \end{document} 

enter image description here

Bernard
  • 271,350