# How do I typeset a 2x2 matrix in an inline equation?

Consider:

 \documentclass[12pt]{amsart}
\usepackage{tikz}
\begin{document}
\subsection {\bfseries Shembulli i dyte, Matrica.}
Konsiderojm matricen
\begin{equation*}
a = \begin{pmatrix}1 & 1\\ 0 & 1\end{pmatrix}
\end{equation*}.
Per ndonje e numer te tipit integjer n do te kemi formen e pergjitheshme:
\end{document}


This equation: {equation*} a = \begin{pmatrix}1 & 1\\ 0 & 1\end{pmatrix}\end{equation*}

• – Werner Dec 27 '16 at 19:46

You could use the smallmatrix environment for inline math use:

 \documentclass[12pt]{amsart}
\begin{document}
\setcounter{section}{1} % just for this example
\subsection{Shembulli i dyte, Matrica.}
Konsiderojm matricen
$a = \bigl( \begin{smallmatrix}1 & 1\\ 0 & 1\end{smallmatrix}\bigr)$.
Per ndonje e numer te tipit integjer n do te kemi formen e pergjitheshme:
\end{document}


You can have a simpler way to type these matrices: use the psmallmatrix or psmallmatrix* command from mathtools. The starred version accepts as an optional argument the columns alignment ([r], [l] or the default [c]).

Similarly, you have the bsmallmatrix, Bsmallmatrix, vsmallmatrix or Vsmallmatrix environments.

\documentclass[12pt]{amsart}
\usepackage{mathtools}
\usepackage{nccmath}

\begin{document}

\subsection {\bfseries Shembulli i dyte, Matrica.}

Konsiderojm matricen
$a = \begin{psmallmatrix}-1 & -1\\ 0 & 1\end{psmallmatrix} \neq \begin{psmallmatrix*}[r]-1 & -1\\ 0 & 1\end{psmallmatrix*}$.
Per ndonje e numer te tipit integjer n do te kemi formen e pergjitheshme:
$\begin{pmatrix*}[r]-1 & -1\\ 0 & 1\end{pmatrix*}$%

\end{document}


Always use $for inline: $a = (\begin{matrix}1 & 1\\ 0 & 1\end{matrix})\$