1

I need to create the next set of equations in latex, at the moment the only thing I know is to create them independently but I need to place them as you can see in the attached image, thank you very much.

And I also need to label the equation.

\[
Roberts=\begin{cases}
           G_x = \begin{pmatrix}
                    1 & 0\\
                    0 & -1
                \end{pmatrix}\\
                
           G_y = \begin{pmatrix}
                    0 & 1\\
                    -1 & 1
                \end{pmatrix}\\
        \end{cases}
\]

\[
Prewitt=\begin{cases}
           G_x = \begin{pmatrix}
                    1 & 0 & -1\\
                    1 & 0 & -1\\
                    1 & 0 & -1
                \end{pmatrix}\\
                
           G_y = \begin{pmatrix}
                    1 & 1 & 1\\
                    0 & 0 & 0\\
                    -1 & -1 & -1
                \end{pmatrix}\\
        \end{cases}
\]

\[
Sobel=\begin{cases}
           G_x = \begin{pmatrix}
                    -1 & 0 & -1\\
                    -2 & 0 & 2\\
                    -1 & 0 & 1
                \end{pmatrix}\\
                
           G_y = \begin{pmatrix}
                    1 & 2 & 1\\
                    0 & 0 & 0\\
                    -1 & -2 & -1
                \end{pmatrix}\\
        \end{cases}
\]

enter image description here

1
3

enter image description here

(red lines show text borders)

You need to write your cases in one equation. Note: this equation is quite long and may happen that will spill out of border in your document ...

\documentclass{article}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}                             % for dummy text
%---------------------------------------------------------------%

\usepackage[margin=25mm]{geometry}
\usepackage{amsmath}
 
\begin{document}
\lipsum[11]
\begin{equation}                  % changed
       \setlength\arraycolsep{3pt}% added
\text{Roberts}
    =\begin{cases}
           G_x = \begin{pmatrix}
                    1 & 0\\
                    0 & -1
                \end{pmatrix}\\[3ex]
           G_y = \begin{pmatrix}
                    0 & 1\\
                    -1 & 1
                \end{pmatrix}
        \end{cases}
\text{Prewitt}
    =\begin{cases}
           G_x = \begin{pmatrix}
                    1 & 0 & -1\\
                    1 & 0 & -1\\
                    1 & 0 & -1
                \end{pmatrix}\\[4ex]
           G_y = \begin{pmatrix}
                    1 & 1 & 1\\
                    0 & 0 & 0\\
                    -1 & -1 & -1
                \end{pmatrix}
        \end{cases}
\text{Sobel}
    =\begin{cases}
           G_x = \begin{pmatrix}
                    -1 & 0 & -1\\
                    -2 & 0 & 2\\
                    -1 & 0 & 1
                \end{pmatrix}\\[4ex]
           G_y = \begin{pmatrix}
                    1 & 2 & 1\\
                    0 & 0 & 0\\
                    -1 & -2 & -1
                \end{pmatrix}
        \end{cases}
\end{equation}
\lipsum[12]
\end{document}

Edit: Now equation has number. Also are changed size of \arraycolsep that equation can fit in determined page layout in above MWE,

3
  • And how can I label it and put the typical number of the equations? Thank you – Alejandro Fernández Suárez Oct 9 '20 at 17:45
  • @AlejandroFernándezSuárez,as any numbered equation; instead \[ and \] use \begin{equation} and \end{equation respectively. See edited answer. – Zarko Oct 9 '20 at 17:59
  • Oh yes! That's perfect! Thank you so much for all – Alejandro Fernández Suárez Oct 10 '20 at 12:31

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.