0

I don't know where the error in my equation or numbering code is, but everything is red. I tried fixing it, but as I am a newby with latex I didnt find a solution.

Can someone help me with that?

I want to number those equations: For the first one, I can see the equation number, but for the others it doesn't work..

\vspace{22pt}
\begin{centering}
\begin{equation}

    \begin{align}

        $\begin{array}{rrrr}
        m\textsubscript{11} & m\textsubscript{12} & m\textsubscript{13} & m\textsubscript{14} \\

        m\textsubscript{21} & m\textsubscript{22} & m\textsubscript{23} & m\textsubscript{24} \\

        m\textsubscript{31} & m\textsubscript{32} & m\textsubscript{33} & m\textsubscript{34} \\

        m\textsubscript{41} & m\textsubscript{42} & m\textsubscript{43} & m\textsubscript{44} \\
        \end {array}$
    \end{align}
\end{equation}

\begin{equation}
    \[ \left( \begin{array}{rrrr}
            0 & 0 & 1 & t\textsubscript{x} \\                                               
            -1 & 0 & 0 & t\textsubscript{y} \\                                               
            0 & -1 & 0 & t\textsubscript{z} \\   
            0 & 0 & 0 & 1 
    \end{array} \right)
    %
    \left( \begin{array}{rrrr}
                x \\
                y \\
                z \\
                1 \\
    \end{array} \right) 
    \]
\end{equation}
\end{centering}

\vspace{22pt}


\subsubsection{Translation matrix}
\par

TEXT

\begin{equation}

    \begin{align}

        \[ \left( \begin{array}{rrrr}
        0 & 0 & 1 & 5.39 \\                                               
        -1 & 0 & 0 & 6.26\\                                               
        0 & -1 & 0 & 4.275 \\   
        0 & 0 & 0 & 1 
        \end{array} \right)
        %
        \left( \begin{array}{rrrr}
                x \\
                y \\
                z \\
                1 \\
        \end{array} \right)
        \]
    \end{alignn}
\end{equation}
\vspace{22pt}

It looks like that:

enter image description here

8
  • Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. Jun 15, 2020 at 11:46
  • 2
    you can not have blank lines in equation, but also you should not have align inside equation, and do not surround it with \begin{centering} so just have \begin{equation} You do not want align here Jun 15, 2020 at 11:53
  • 1
    (1) no blank lines in math mode, (2) align inside equation does not make sense, (3) references to equation numbers are made using \label and \ref none of which are in this example
    – daleif
    Jun 15, 2020 at 11:53
  • for the later ones remove \[ do not ignore errors, if you get a tex error ask about the error message, not about the generated pdf (which is not intended to be usable after an error) Jun 15, 2020 at 11:57
  • I tried to change my code with your suggestions, but I still can't see the numbers.. and still a lot of red lines..
    – Anja
    Jun 15, 2020 at 11:59

1 Answer 1

3

With use of the mathtools and siunitx package and considering comments to your question, one of among possible solutions is:

\documentclass{article} 
\usepackage{mathtools}
\usepackage{siunitx}

\begin{document}
    \begin{equation}
\begin{pmatrix}
        m^{11} & m^{12} & m^{13} & m^{14} \\
        m^{21} & m^{22} & m^{23} & m^{24} \\
        m^{31} & m^{32} & m^{33} & m^{34} \\
        m^{41} & m^{42} & m^{43} & m^{44} \\
\end{pmatrix}
    \end{equation}

    \begin{equation}
\begin{pmatrix*}[r]
    0 &  0 & 1 & t\textsubscript{x} \\
   -1 &  0 & 0 & t\textsubscript{y} \\
    0 & -1 & 0 & t\textsubscript{z} \\
    0 &  0 & 0 & 1
\end{pmatrix*}\begin{pmatrix}
                x \\
                y \\
                z \\
                1 \\
            \end{pmatrix}
    \end{equation}

\subsubsection{Translation matrix}
TEXT

\begin{equation}
\left(\begin{array}{rrrS[table-format=1.3]}
    0 &  0 & 1 & 5.39 \\
   -1 &  0 & 0 & 6.26\\
    0 & -1 & 0 & 4.275 \\
    0 &  0 & 0 & 1
\end{array}\right)\begin{pmatrix}
                x \\
                y \\
                z \\
                1 \\
            \end{pmatrix}
    \end{equation}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .