3

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}
6
  • \tikzstyle is deprecated. Which engine are you using? LuaTeX?
    – cfr
    Jul 21, 2016 at 0:34
  • 2
    Just remove \usepackage[dvips]{graphicx}
    – Salim Bou
    Jul 21, 2016 at 0:36
  • @salimbou You should answer. You were faster. @ OP Note that specifying [h] for figure is pointless. LaTeX will assume you cannot possibly mean it and ignore you. (It'll change it to ht, I think, to make it minimally sane.)
    – cfr
    Jul 21, 2016 at 0:39
  • With \usepackage[dvips]{graphicx} you need to compile with LaTeX, not pdfLaTeX. If you remove option [dvips] at graphicx, you can compile with LaTeX aw well with pdfLaTeX. Also all TikZ libraries, which you load, are surplus.
    – Zarko
    Jul 21, 2016 at 0:45
  • 4
    I'm voting to close this question as off-topic because it is solved by comments and no commenter wants to answer.
    – Symbol 1
    Mar 21, 2017 at 20:41

0

Browse other questions tagged .