使用 TikZ 绘制 RDF 图

使用 TikZ 绘制 RDF 图

当我使用以下代码绘制 RDF 图时:

\begin{tikzpicture}[node distance=2.75cm,>=stealth']
\node[vertex style=Turquoise] (Rk) {Righteous Kill};

\node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
 edge [<-,cyan!60!blue] node[text style,above]{starring} (Rk);
\end{tikzpicture}

我收到以下错误:

Package pgf Error: Unknown arrow tip kind 'stealth''.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.150 ...picture}[node distance=2.75cm,>=stealth']

我该如何解决

答案1

我相信已经谷歌搜索过相关风格。正如 Torbjørn T. 所建议的,您应该加载arrows库或改进arrows.meta库,在这种情况下您还需要更新箭头。

\documentclass[dvipsnames,png,border=3.14mm,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows.meta} %<added arrows.meta
% for the original stealth' you'd have to load arrows instead
% https://tex.stackexchange.com/a/107028/121799
\tikzset{vertex style/.style={
    draw=#1,
    thick,
    fill=#1!70,
    text=white,
    ellipse,
    minimum width=2cm,
    minimum height=0.75cm,
    font=\small,
    outer sep=3pt,
  },
  text style/.style={
    sloped,
    text=black,
    font=\footnotesize,
    above
  }
}
\begin{document}
\begin{tikzpicture}[node distance=2.75cm,>={Stealth[]}]
\node[vertex style=Turquoise] (Rk) {Righteous Kill};
\node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
 edge [<-,cyan!60!blue] node[text style,above]{starring} (Rk);
\end{tikzpicture}
\end{document}

在此处输入图片描述

我很乐意删除这个答案,我只是将其作为替代方案发布sab hoque 的回答,在撰写本文时,它没有提供可编译的代码。

答案2

您必须使用大写字母 S,如下所示(不完全确定这是否能解决问题):

\begin{tikzpicture}[node distance=2.75cm,>=Stealth]
\node[vertex style=Turquoise] (Rk) {Righteous Kill};

\node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
 edge [<-,cyan!60!blue] node[text style,above]{starring} (Rk);
\end{tikzpicture}

相关内容