How to Write Inline Matrix in Latex

How to Write Inline Matrix in Latex
\begin{pmatrix} 2  \\ 4  \\ -2  \end{pmatrix}

This is 3*1 vector matrix and i want to write another matrix or x and y s beside that one. Is there any method to write matrix inline ?

1

2 Answers

Are you using in-line delimiters around the math? E.g.,

$\begin{pmatrix} 2  \\ 4  \\ -2  \end{pmatrix}$

If you put another matrix inside these delimiters, they will be put in-line next to it. For instance, see this live example:

<script>
MathJax = {
  tex: {inlineMath: [['$','$']]}
}
</script>
<script src="" id="MathJax-script"></script>

This math is in line, $
\begin{pmatrix}
  a & b & c \\
  d & e & f \\
  g & h & i
\end{pmatrix}
\begin{pmatrix} 2\\ 4\\ -2 \end{pmatrix}
$, with text following it.

Simply put your code inside two dollar signs ($) and it's done.

$ \begin{pmatrix} 2  \\ 4  \\ -2  \end{pmatrix} $

Note that if you put double dollar signs ($$) it will write the matrix in a new line and then continues the rest of the sentence in the line after that.

$$ \begin{pmatrix} 2  \\ 4  \\ -2  \end{pmatrix} $$

Your Answer

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

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.