1

How can I center all columns in a multicolumn, multiline equation?

  1. The array environment:
    • Does not allow for multiple float numbers.
    • Does incorporate space between columns.
    • Does allow centering between columns.
    • Does allow use of multicolumn.
  2. The alignat environment:
    • Does allow for multiple float numbers.
    • Does not incorporate space between columns.
    • Does not allow centered columns.
    • Does not allow use of multicolumn.

The array environment already looks perfect. Is it possible to \tag each line of array with an incremented equation number?

Else, Is it possible to center and space columns in alignat?
Also, how can multicolumn be used in alignat?

All columns must have scope across all equations,
so using separate array environments is not enough.

MWE:

alignat: 0.1, 0.2
array: 0.3

enter image description here

\documentclass{scrreprt}
\usepackage{amsmath}

\begin{document}

\begin{alignat}{11}
\newcommand*\centermathcell[1]{\omit\hfil$\displaystyle#1$\hfil\ignorespaces}
%\begin{array}{7}
%\centermathcell{
K_{\ddot{\phi}}
%}
& \cdot 
\begin{bmatrix}
\ddot{\phi}_{x}\\
\ddot{\phi}_{y}\\
\end{bmatrix}
& + &
K_{\dot{\phi}} 
& \cdot 
\begin{bmatrix}
\dot{\phi}_{x}\\
\dot{\phi}_{y}\\
\end{bmatrix}
& + &
K_{\phi}
& \cdot 
\begin{bmatrix}
\phi_{x}\\
\phi_{y}\\
\end{bmatrix}
& = &
K_{v}
& \cdot
\begin{bmatrix}
v_{mtr.l}\\
v_{mtr.r}\\
\end{bmatrix}
%%
\\[+2em]
%%
I
& \cdot
\begin{bmatrix}
\ddot{\phi}_{x}\\
\ddot{\phi}_{y}\\
\end{bmatrix}
& = &
-K_{\ddot{\phi}}^{-1}
\cdot 
K_{\dot{\phi}} 
& \cdot 
\begin{bmatrix}
\dot{\phi}_{x}\\
\dot{\phi}_{y}\\
\end{bmatrix}
& + &
-K_{\ddot{\phi}}^{-1}
\cdot 
K_{\phi}
& \cdot 
\begin{bmatrix}
\phi_{x}\\
\phi_{y}\\
\end{bmatrix}
& + &
K_{\ddot{\phi}}^{-1}
\cdot 
K_{v}
& \cdot
\begin{bmatrix}
v_{mtr.l}\\
v_{mtr.r}\\
\end{bmatrix}
%\end{array}
%%
\end{alignat}




\vspace{+4em}




\begin{gather}
\begin{array}{ccccccccccc}
K_{\ddot{\phi}}
& \cdot 
\begin{bmatrix}
\ddot{\phi}_{x}\\
\ddot{\phi}_{y}\\
\end{bmatrix}
& + &
K_{\dot{\phi}} 
& \cdot 
\begin{bmatrix}
\dot{\phi}_{x}\\
\dot{\phi}_{y}\\
\end{bmatrix}
& + &
K_{\phi}
& \cdot 
\begin{bmatrix}
\phi_{x}\\
\phi_{y}\\
\end{bmatrix}
& = &
K_{v}
& \cdot
\begin{bmatrix}
v_{mtr.l}\\
v_{mtr.r}\\
\end{bmatrix}
%%
\\[+2em]
%%
I
& \cdot
\begin{bmatrix}
\ddot{\phi}_{x}\\
\ddot{\phi}_{y}\\
\end{bmatrix}
& = &
-K_{\ddot{\phi}}^{-1}
\cdot 
K_{\dot{\phi}} 
& \cdot 
\begin{bmatrix}
\dot{\phi}_{x}\\
\dot{\phi}_{y}\\
\end{bmatrix}
& + &
-K_{\ddot{\phi}}^{-1}
\cdot 
K_{\phi}
& \cdot 
\begin{bmatrix}
\phi_{x}\\
\phi_{y}\\
\end{bmatrix}
& + &
K_{\ddot{\phi}}^{-1}
\cdot 
K_{v}
& \cdot
\begin{bmatrix}
v_{mtr.l}\\
v_{mtr.r}\\
\end{bmatrix}
\end{array}
%%
\end{gather}

\end{document}

Notes:

This question is a continuation of here,
and was not solved by here.

kando
  • 1,338

1 Answers1

1

I think you are looking for the equationarray environment from the package eqnarray.

Sample output

\documentclass{scrreprt}

\usepackage{amsmath,eqnarray}

\begin{document}

\bgroup\arraycolsep 0.1em
\begin{equationarray}{*{11}{c}}
  K_{\ddot{\phi}} & \cdot
  \begin{bmatrix}
    \ddot{\phi}_{x}\\
    \ddot{\phi}_{y}\\
  \end{bmatrix}
  & + & K_{\dot{\phi}} & \cdot
  \begin{bmatrix}
    \dot{\phi}_{x}\\
    \dot{\phi}_{y}\\
  \end{bmatrix}
  & + & K_{\phi} & \cdot
  \begin{bmatrix}
    \phi_{x}\\
    \phi_{y}\\
  \end{bmatrix}
  & = & K_{v} & \cdot
  \begin{bmatrix}
    v_{\mathrm{mtr.l}}\\
    v_{\mathrm{mtr.r}}\\
  \end{bmatrix}
  \\[2em]
  I & \cdot
  \begin{bmatrix}
    \ddot{\phi}_{x}\\
    \ddot{\phi}_{y}\\
  \end{bmatrix}
  & = & -K_{\ddot{\phi}}^{-1} \cdot K_{\dot{\phi}} & \cdot
  \begin{bmatrix}
    \dot{\phi}_{x}\\
    \dot{\phi}_{y}\\
  \end{bmatrix}
  & + & -K_{\ddot{\phi}}^{-1} \cdot K_{\phi} & \cdot
  \begin{bmatrix}
    \phi_{x}\\
    \phi_{y}\\
  \end{bmatrix}
  & + & K_{\ddot{\phi}}^{-1} \cdot K_{v} & \cdot
  \begin{bmatrix}
    v_{\mathrm{mtr.l}}\\
    v_{\mathrm{mtr.r}}\\
  \end{bmatrix}
\end{equationarray}
\egroup

\end{document}

This environment also supports multicolumn:

Multicolumn example

\documentclass{article}

\usepackage{amsmath,eqnarray}

\begin{document}

\arraycolsep .16667em   %\thinspace
\begin{equationarray}{rcl@{\quad}rcl}
  x&=&y &u&=&v \\
  \multicolumn{3}{c@{\quad}}{xyz}&p&=&q
\end{equationarray}

\end{document}
Andrew Swann
  • 95,762