使用 Tikz 绘制带引文的图形

使用 Tikz 绘制带引文的图形

我想创建一个图形(如图所示),其中包含文本和与文本相关的引文。我手动创建了所示的图像,但我想使用 Tikz(或其他任何工具)在 Latex 中创建它,因为我想插入引文作为直观显示与我的研究相关的工作的方式。我随机选择了引文的数字。事实上,我想复制该图像确切地形状和颜色也是如此(对文本和引文进行了修改)。这可能吗?我希望得到一些帮助。

谢谢。 相关工作

答案1

查看 Forest 包。这是我为您创建的一个简单的示例: 在此处输入图片描述

\documentclass{article}
\usepackage{forest}
\begin{document}

\begin{forest}
   for tree={ellipse, edge+=->, l=3cm, inner sep=0.5cm}
   [Main, draw=blue!100, fill=blue!10
     [Type-1 \cite{itemone}, draw=green!50, fill=green!20
       [Technique-1 \cite{itemtwo}, draw=green!50, fill=green!20]
       [Type-3 \cite{itemthree}, name=type3, draw=yellow!50, fill=yellow!20
        [My Technique, top color=red!20, bottom color=red!100, rectangle]
       ]
     ]
     [Type-2, name=type2, draw=purple!50, fill=purple!20
       [Technique-1, draw=purple!50, fill=purple!20]
     ]
   ] 
   \draw[-latex] (type2) to (type3);
\end{forest}

\begin{thebibliography}{10}
\bibitem{itemone} 
Item One

\bibitem{itemtwo} 
Item Two

\bibitem{itemthree} 
Item Three
\end{thebibliography}

\end{document}

答案2

我会“手动”绘制这个,只使用positioning库进行定位,并使用其他一些库添加一些其他功能。这只会产生 TiZ 图,它不包含任何库。

\documentclass[tikz,border=2mm]{standalone}

\usetikzlibrary{shapes.geometric, positioning, shadings, arrows.meta}

\tikzset
  {
    ,my bubble/.style = 
      {
        ,draw=#1!70
        ,fill=#1!10
        ,ellipse
        ,inner sep=2pt
        ,minimum width=4em
        ,minimum height=2em
        ,align=center
      }
    ,my end/.style =
      {
        ,draw=#1!70
        ,top color=#1!10
        ,bottom color=#1!50
        ,minimum height=6em
        ,text width=6em
        ,inner sep=0pt
        ,align=center
      }
    ,my arrow/.style =
      {
        ,>=Stealth
        ,->
        ,draw=black
      }
  }

\begin{document}
\begin{tikzpicture}[node distance=6em and 2em]
  \node[my bubble=blue] (Main) {Main};
  \node[my bubble=green,below left=of Main]   (T1) {Type-1\\\relax[4-6]};
  \node[my bubble=purple,below right=of Main] (T2) {Type-2\\\relax[8-10]};
  \path (Main) ++(0,-16em) node[my bubble=orange] (T3) {Type-3\\\relax[15-21]};
  %
  \node[my bubble=green, left=of T3]   (T1-3) {Technique-3\\\relax[5-6]};
  \node[my bubble=green, left=of T1-3] (T1-2) {Technique-2\\\relax[7-12]};
  \node[my bubble=green, left=of T1-2] (T1-1) {Technique-1\\\relax[2-6]};
  %
  \node[my bubble=purple, right=of T3]   (T2-1) {Technique-1\\\relax[15-17]};
  \node[my bubble=purple, right=of T2-1] (T2-2) {Technique-2\\\relax[12-14]};
  \node[my bubble=purple, right=of T2-2] (T2-3) {Technique-3\\\relax[19-21]};
  %
  \node[my bubble=orange, below left=of T3]  (T3-1){Technique-1\\\relax[15-20]};
  \node[my bubble=orange, below right=of T3] (T3-2){Technique-2\\\relax[22-25]};
  %
  \path (T3) ++(0,-16em) node[my end=red] (end) {My\\Technique};
  %
  %
  \draw[my arrow] (Main) -- (T1);
  \draw[my arrow] (Main) -- (T2);
  %
  \draw[my arrow] (T1) -- (T3);
  \draw[my arrow] (T2) -- (T3);
  %
  \draw[my arrow] (T1) -- (T1-1);
  \draw[my arrow] (T1) -- (T1-2);
  \draw[my arrow] (T1) -- (T1-3);
  %
  \draw[my arrow] (T2) -- (T2-1);
  \draw[my arrow] (T2) -- (T2-2);
  \draw[my arrow] (T2) -- (T2-3);
  %
  \draw[my arrow] (T3) -- (T3-1);
  \draw[my arrow] (T3) -- (T3-2);
  \draw[my arrow] (T3) -- (end);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容