将节点放置在对角线方向,并绘制指向线的箭头

将节点放置在对角线方向,并绘制指向线的箭头

以下代码

\documentclass[UTF8]{beamer}
\usepackage{mathtools}
\usepackage{tikz}


\renewcommand{\mathfamilydefault}{cmss}


\usetikzlibrary{shapes,arrows}
\tikzstyle{ordin} = [rectangle, draw, text width=5em, text centered, rounded corners]
\tikzstyle{line} = [draw,-latex']


\begin{document}

    \begin{frame}
        \begin{center}
            \begin{tikzpicture}[node distance = 2cm, auto]
                \node[ordin,fill=green!20] (parameq) {Parametric Equation};
                \node[ordin,right of=parameq,node distance=7cm] (tanv) {Tangent Vector};
                \node[ordin,below of=parameq,node distance=3cm] (point) {Point};
                \node[ordin,below of=tanv,node distance=3cm] (TVP) {TV for the Point};

                \path[line](parameq)--node{differentiate}(tanv);
                \path[line](parameq)--(point);
                \path[line](tanv)--(TVP);
            \end{tikzpicture}
        \end{center}
    \end{frame}
\end{document}

制作如下图片:草稿

但是,要添加哪些代码才能使其看起来像这样: 最终的

答案1

欢迎!您可以使用matrix

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix,quotes}
\begin{document}
\begin{frame}[t,fragile]
\frametitle{A matrix}
\begin{tikzpicture}
 \matrix[matrix of nodes,
 nodes={rectangle, draw, text width=5em, text centered,anchor=center,
 rounded corners},
 column sep=2em,row sep=2em] (mat){
  |[fill=green!20]| Parametric Equation & & Tangent Vector \\
  & {Parameter\\ Value} & \\
  Point & & TV for the Point\\
  & |[text width=7em]| Tangent Line Normal Plane & \\
  };
  \draw[-latex] (mat-1-1) edge["differentiate"] (mat-1-3)
  (mat-1-1) edge (mat-3-1) (mat-1-3) edge (mat-3-3)
  (mat-2-2) edge["Subst"'] (mat-2-2-|mat-1-1) 
  (mat-2-2) edge["Subst"] (mat-2-2-|mat-1-3)
  (mat-3-3.south) -- ++ (0,-1em) -| coordinate[pos=0.25] (aux) (mat-3-1)
  (aux) -- (mat-4-2);
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

请注意,\tikzstyle已被弃用。

相关内容