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.

i have the following mwe

\documentclass[tikz,border=4pt]{standalone}
\usetikzlibrary{arrows}
\begin{document}
  \begin{tikzpicture}[->,>=angle 45,scale=3,ultra thick]
    \draw[help lines] (-.1,-.9) grid (1.1,.1);
    \draw[>=triangle 60,fill=red,draw=teal](0,-0.1)--++(1,0);
    \draw[>=latex,fill=blue,draw=violet](0,-0.2)--++(1,0);
    \draw[>=stealth,fill=blue,draw=violet](0,-0.3)--++(1,0);
    \draw[](0,-0.4)--++(1,0);
    \draw[draw=cyan](0,-.5)--++(1,0);
    \draw[draw=orange](0,-.6)--++(1,0);
  \end{tikzpicture}
\end{document}

the compiled pdf file is expected as follows, enter image description here

but the compiled dvi file have different arrow tip color, enter image description here

after commenting one line

\documentclass[tikz,border=4pt]{standalone}
\usetikzlibrary{arrows}
\begin{document}
  \begin{tikzpicture}[->,>=angle 45,scale=3,ultra thick]
    \draw[help lines] (-.1,-.9) grid (1.1,.1);
    \draw[>=triangle 60,fill=red,draw=teal](0,-0.1)--++(1,0);
    \draw[>=latex,fill=blue,draw=violet](0,-0.2)--++(1,0);
    \draw[>=stealth,fill=blue,draw=violet](0,-0.3)--++(1,0);
    % \draw[](0,-0.4)--++(1,0);
    \draw[draw=cyan](0,-.5)--++(1,0);
    \draw[draw=orange](0,-.6)--++(1,0);
  \end{tikzpicture}
\end{document}

the output pictures are normal and consistant again, enter image description here

is there anything special about the commented line, or that is just a bug somehow? i was think of exploiting that to change the arrow tip color only without resorting to the advanced decoration option. now it seems that changing color of angle 45 type arrow tip is indeed tricker than latex/stealth type.

share|improve this question
    
Can you try the commented line without the empty [] and also converting draw to path? –  percusse Oct 7 '13 at 7:35
1  
I understand there's no real color stack in .dvi viewers (which one are you using?), which may (or may not) be related to your problem. –  Koji Oct 7 '13 at 8:43
    
@percusse, thanks for the suggestion. if i changd the commented line into \draw(0,-0.4)--++(1,0); the problem still exists, it is the same as \draw(0,-0.4)--++(1,0); if i try \path(0,-0.4)--++(1,0); nothing is drawn for this line of code as expected, since the draw option is not specified. i guess div will be obsolete in the future? –  davyjones Oct 7 '13 at 8:49
    
@Koji, i used Yap. the color stack stuff are really stranger to me, but i'll test the result on linux later. thanks very much! –  davyjones Oct 7 '13 at 9:01
1  
I expand: dvi files do not contain any color or grahics per se; what they can contain are specials. These specials are there for the benefit of post processing backend software; like dvips, dvipdfm or the integrated pdf backend of pdflatex. However, many dvi viewers will give it a shot to interpret some specials. Color changes are hard to implement, you need a whole color stack to pop and push colors at the appropriate moments (consider a color change inside floating material). Hence, many dvi viewers fail some of the time. Finally, tikz is really meant only for pdf/ps, not dvi. –  Koji Oct 7 '13 at 9:24
show 1 more comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.