normally you write a matrix something like this
\begin{align*}
\begin{pmatrix}
ele1 & ele2 & ele3 \\
longEle1 & longEle2 & longEle3
\end{pmatrix}
\end{align*}
the elements inside the matrix now will be centred to each other. With this little patch
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}
}
\makeatother
one is able to write matrices like this:
\begin{align*}
\begin{pmatrix}[rrr]
ele1 & ele2 & ele3 \\
longEle1 & longEle2 & longEle3
\end{pmatrix}
\end{align*}
and specify the alignment of the elements this way.
Now I'm searching for a way to redefine the default alignment in the array env (and therefore for matrices too) somehow.
From what I found out, it should be somewhere in the declaration of the array.sty
, but up to now, I didn't found it.
I found only this paragraph in the array doc (see https://www.ctan.org/pkg/array, page 31):
@tabarray
This macro tests for an optional bracket and then calls up
\@@array
or\@@array[c]
(as default).343
〈*package〉344\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
But changing this line in the /usr/share/texmf-dist/tex/latex/tools/array.sty
(in my version this was in line 324) didn't help.
Does someone know how to do this?