我正在使用运行 Manjaro 的计算机中的 Texmaker 将我的项目从 Overleaf 移至 Texlive。我需要使用 TiKz 在我的文档中创建一些树,它们在使用 Overleaf 时可以正确显示,但现在在我的本地机器上,它们看起来就像一些字符,一个接一个。这是我使用的代码:
\documentclass{article}
\usepackage[dvips]{graphicx}
\usepackage{tikz}
\usetikzlibrary{graphs, graphs.standard}
\usetikzlibrary{trees}
\usetikzlibrary{positioning}
\begin{document}
\tikzset{
treenode/.style = {shape=circle,
draw, align=center,
top color=white},
root/.style = {treenode, font=\ttfamily\normalsize},
env/.style = {treenode, font=\ttfamily\normalsize},
leaf/.style = {treenode,font=\ttfamily\normalsize,bottom color=red}
}
\begin{figure}[h]
\centering
\tikzstyle{level 1}=[level distance=3cm, sibling distance=4.5cm]
\tikzstyle{level 2}=[level distance=4cm, sibling distance=2.5cm]
\tikzstyle{level 3}=[level distance=4cm, sibling distance=1cm]
\begin{tikzpicture}
[
grow = right,
sibling distance = 3em,
level distance = 6em,
edge from parent/.style = {draw, -latex},
every node/.style = {font=\footnotesize},
sloped
]
\node [root] {$\epsilon$}
child { node [env] {1}
child{ node [leaf] {11}
edge from parent node [below] {1/P(1$|$1)}}
child{ node [leaf] {01}
edge from parent node [above] {0/P(0$|$1)}}
edge from parent node [below] {1/P(1)} }
child { node [env] {0}
child{ node [leaf] {10}
edge from parent node [below] {1/P(1$|$0)}}
child{ node [leaf] {00}
edge from parent node [above] {0/P(0$|$0)}}
edge from parent node [above] {0/P(0)} };
\end{tikzpicture}
\end{figure}
\end{document}