TIKZ-NETWORK 如何将顶点更改为平面文本?

TIKZ-NETWORK 如何将顶点更改为平面文本?

想要将其可视化,没有圆圈,只有文字

\documentclass{scrartcl}

% input encoding
\usepackage[utf8]{inputenc}

% new german spelling
\usepackage[ngerman]{babel}

% choose font
\usepackage[T1]{fontenc}
\usepackage{lmodern}

% KOMA-Script options
\KOMAoptions{%
  parskip=full,%
  fontsize=12pt,%
  DIV=calc}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.geometric}
\tikzset{
  level/.style={
    sibling distance=20mm/#1
  },
  level distance=10mm,
}
\usepackage{tikz-network}
\begin{document}

\begin{tikzpicture}
\Vertex[x=0,y=0,style=text, label=$\{ \neg \text{a, b}\}$]{A}
\Vertex[x=1,y=0, label = $\{ \text{a, }\neg c \}$]{B}
\Vertex[x=2,y=0, label= $\{b\text{,} \neg a \text{,} c$]{C}
\Vertex[x=3,y=0, label = $\{ \neg b\}$]{D}
\Vertex[x=0,y=-0,label =c]{E}
\Vertex[x=0,y=-1, label = $\neg a $]{F}
\Vertex[x=1,y=-1, label = a]{G}
\Vertex[x=1.5, y= -2, label = $\emptyset$]{H}
\Edge(A)(F)
\Edge(B)(G)
\Edge(G)(H)
\Edge(F)(H)
\end{tikzpicture}
\end{document}

答案1

看起来这个包是基于我的 tkz-graph 包的。我不知道不同的选项和命令,我的解决方案可能不够巧妙。也许最好使用\Text

\documentclass{scrartcl}

% input encoding
\usepackage[utf8]{inputenc}

% new german spelling
\usepackage[ngerman]{babel}

% choose font
\usepackage[T1]{fontenc}
\usepackage{lmodern}

% KOMA-Script options
\KOMAoptions{%
  parskip=full,%
  fontsize=12pt,%
  DIV=calc}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.geometric}
\tikzset{
  level/.style={
    sibling distance=20mm/#1
  },
  level distance=10mm,
}
\usepackage{tikz-network}
\begin{document}
\makeatletter
\tikzset{VertexStyle/.style = {
                               color          = \cmdNW@DVS@LineColor,
                               inner sep      = \cmdNW@DVS@InnerSep,
                               outer sep      = \cmdNW@DVS@OuterSep,
                               minimum size   = \cmdNW@DVS@MinSize,
                               line width     = \cmdNW@DVS@LineWidth,
                               font           = \cmdNW@DVS@TextFont}}
\makeatother
\begin{tikzpicture}
\Vertex[x=0,y=0, label=$\{ \neg \text{a, b}\}$]{A}
\Vertex[x=1,y=0, label = $\{ \text{a, }\neg c \}$]{B}
\Vertex[x=2,y=0, label= $\{b\text{,} \neg a \text{,} c$]{C}
\Vertex[x=3,y=0, label = $\{ \neg b\}$]{D}
\Vertex[x=0,y=-0,label =c]{E}
\Vertex[x=0,y=-1, label = $\neg a $]{F}
\Vertex[x=1,y=-1, label = a]{G}
\Vertex[x=1.5, y= -2, label = $\emptyset$]{H}
\Edge(A)(F)
\Edge(B)(G)
\Edge(G)(H)
\Edge(F)(H)
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容