I am moving my project from Overleaf to Texlive with Texmaker in a computer running Manjaro. I need to use TiKz to create some trees in my document and they showed up correctly while using Overleaf, but now in my local machine they appear just as some character all one over each other. This is the code I used:
\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}
\tikzstyle
is deprecated. Which engine are you using? LuaTeX?\usepackage[dvips]{graphicx}
[h]
forfigure
is pointless. LaTeX will assume you cannot possibly mean it and ignore you. (It'll change it toht
, I think, to make it minimally sane.)\usepackage[dvips]{graphicx}
you need to compile withLaTeX
, notpdfLaTeX
. If you remove option [dvips] atgraphicx
, you can compile withLaTeX
aw well withpdfLaTeX
. Also all TikZ libraries, which you load, are surplus.