3

This isn't necessarily a problem, but I wonder about it every time it occurs in my writing.

Horizontal matrices (or single row matrices) have thinner brackets and are differently put out than other matrices. Even Vertical matrices don't have this uniqueness.

Best shown with an example.

\documentclass[10pt,norsk, fleqn]{article}
\usepackage[a4paper, margin=1.2cm,includeheadfoot]{geometry}
\usepackage{amsmath}

\begin{document}
$\begin{aligned}
    \vec{x}\ '(t)   &= \textbf{A}\vec{x}(t) + \textbf{B}\vec{u}(t)\\
    \vec{y}(t)      &= \textbf{C}\vec{x}(t) + \textbf{D}\vec{u}(t)
\end{aligned}\ \ \ \to\ \ \ 
\begin{aligned}
    \dot{\textbf{x}} & = \begin{bmatrix}
        2&1&1\\3&-2&-2\\1&1&2
    \end{bmatrix}\vec{x} + 
    \begin{bmatrix}
        2\\1\\2
    \end{bmatrix}\vec{u}\\
    \vec{y} & = \begin{bmatrix}0&-1&-1\end{bmatrix}\vec{x}
\end{aligned}$
\end{document}

enter image description here

  • 1
    The thickness of the one-line braces and the horizontal positioning is in the font design. It may not be the same with all possible fonts, so trying to "fix" the definition of bmatrix (and friends) would not be advised. That said, if absolutely perfect alignment is desired, adding (very) small spaces (in mu units) just before and after the opening bracket and perhaps before the closing bracket should be possible. – barbara beeton Mar 27 at 15:57
3

The bvector environment was specifically set up to match 1 row to 3 row matrices.

\documentclass[10pt,norsk, fleqn]{article}
\usepackage[a4paper, margin=1.2cm,includeheadfoot]{geometry}
\usepackage{mathtools}

\newlength{\brackoff}
\sbox0{$\begin{bmatrix}\strut\end{bmatrix}$}
\sbox1{$\begin{bmatrix}\strut\\\strut\\\strut\end{bmatrix}$}
\setlength{\brackoff}{\dimexpr 0.25\wd1-0.25\wd0}

\newenvironment{bvector}%
  {\hspace{\brackoff}\begin{bmatrix}\hspace{\brackoff}}%
  {\hspace{\brackoff}\end{bmatrix}\hspace{\brackoff}}%

\begin{document}
$\begin{aligned}
    \vec{x}\ '(t)   &= \textbf{A}\vec{x}(t) + \textbf{B}\vec{u}(t)\\
    \vec{y}(t)      &= \textbf{C}\vec{x}(t) + \textbf{D}\vec{u}(t)
\end{aligned}\ \ \ \to\ \ \ 
\begin{aligned}
    \dot{\textbf{x}} & = \begin{bmatrix}
        2&1&1\\3&-2&-2\\1&1&2
    \end{bmatrix}\vec{x} + 
    \begin{bmatrix}
        2\\1\\2
    \end{bmatrix}\vec{u}\\
    \vec{y} & = \begin{bvector}0&-1&-1\end{bvector}\vec{x}\\
\end{aligned}$
\end{document}

demo

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.