Search code examples
latex

How to draw matrices with a label in a latex figure?


I want to create tables as part of a figure in latex. I want to achieve this look:

I have no idea which package/commands to use.


Solution

  • Nothing fancy here; just some math as part of the figure environment:

    enter image description here

    \documentclass{article}
    
    \usepackage{graphicx}
    
    \begin{document}
    
    \begin{figure}
      \centering
      \includegraphics[width=0.4\linewidth]{example-image}
      
      \medskip
      
      $\sigma_1 \rightarrow \sigma_2 :
        \begin{array}{ | *{5}{c|} }
          a & b & c & e & f \\
          \hline
          a & b & c & e & f
        \end{array}$ \quad
      $\sigma_1 \rightarrow \sigma_3 :
        \begin{array}{ | *{5}{c|} }
          a & b & c &  e  & f \\
          \hline
          a & b & c & \gg & f
        \end{array}$
      \caption{A figure caption}
    \end{figure}
    
    \end{document}