![使用 TikZ 进行学术辩论和争论](https://linux22.com/image/265327/%E4%BD%BF%E7%94%A8%20TikZ%20%E8%BF%9B%E8%A1%8C%E5%AD%A6%E6%9C%AF%E8%BE%A9%E8%AE%BA%E5%92%8C%E4%BA%89%E8%AE%BA.png)
我想知道是否有一个 TikZ 库可以绘制学术辩论图。例如,深灰色节点构成论点 (7) 的论据,而浅灰色节点则是反对该论点的理由。
答案1
不完整,但我保留了锦上添花的效果。一些备注:outer sep=1mm
用于获取箭头的相同位置。也许最好使用 tikz 定义符号 + 和斜线。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikzset{dark/.style={circle,text=white,fill=darkgray,draw=black,font=\small, minimum size= 8 mm,outer sep=1mm},
light/.style={circle,text=white,fill=gray,draw=black,font=\small, minimum size= 8 mm},
empty/.style={circle, minimum size= 8 mm,outer sep=1mm},
}
\newcommand{\add}[3]{%
\node [dark] (#1) at (#3) {#1};
\node [text=black] at ([shift= {(1cm,0mm)}]#3) {$+$};
\node [dark] (#2) at ([shift= {(2cm,0mm)}]#3) {#2};
\draw[line width=.8pt] ([shift= {(-4mm,0mm)}]#1.south) -- ([shift= {(4mm,0mm)}]#2.south) coordinate[pos=.5](m);
\node[empty] (end) at ([shift= {(0mm,-2cm)}]m.south) {};
\draw[line width=.8pt,->] (m) -- (end);
}
\begin{tikzpicture}
\add{2}{3}{0,0}
\add{4}{1}{end}
\add{5}{6}{end}
\node[dark] at (end) {7};
\node[light](9) at ([shift= {(-3cm,0mm)}]4) {9};
\draw[line width=.8pt,->] (9) -- (4);
\end{tikzpicture}
\end{document}