0

I'm trying to include this matrix in my beamer directly, so the new code is something like

(\documentclass[border=5pt]{standalone}
  \usepackage{tikz}
        \usetikzlibrary{matrix,decorations.pathreplacing, calc, positioning,fit}
        \begin{document}
\begin{frame}

[code] \end{frame}

\end{document})

But it didn't work, any idea why?

   \documentclass[border=5pt]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{matrix,decorations.pathreplacing, calc, positioning,fit}
    \begin{document}
    %%code
    \begin{tikzpicture}[>=stealth,thick,baseline]
    \matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A){ 
    a_{1,1} & a_{1,2} & \dots  & a_{1,j} & \dots & a_{1,n}\\
    a_{2,1} & a_{2,2} & \dots  & a_{2,j} & \dots & a_{2,n}\\  
    \vdots  & \vdots  &  & \vdots  &  & \vdots\\
    a_{i,1} & a_{i,2} & \dots  & a_{i,j} & \dots & a_{i,n}\\
    \vdots  & \vdots  &  & \vdots  &  & \vdots\\
    a_{n,1} & a_{n,2} & \dots  & a_{n,j} & \dots & a_{n,n}\\
   };

\node fit=(A-4-6)(A-4-6), inner xsep=20pt,inner ysep=0, label=right: $i$-ième ligne {};

\node fit=(A-6-4)(A-6-4), inner xsep=20pt,inner ysep=20pt, label=below: $j$-ième colonne {};

\draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
\draw[->](C.south)-- (A-6-4);

\end{tikzpicture}

\end{document}

Diana
  • 1,285
  • 7
  • 12

1 Answers1

2

For me your code work if I use ampersand replacement=\&:

\documentclass{beamer}
    \usepackage{tikz}
    \usetikzlibrary{matrix,decorations.pathreplacing, calc, positioning,fit}
    \begin{document}
    %%code
\begin{frame}
    \begin{tikzpicture}[>=stealth,thick,baseline]
    \matrix [matrix of math nodes,left delimiter=(,right delimiter=),ampersand replacement=\&](A){ 
    a_{1,1} \& a_{1,2} \& \dots  \& a_{1,j} \& \dots \& a_{1,n}\\
    a_{2,1} \& a_{2,2} \& \dots  \& a_{2,j} \& \dots \& a_{2,n}\\  
    \vdots  \& \vdots  \&  \& \vdots  \&  \& \vdots\\
    a_{i,1} \& a_{i,2} \& \dots  \& a_{i,j} \& \dots \& a_{i,n}\\
    \vdots  \& \vdots  \&  \& \vdots  \&  \& \vdots\\
    a_{n,1} \& a_{n,2} \& \dots  \& a_{n,j} \& \dots \& a_{n,n}\\
   };

\node fit=(A-4-6)(A-4-6), inner xsep=20pt,inner ysep=0, label=right: $i$-ième ligne {};

\node fit=(A-6-4)(A-6-4), inner xsep=20pt,inner ysep=20pt, label=below: $j$-ième colonne {};

\draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
\draw[->](C.south)-- (A-6-4);

\end{tikzpicture}

\end{frame} \end{document}

matrix in beamer

vi pa
  • 3,394