3

I am trying to reproduce that :

enter image description here And so far this is what I have (MWE) :

\documentclass[]{article}

\usepackage{bm,amssymb,amsmath,colortbl}

% bold in math mode
\newcommand{\matr}[1]{\bm{#1}}
% Plücker transforms
\newcommand{\rx}[1]{\text{rx}(#1)}
\newcommand{\ry}[1]{\text{ry}(#1)}
\newcommand{\rz}[1]{\text{rz}(#1)}
\newcommand{\rot}[1]{\text{rot}(#1)}
\newcommand{\xlt}[1]{\text{xlt}(#1)}
\newcommand{\rotx}[1]{\text{rotx}(#1)}
\newcommand{\roty}[1]{\text{roty}(#1)}
\newcommand{\rotz}[1]{\text{rotx}(#1)}

\begin{document}

\begin{table}[ht]
    \caption{Légende}
    \centering
    \begin{tabular}{ m{4cm} m{4cm} m{4cm}}
        \hline
        \begin{equation*} \rx{\theta}=\begin{bmatrix}1&0& 0\\ 0&c&s\\0&-s&c\end{bmatrix} \end{equation*} &
        \begin{equation*} \ry{\theta}=\begin{bmatrix}c&0&-s\\ 0&1&0\\s& 0&c\end{bmatrix} \end{equation*} & 
        \begin{equation*} \rz{\theta}=\begin{bmatrix}c&s& 0\\-s&c&0\\0& 0&1\end{bmatrix} \end{equation*} \\
        \begin{equation*} \text{Avec : } c = \cos(\theta)\text{, } s = \sin(\theta)     \end{equation*} \\
        \begin{equation*} 
        \rot{\matr{E}} = \begin{bmatrix} \matr{E} & \matr{0} \\ \matr{0} & \matr{E}  \end{bmatrix}
        \end{equation*} &
        \begin{equation*}
        \xlt{\matr{p}} = \begin{bmatrix} \matr{1} & \matr{0} \\ -\matr{p} \times & \matr{1} \end{bmatrix}
        \end{equation*} &
        {\begin{tabular}{m{1cm}}
                \begin{equation*}\rotx{\theta} = \rot{\rx{\theta}}\end{equation*} \\ [-1.5cm]
                \begin{equation*}\roty{\theta} = \rot{\ry{\theta}}\end{equation*} \\ [-1.5cm]
                \begin{equation*}\rotz{\theta} = \rot{\rz{\theta}}\end{equation*} \\ 
        \end{tabular}} \\
        \hline
    \end{tabular}
    %\label{tab:}
\end{table}

\end{document}

I am having trouble with spacing and alignments : enter image description here Can anyone help ?

Titouan

1
  • Two very good answers.
    – Dawi
    Commented May 15, 2020 at 21:42

3 Answers 3

3

You can make a one column table (for the rules) and fill the contents manually.

\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}

\usepackage{amsmath,amssymb,bm} % bm after amsmath
\usepackage{booktabs}

% bold in math mode
\newcommand{\matr}[1]{\bm{#1}}
% Plücker transforms
\DeclareMathOperator{\rx}{rx}
\DeclareMathOperator{\ry}{ry}
\DeclareMathOperator{\rz}{rz}
\DeclareMathOperator{\rot}{rot}
\DeclareMathOperator{\xlt}{xlt}
\DeclareMathOperator{\rotx}{rotx}
\DeclareMathOperator{\roty}{roty}
\DeclareMathOperator{\rotz}{rotz}

\begin{document}

\begin{table}[ht]
\centering

\caption{Légende}\label{heregoesalabel}

\begin{tabular}{@{}p{\textwidth}@{}}
\toprule
$\rx(\theta)=\begin{bmatrix}1&0& 0\\ 0&c&s\\0&-s&c\end{bmatrix}$\hfill
$\ry(\theta)=\begin{bmatrix}c&0&-s\\ 0&1&0\\s& 0&c\end{bmatrix}$\hfill
$\rz(\theta)=\begin{bmatrix}c&s& 0\\-s&c&0\\0& 0&1\end{bmatrix}$

\medskip

Avec : $c = \cos(\theta)$, $s = \sin(\theta)$

$\begin{array}{@{}c@{}}
  \rot(\matr{E}) = \begin{bmatrix} \matr{E} & \matr{0} \\ \matr{0} & \matr{E}  \end{bmatrix}
\end{array}$\hfill
$\begin{array}{@{}c@{}}
  \xlt(\matr{p}) = \begin{bmatrix} \matr{1} & \matr{0} \\ -\matr{p} \times & \matr{1} \end{bmatrix}
\end{array}$\hfill
$\begin{alignedat}{2}
  &\rotx(\theta) &&= \rot(\rx(\theta)) \\
  &\roty(\theta) &&= \rot(\ry(\theta)) \\
  &\rotz(\theta) &&= \rot(\rz(\theta))
\end{alignedat}$
\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

I have changed the definitions of \rx and similar to use \DeclareMathOperator, which is much better than \text. This requires a change in syntax, but you gain little from \rx{t} with respect to the clearer \rx(t).

enter image description here

1
  • Thank you for the \DeclareMathOperator tip.
    – Dawi
    Commented May 15, 2020 at 21:41
4

As you can put whatever you want in a table environment, it is simpler to put inside an flalign*. I added the caption package to have a more decent spacing under the caption.

\documentclass[]{article}

\usepackage{bm, amssymb, mathtools}
\usepackage{caption, colortbl}
\captionsetup{skip=4pt}
% bold in math mode
\newcommand{\matr}[1]{\bm{#1}}
% Plücker transforms
\DeclareMathOperator{\rx}{rx}
\DeclareMathOperator{\ry}{ry}
\DeclareMathOperator{\rz}{rz}
\DeclareMathOperator{\rot}{rot}
\DeclareMathOperator{\xlt}{xlt}
\DeclareMathOperator{\rotx}{rotx}
\DeclareMathOperator{\roty}{roty}
\DeclareMathOperator{\rotz}{rotz}

\begin{document}

\begin{table}[htb]
    \caption{Légende}
        \hrule
        \begin{flalign*} \rx(\theta) & =\begin{bmatrix}1&0& 0\\ 0&c&s\\0&-s&c\end{bmatrix} &
         \ry(\theta) & =\begin{bmatrix}c&0&-s\\ 0&1&0\\s& 0&c\end{bmatrix} &
        \rz(\theta) & =\begin{bmatrix}c&s& 0\\-s&c&0\\0& 0&1\end{bmatrix} \\[1.5ex]
        \shortintertext{Avec : $c = \cos(\theta)\text{, } s = \sin(\theta) $}%
 &  &  &  & \rotx(\theta)  & = \rot(\rx(\theta)) \\[-1.5ex]
 \rot{\matr{E}} & = \begin{bmatrix} \matr{E} & \matr{0} \\ \matr{0} & \matr{E} \end{bmatrix} &
  \xlt{\matr{p}} & = \begin{bmatrix} \matr{1} & \matr{0} \\ -\matr{p} \times & \matr{1} \end{bmatrix}&
  \roty(\theta)  & = \rot(\ry(\theta)) \\[-1.5ex]
 &  &  &  & \rotz(\theta) &  = \rot(\rz(\theta))
        \end{flalign*}
        \hrule
\end{table}

\end{document} 

enter image description here

2

I would like to suggest that you employ an array environment with 3 columns. This saves you from having to enter and exit math mode lots and lots of times.

enter image description here

\documentclass{article}
\usepackage[french]{babel}
\usepackage{bm,amssymb,amsmath,booktabs}
\usepackage{array} % for '\newcolumntype' macro
\newcolumntype{L}{>{$}l<{$}}
\newcolumntype{C}{>{$}c<{$}}
\newcolumntype{R}{>{$}r<{$}}

% bold in math mode
\newcommand{\matr}[1]{\bm{#1}}
% Plücker transforms
\newcommand{\rx}[1]{\mathrm{rx}(#1)}
\newcommand{\ry}[1]{\mathrm{ry}(#1)}
\newcommand{\rz}[1]{\mathrm{rz}(#1)}
\newcommand{\rot}[1]{\mathrm{rot}(#1)}
\newcommand{\xlt}[1]{\mathrm{xlt}(#1)}
\newcommand{\rotx}[1]{\mathrm{rotx}(#1)}
\newcommand{\roty}[1]{\mathrm{roty}(#1)}
\newcommand{\rotz}[1]{\mathrm{rotx}(#1)}

\begin{document}

\begin{table}[ht]
\caption{Légende}\label{tab:legende}
\centering
$\begin{array}{@{} lcr @{}}
\toprule
\rx{\theta}=\begin{bmatrix}1&0& 0\\ 0&c&s\\0&-s&c \end{bmatrix}  &
\ry{\theta}=\begin{bmatrix}c&0&-s\\ 0&1&0\\s& 0&c \end{bmatrix}  & 
\rz{\theta}=\begin{bmatrix}c&s& 0\\-s&c&0\\0& 0&1 \end{bmatrix}  \\
\addlinespace
\multicolumn{2}{@{}l}{\text{Avec: }c = \cos(\theta), s = \sin(\theta)}\\
\rot{\matr{E}} = \begin{bmatrix} \matr{E} & \matr{0} \\ \matr{0} & \matr{E}  \end{bmatrix} 
&
\xlt{\matr{p}} = \begin{bmatrix} \matr{1} & \matr{0} \\-\matr{p}\times & \matr{1} \end{bmatrix}
&
\begin{tabular}{C@{}}
\rotx{\theta} = \rot{\rx{\theta}} \\ 
\roty{\theta} = \rot{\ry{\theta}} \\
\rotz{\theta} = \rot{\rz{\theta}} 
\end{tabular} \\
\bottomrule
\end{array}$
\end{table}
\end{document}

You must log in to answer this question.

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