In overleaf with the code below I got the following figure:
\documentclass[]{beamer} %works also for article
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\begin{document}
% units
\newcommand{\myunit}{1 cm}
\tikzset{
node style sp/.style={draw,circle,minimum size=\myunit},
node style ge/.style={circle,minimum size=\myunit},
arrow style mul/.style={draw,sloped,midway,fill=white},
arrow style plus/.style={midway,sloped,fill=white},
}
\begin{tikzpicture}[>=latex]
% matrices
\matrix (A) [matrix of math nodes,
nodes = {node style ge},
left delimiter = (,
right delimiter = )] at (0,0)
{
|[node style sp]| a_{11} & |[node style sp]| a_{12} &|[node style sp]| a_{13} \
a_{21} & a_{22} & a_{23} \
};
\node [draw,below=10pt] at (A.south)
{ $A: 2\times 3$};
\matrix (B) [matrix of math nodes,
nodes = {node style ge},
left delimiter = (,
right delimiter = )] at (4\myunit,4\myunit)
{
|[node style sp]| d_{11} & d_{12} \
|[node style sp]| d_{21} & d_{22} \
|[node style sp]| d_{31} & d_{32} \
};
\node [draw,right=50pt] at (B.south)
{ $D: 3\times 2$};
% matrix result
\matrix (C) [matrix of math nodes,
nodes = {node style ge},
left delimiter = (,
right delimiter = )] at (4*\myunit,0)
{
|[node style sp,red]| c_{11} & c_{12} \
c_{21} & c_{22} \
};
\node [draw,below=10pt] at (C.south)
{ $C = AD: 2\times 2$};
% arrow
\draw[blue] (A-2-1.north) -- (C-2-1.north);
\draw[blue] (A-1-1.north) -- (C-1-1.north);
\draw[blue] (B-1-2.west) -- (C-1-1.east);
\draw[blue] (B-1-1.west) -- (C-1-1.west);
\draw<->,red to[in=180,out=90]
node[arrow style mul] (x) {$a_{11}\times d_{11}$} (B-1-1);
\draw<->,red to[in=180,out=90]
node[arrow style mul] (y) {$a_{12}\times d_{21}$} (B-2-1);
\draw<->,red to[in=180,out=90]
node[arrow style mul] (z) {$a_{13}\times d_{31}$} (B-3-1);
\draw[red,->] (x) to node[arrow style plus] {$+$} (y);%
\draw[red,->] (y) to node[arrow style plus] {$+$} (z)%
to (C-1-1.north west);
\end{tikzpicture}
\end{document}
However, when I copied the same code in a beamer document class I got overlapped matrix elements. I am trying to figure out what is wrong but I am unable to find what I'm missing and I got the following picture:
Could there be any conflict with any other package/s?


&by adding\&. Thnks! – José Jan 31 '24 at 08:14