3

In the following MWE, the A and B matrices are perfectly aligned. However, the matrix C is aligning itself towards the right. How to align it towards the left?

  \begin{multline}
  A=
\begin{bmatrix}
0 & 1 & 0 & \cdots & 0\\
0 & 0 & 1 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots\\
0 & 0 & 0 & \cdots & 1 \\
-q_{0}&-q_{1}&-q_{2}&\cdots&-q_{n-1}
 \end{bmatrix}
  ,\,\,
  B=
  \begin{bmatrix}
   0 \\
   0  \\
   \vdots \\
    b_e
   \end{bmatrix}
   \\ 
  C =
  \begin{bmatrix}
   1 &b_1/b_0  &\cdots &b_{n-1}/b_0
   \end{bmatrix}
   \end{multline}
  • What is your desired result? Is it "to center the matrix in bmatrix environment" or "to align it [matrix C] towards the left"? – L. F. Feb 26 at 11:30
  • Align C towards left – ShiS Feb 26 at 11:31
  • Then how do you explain your title? – L. F. Feb 26 at 11:32
  • Sorry, by mistake. Done – ShiS Feb 26 at 11:37
  • multiline does not come with alignment. I would guess its intent is to right align the 2nd line, as if it were the continuation of a long equation. Perhaps you instead want some sort of align environment. – Steven B. Segletes Feb 26 at 11:45
1

You possibly want the row matrix to be centered with respect to the top block:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{gathered}
A=\begin{bmatrix}
  0 & 1 & 0 & \cdots & 0\\
  0 & 0 & 1 & \cdots & 0 \\
  \vdots & \vdots & \vdots & \ddots & \vdots\\
  0 & 0 & 0 & \cdots & 1 \\
  -q_{0}&-q_{1}&-q_{2}&\cdots&-q_{n-1}
\end{bmatrix}
,\quad
B=\begin{bmatrix} 0 \\ 0 \\ \vdots \\ b_e \end{bmatrix}
\\[2ex]
C = \begin{bmatrix} 1 & b_1/b_0 & \cdots & b_{n-1}/b_0 \end{bmatrix}
\end{gathered}
\end{equation}

\end{document}

enter image description here

If you want the equals signs to be aligned, use aligned:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{aligned}
A&=\begin{bmatrix}
  0 & 1 & 0 & \cdots & 0\\
  0 & 0 & 1 & \cdots & 0 \\
  \vdots & \vdots & \vdots & \ddots & \vdots\\
  0 & 0 & 0 & \cdots & 1 \\
  -q_{0}&-q_{1}&-q_{2}&\cdots&-q_{n-1}
\end{bmatrix}
,\quad
B=\begin{bmatrix} 0 \\ 0 \\ \vdots \\ b_e \end{bmatrix}
\\[2ex]
C&=\begin{bmatrix} 1 & b_1/b_0 & \cdots & b_{n-1}/b_0 \end{bmatrix}
\end{aligned}
\end{equation}

\end{document}

enter image description here

1

Use align* instead of multiline. Add some alignment tabs.

As commented, multiline does not come with alignment. I would guess its intent is to right align the 2nd line, as if it were the continuation of a long equation.

\documentclass{article}
\usepackage{amsmath}
%\usepackage{unicode-math}
\begin{document}
  \begin{align*}
  A&=
\begin{bmatrix}
0 & 1 & 0 & \cdots & 0\\
0 & 0 & 1 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots\\
0 & 0 & 0 & \cdots & 1 \\
-q_{0}&-q_{1}&-q_{2}&\cdots&-q_{n-1}
 \end{bmatrix}
  ,\,\,
  B=
  \begin{bmatrix}
   0 \\
   0  \\
   \vdots \\
    b_e
   \end{bmatrix}
   \\[8pt]
  C &=
  \begin{bmatrix}
   1 &b_1/b_0  &\cdots &b_{n-1}/b_0
   \end{bmatrix}
   \end{align*}

\end{document}

enter image description here

Also, instead of \,\,, you could replace with &, which would add more gap before the B matrix.

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.