我想写表达式

我想写表达式

我想写出图中所示的表情。有人能帮我吗?在此处输入图片描述

答案1

这是 MWE

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.markings,arrows}
\tikzset{->-/.style={decoration={
            markings,
            mark=at position #1 with {\arrow{>}}},postaction={decorate}}}
\setbeamertemplate{navigation symbols}{}
\begin{document}
   \begin{frame}[fragile]
    \centering
        \begin{tikzpicture}[>=latex]
            \matrix (m) [matrix of nodes, row sep=3em, column sep=3em]
            {
                (1,1) & (1,2) & (1,3) & \ldots \\
                (2,1) & (2,2) & (2,3) & \ldots \\
                (3,1) & (3,2) & (3,3) & \ldots \\
                \vdots                         \\
            };
            \draw[->-=.6] (m-1-1.north east) -- (m-1-1.south west) node[midway,sloped,above=.5cm] {1};
            \draw[->-=.5] (m-1-2.north east) -- (m-2-1.south west) node[near end,xshift=-.2cm,sloped,above=.3cm] {3};
                \path (m-1-2.north east) -- (m-2-1.south west) node[near end,xshift=3cm,sloped,above=.3cm] {2};
            \draw[->-=.3] (m-1-3.north east) -- (m-3-1.south west) node[midway,above=.2cm,xshift=.5cm,sloped] {5} node[near end,xshift=-.6cm,above=.3cm,sloped] {6};
                \path (m-1-3.north east) -- (m-3-1.south west) node[near end,xshift=5.1cm,above=.3cm,sloped] {4};
        \end{tikzpicture}
   \end{frame}
\end{document}

截屏

答案2

稍作修改当前用户回答并尝试使代码更简洁、更清晰:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.markings,arrows}
\setbeamertemplate{navigation symbols}{}

\begin{document}
\begin{frame}[fragile]
\begin{tikzpicture}[
    ->-/.style = {decoration={markings,
                  mark=at position #1 with {\arrow{latex}}},postaction={decorate},
                  very thick, shorten >=-1mm, shorten <=-1mm},
   base/.style = {font=\scriptsize, sloped, above},
   rlbl/.style = {base, at start}, % for nodes on the right end of arrows
   llbl/.style = {base, at   end}, % for nodes on the  left end of arrows
                        ]
\matrix (m) [matrix of nodes, row sep=1em, column sep=1em]
{
    (1,4)  & (1,2) & (1,3) & \ldots \\
    (2,1)  & (2,2) & (2,3) & \ldots \\
    (3,1)  & (3,2) & (3,3) & \ldots \\
    \vdots &       &       &        \\
};
\begin{scope}[transparency group, fill opacity=0.5,]
    \draw[->-=.6] (m-1-1.north east) -- (m-1-1.south west) node[rlbl] {1};
    \draw[->-=.5] (m-1-2.north east) -- (m-2-1.south west) node[llbl] {3} node[rlbl] {2};
    \draw[->-=.3] (m-1-3.north east) -- (m-3-1.south west) node[llbl] {5} node[rlbl] {4};
\end{scope}
\end{tikzpicture}
   \end{frame}
\end{document}

在此处输入图片描述

编辑(2): 考虑到评论帐篷玛丽安· G.为了提高斜线的平行度:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.markings,arrows}
\setbeamertemplate{navigation symbols}{}

\begin{document}
\begin{frame}[fragile]
\[
\begin{tikzpicture}[
    ->-/.style = {decoration={markings,
                  mark=at position #1 with {\arrow{latex}}},postaction={decorate},
                  very thick},
   base/.style = {font=\scriptsize, sloped, above=0.1ex},
   rlbl/.style = {base, xshift=-1.0em, at start}, % for nodes on the right end of arrows
   llbl/.style = {base, xshift= 1.5em, at   end}, % for nodes on the  left end of arrows
                   ]
\matrix (m) [matrix of math nodes, 
             nodes={minimum width=2em, inner sep=0pt, outer sep=0pt},
             row sep=1.64ex, column sep=1.64em]
{
    (1,1)   & (1,2) & (1,3) & \ldots \\
    (2,1)   & (2,2) & (2,3) & \ldots \\
    (3,1)   & (3,2) & (3,3) & \ldots \\
    \vdots  &\vdots &\vdots & \ddots \\
};
\begin{scope}[transparency group, fill opacity=0.5,]
    \draw[->-=.6] (m-1-1.north east) -- (m-1-1.south west) node[rlbl] {1};
    \draw[->-=.5] (m-1-2.north east) -- (m-2-1.south west) node[llbl] {3} node[rlbl] {2};
    \draw[->-=.3] (m-1-3.north east) -- (m-3-1.south west) node[llbl] {6} node[base,pos=0.5] {5} node[rlbl] {4};
\end{scope}
\end{tikzpicture}
\]
   \end{frame}
\end{document}

在此处输入图片描述

相关内容