1

I have this aim output (without the annotations and am somewhat confused about the aligning. This is the code for this example:

\documentclass[10pt, a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[headheight=0cm,bindingoffset=0cm]{geometry}

\usepackage{amssymb}
\usepackage[fleqn,leqno]{amsmath}
\setlength{\mathindent}{\labelsep}
\addtolength{\mathindent}{1.165ex}
\openup 1.25\jot


% increase matriced formating options https://tex.stackexchange.com/questions/2233/whats-the-best-way-make-an-augmented-coefficient-matrix
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{
    \hskip -\arraycolsep
    \let\@ifnextchar\new@ifnextchar
    \array{#1}
}
\makeatother

\begin{document}
        \begin{align*}
            &\begin{pmatrix}[ccc|c]
                x & x & x & x \\
                x & x & x & x \\
                x & x & x & x \\
            \end{pmatrix} &\rightarrow
            \begin{pmatrix}[ccc|c]
                x & x & x & x \\
                x & x & x & x \\
                x & x & x & x \\
            \end{pmatrix}\\
            column1&column2&column3\\
            %
            &\begin{aligned}
                &\text{text} \\
                &r=-2 \\
                &\begin{pmatrix}[ccc|c]
                1 & x & x & x \\
                0 & x & x & x \\
                0 & x & x & x \\
            \end{pmatrix} &\rightarrow L=\varnothing \\
            %
                &\text{text:} \\
                &r=0 \\
                &\begin{pmatrix}[ccc|c]
                x & x & x & x \\
                x & x & x & x \\
                x & x & x & x \\
            \end{pmatrix} &\rightarrow L=
            \begin{pmatrix}[ccc|c]
                x \\
                x \\
                x \\
            \end{pmatrix}\\
                &\text{text:} \\
                &r=1 \\
                &\begin{pmatrix}[ccc|c]
                x & x & x & x \\
                x & x & x & x \\
                x & x & x & x \\
            \end{pmatrix} &\rightarrow L=
            \begin{pmatrix}[ccc|c]
                x \\
                x \\
                x \\
            \end{pmatrix}\\
            \end{aligned}\\
            &\text{text:}\\
            &\begin{pmatrix}[ccc|c]
                x & x & x & x \\
                x & x & x & x \\
                x & x & x & x \\
            \end{pmatrix} &\rightarrow L=
            \begin{pmatrix}[ccc|c]
                x \\
                x \\
                x \\
            \end{pmatrix}\\
        \end{align*}
\end{document}

I'd expect, that the first, second and forth elements would be aligned to where the aligned output ends (horizontally) and that the arrows inside the aligned environment would be horizontally aligned (which is in case of the first arrow not the case).

Somehow I don't get why this isn't what I'd expect it to look like, please help.

atticus
  • 557

1 Answers1

0

Edit: As follows from the OP comment, (s)he like to have the following result:

enter image description here

(red lines indicate text area borders)

Where in the last equations row is shown the case if the real text is longer than one line. For aligning is used alignat* environment.

\documentclass[a4paper]{article}
\usepackage[headheight=0cm,bindingoffset=0cm]{geometry}
\usepackage[T1]{fontenc}

\usepackage[fleqn,leqno]{amsmath}
\usepackage{amssymb}

\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{
    \hskip -\arraycolsep
    \let\@ifnextchar\new@ifnextchar
    \array{#1}}
\makeatother
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{alignat*}{4}
    &   \begin{pmatrix}[ccc|c]
        x & x & x & x \\
        x & x & x & x \\
        x & x & x & x 
        \end{pmatrix}   &&&  \rightarrow \begin{pmatrix}[ccc|c]
                                    x & x & x & x \\
                                    x & x & x & x \\
                                    x & x & x & x 
                                    \end{pmatrix}   \\[1ex]
    &   \rlap{text}                                 \\
    &   r=-2        &&& \\
    &   \begin{pmatrix}[ccc|c]
        1 & x & x & x \\
        0 & x & x & x \\
        0 & x & x & x 
        \end{pmatrix}   &   \rightarrow L & = \varnothing   &   \\[1ex]
    &   \rlap{text}     \\
    &    r=0        &&& \\
    &   \begin{pmatrix}[ccc|c]
            x & x & x & x \\
            x & x & x & x \\
            x & x & x & x 
        \end{pmatrix}   &   \rightarrow L & = \begin{pmatrix}[ccc|c]
                                                x \\
                                                x \\
                                                x
                                                \end{pmatrix}   &   \\[1ex]
    &   \rlap{text} \\
    &   r=1         &&& \\
    &    \begin{pmatrix}[ccc|c]
            x & x & x & x \\
            x & x & x & x \\
            x & x & x & x 
        \end{pmatrix}   &   \rightarrow L & = \begin{pmatrix}[ccc|c]
                                                x \\
                                                x \\
                                                x 
                                            \end{pmatrix}   &   \\[1ex]
    &   \rlap{\parbox[t]{0.9\linewidth}{text text text text text text text text text text text text text text text text text text text text text text text text}}\\[1ex]
    &  \begin{pmatrix}[ccc|c]
            x & x & x & x \\
            x & x & x & x \\
            x & x & x & x 
        \end{pmatrix}   &   \rightarrow L & = \begin{pmatrix}[ccc|c]
                                                x \\
                                                x \\
                                                x 
                                            \end{pmatrix}   &   \\  
    \end{alignat*}
\end{document}
Zarko
  • 296,517
  • Yea something like the second example but with \text{...} aligned to the left (aligned with the starting of the matrices) – atticus May 07 '20 at 10:19
  • @atticus, see edited answer. Is it now ok? – Zarko May 07 '20 at 11:36
  • Seems alright. My I didn't knew, that align would create columns (uneven column aligned right, even column aligned left). (Just being curious, is there a way to get some kind of a "columnborder" for the align(at)(ed) environment (for debugging purpose) like for the pages with the showframe package?) – atticus May 07 '20 at 12:00
  • @atticus, as far as I know, no. – Zarko May 07 '20 at 12:17
  • @Zarko If you are using amsmath then wouldn't it be better to use intertext and shortintertext? – oliversm May 07 '20 at 12:21
  • @oliversm,to my opinion the \shortintertext from the mathtools package should be correct solution, however, OP require that start of text be aligned at left border of matrices (what cause unnecessary complications). – Zarko May 07 '20 at 12:34