我想在 Latex 中制作一个具有有向加权超边的超图。它们看起来像:
图片来源:https://www.biorxiv.org/content/10.1101/2020.11.16.381566v1.full
我不知道如何创建这种类型的边缘,带有中箭头和权重。
答案1
因为这是你在 TeX-SE 上的第一篇文章,我会给你一些提示,但你应该知道,最好提供一个最小工作示例(MWE)\documentclass{...}
这说明了您的问题。当我们看到以 开头和结尾的可编译代码时,重现问题并找出问题所在将变得容易得多\end{document}
。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{positioning,arrows.meta}
\begin{document}
\begin{tikzpicture}[
node distance=1cm and 8cm,
>={Stealth[scale=3]}
]
\begin{scope}[
every node/.style=
{
circle,
draw,
minimum size=8mm,
inner sep=0pt,
font=\large,
}
]
\node (V1) {$v_1$};
\node [below = of V1] (V2) {$v_2$};
\path (V1) -- (V2) coordinate [midway] (V);
\node [right = of V] (V4) {$v_4$};
\node [above = of V4] (V3) {$v_3$};
\node [below = of V4] (V5) {$v_5$};
\end{scope}
\path (V) -- (V4) coordinate [midway] (E);
\draw (V1) to[out=-40,in=180,looseness=0.8] node[pos=0.3, above] {$w_1$} (E) to [out=0,in=-120] node[pos=0.7, above] {$w_3$} (V3) ;
\draw (V2) to[out=40,in=180,looseness=0.8] node[pos=0.3, below] {$w_2$} (E) to [out=0,in=120] node[pos=0.7, below] {$w_5$} (V5);
\draw [>-] (E) node [above = 3mm] {$e$} -- (V4) node [pos=0.9,above] {$w_4$};
\end{tikzpicture}
\end{document}