koslowj | 25 Jan 00:13
Picon
Picon
Favicon

questin concerning insert path


In section 14, page 141, there is an example of the insert path command,
where circles are inserted.  How can I insert filled circles?

-- Jürgen
--

-- 
View this message in context: http://old.nabble.com/questin-concerning-insert-path-tp33198396p33198396.html
Sent from the pgf-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users
Mark Wibrow | 25 Jan 09:03
Picon

Re: questin concerning insert path

Hi,

The `insert path' key only allows you to insert path commands in the 
current path, these inserted commands are then used with prevailing 
fill/draw options of the main path.

Although it could be done with a decoration, or with plot marks, it also 
possible to define an `insert new path' key, which interrupts the main 
path allows a completely new path to be drawn with its own draw/fill. It 
does, however, involve some basic layer hackery. Note also, that these 
inserted paths are filled/drawn *before* the main path, and so would 
appear behind it.

\documentclass{article}

\usepackage{tikz}

\begin{document}
\makeatletter
\tikzset{
	insert new path/.style={
		insert path={
			\pgfextra{
				\edef\tikz <at> last <at> point{{\the\tikz <at> lastx}{\the\tikz <at> lasty}}%
				\pgfinterruptpath%
					\pgftransformshift{\expandafter\pgfqpoint\tikz <at> last <at> point}%
					#1%
				\endpgfinterruptpath%
			}
		}
(Continue reading)

koslowj | 25 Jan 09:56
Picon
Picon
Favicon

Re: questin concerning insert path


Ah, very tricky!  But it does what I want, thank you! A s I'm filling with
black anyway, the order of the layers does not pose a problem.  Here is the
derivation tree I wanted to produce, using also the tikz-qtree package:

 \begin{tikzpicture}
\tikzset
  {c/.style={insert new path={\fill circle[radius=2 pt];}}}
\tikzset
  {edge from parent/.style=
  {draw,
   edge from parent path={(\tikzparentnode.south)
                          -- +(0,-8 pt)[c]
                          -| (\tikzchildnode)}}}
\Tree [.E [.T
            [.T 
              [.F
                [.$($ ]
                [.S 
                  [.E
                    [.E a ]
                    [.Q
                      [.$+$ ]
                      [.T b ] 
                    ] 
                  ]
                  [.$)$ ]
                ]
              ] 
            ]
(Continue reading)


Gmane