\matrix 能与 Beamer 一起工作吗?

\matrix 能与 Beamer 一起工作吗?

我试图直接将这个矩阵包含在我的投影仪中,所以新的代码是这样的

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

[code]
\end{frame}

\end{document})

但它不起作用,知道为什么吗?

   \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
    ](L) {};

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

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

    \end{tikzpicture}

    \end{document}

答案1

对于我来说,如果我使用你的代码,它将起作用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
    ](L) {};

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

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

    \end{tikzpicture}
\end{frame}
    \end{document}

投影机中的矩阵

相关内容