3

I am trying to write a 3D matrix in latex, that is of the following form:

enter image description here

I have checked few answers in this forum but they don't tell how to include the equation in the tickpicture environment. Moreover, the shape is not really what I am looking for.

Simon Dispa
  • 39,141

1 Answers1

5

This solution requires two steps: (1) the construction of the two matrices and (2) the layout of the matrices and the drawing of the lines.

For the first step I used the package nicematrix. For the second step a tikzpicture.

For convenience I defined two commands with the arrays to be able to change them without interfering with the tikz layout.

b

\documentclass[12pt,a4paper]{article}

\usepackage{nicematrix}

\usepackage{tikz} \usetikzlibrary{positioning}

\begin{document}

\newcommand{\matrixA}{% $\begin{bNiceMatrix} a_{11}^{1} &a_{12}^{1} & \Cdots &a_{1m}^{1}\ \Vdots &\Ddots & & \ & & &\ a_{nm}^{1} & & & a_{nm}^{1}\ \end{bNiceMatrix}$ }

\newcommand{\matrixB}{% $\begin{bNiceMatrix} a_{11}^{m} &a_{12}^{m} & \Cdots &a_{1m}^{m}\ \Vdots &\Ddots & & \ & & &\ a_{nm}^{m} & & & a_{nm}^{m}\ \end{bNiceMatrix}$ }

\begin{tikzpicture} \node[inner sep=0pt] (matA) {\matrixA}; \node[inner sep=0pt, above right = 10pt and 10pt of matA, scale=0.8] (matB) {\matrixB}; \node[left= 0pt of matA] {$A=$}; \draw[blue,shorten >=3mm, shorten <=4mm, dotted] (matA.north west)-- (matB.north west); \draw[blue,shorten >=3mm, shorten <=2mm, dotted] (matA.north east)-- (matB.north east); \draw[blue,shorten >=3mm, shorten <=2mm, dotted] (matA.south east)-- (matB.south east); \end{tikzpicture}

\end{document}

Simon Dispa
  • 39,141