Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When producing a PDF from the following example using pdflatex, I get different results between Adobe Reader and TeXworks. I think this is a bug in the way that Reader handles opacity/transparency.

My goal is to have just a small space between the black node and each edge (like how TeXworks is rendering it), and the way I'm doing that is by setting a black fill and color=transparent/opacity=0 edge for each node.

Can anyone suggest a nice workaround to get consistent results? I have many trees I am trying to render that suffer from this issue and I would like to have the space between the edge and node be transparent rather than white.

Maybe I can draw fully transparent nodes, and then draw a smaller black node on top of each of these. Can this be automated as part of the state syle? Or can I set a gap between the start and end of every edge? (How would I do this?)

\documentclass{article}
\usepackage{tikz}

\tikzstyle{lts}=[
  state/.style={circle,draw,minimum size=4pt,inner sep=0pt,line width=2pt,draw opacity=0,color=transparent,fill=black},
  edge from parent/.style={-stealth,draw},
  obs/.style={edge from parent/.style={-stealth,draw,very thick}},
]

\begin{document}
    \begin{tikzpicture}[lts]
      \node[state] {}
        child[obs] {node[state] {}
        edge from parent node {}}
        child[obs] {node[state] {}
        edge from parent node {}};
    \end{tikzpicture}
\end{document}

Comparing the rendering in TeXworks to Reader:

http://i.stack.imgur.com/xw3zu.png

share|improve this question
2  
Welcome to TeX.SE. –  Peter Grill Apr 11 '13 at 19:16
1  
BTW Off topic :TeXworks uses poppler library for pdf rendering like many poppler based free pdf readers and TeXmaker switched to qpdf library, Hence different rendering happens on each viewer. –  texenthusiast Apr 11 '13 at 19:22
    
@texenthusiast: I doubt that they use qpdf for the rendering. –  Martin Schröder Apr 12 '13 at 13:16
    
@MartinSchröder Correction my earlier comment: sorry it is qpdfview instead of qpdf. Even it uses Poppler support but with CUPS for printing support and the Qt toolkit . –  texenthusiast Apr 12 '13 at 13:27

1 Answer 1

up vote 3 down vote accepted

Using draw=none instead of color=transparent seems to properly display it in Acrobat. The image on the left is the one with color=transparent, and the one on the right is with draw=noneas viewed in Acrobat:

enter image description here

Notes:

Code:

\documentclass{article}
\usepackage{tikz}

\tikzstyle{lts}=[
  state/.style={circle,draw,minimum size=4pt,inner sep=0pt,line width=2pt,draw opacity=0,color=transparent,fill=black},
  edge from parent/.style={-stealth,draw},
  obs/.style={edge from parent/.style={-stealth,draw,very thick}},
]

\tikzset{MyState/.style={circle,draw,minimum size=4pt,inner sep=0pt,line width=2pt,draw opacity=0,draw=none,fill=black}}
\tikzset{MyObs/.style={edge from parent/.style={-stealth,draw,very thick}}}

\begin{document}
    \begin{tikzpicture}[lts]
      \node[state] {}
        child[obs] {node[state] {}
        edge from parent node {}}
        child[obs] {node[state] {}
        edge from parent node {}};
    \end{tikzpicture}%
    \begin{tikzpicture}
      \node[MyState] {}
        child[MyObs] {node[MyState] {}
        edge from parent node {}}
        child[MyObs] {node[MyState] {}
        edge from parent node {}};
    \end{tikzpicture}
\end{document}
share|improve this answer
    
This is a much simpler solution than I thought I could get. In fact, I can just remove draw from state. Thanks! –  cjb Apr 11 '13 at 19:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.