I've been testing the version of PGF, including TikZ, from CVS for the last
couple of days, and it's been wonderful. The new syntax is easy to use
but powerful, and it works much better for editing than the combination of
pdftex and metapost I had been using before. It's really brilliant.
Thanks!
I've just got a couple of questions about the new tikz syntax, and how
it compares to what I have been doing using pgfnodes.
* I liked the capacity in pgfnodes to draw lines between nodes (from
the centre of one node to the centre of another) and have them
automatically clipped. I can't see any way to do that in the syntax
of tikz, and I can't see how to do that using the commands from pgfnodes
with nodes I have defined using the syntax of tikz. Is there any way
to do that yet? If not, is it planned?
* I also liked the ability to specify points some fraction of the way along
the line from one point to another. (This is good for labelling arrows from
one node to another.) How could I do that with the tikz syntax?
Here's an example of what I'd like to do more simply, in case you want to
see a scenario in practical application.
\def\cNode#1#2#3{\draw #1{[shape=ellipse,fill=blue!8!white,draw,name=#2]{#3}};}
\def\csNode#1#2#3{\draw #1 {[shape=ellipse,fill=red!8!white,draw,name=#2]{#3}};}
\begin{pgfpicture}[scale=1.5]
\draw[very thin,color=gray!50!white,step=0.25cm] (0.499,0) grid (3.5,5);
%% Nodes
\csNode{(2,4)}{h1}{$\otimes$\textsc{e}}
\cNode{(1,3)}{h2}{$\neg$\textsc{e}}
\cNode{(3,3)}{h3}{$\neg$\textsc{e}}
\cNode{(2,2)}{h4}{$\oplus$\textsc{e}}
\cNode{(2,1)}{h5}{$\neg$\textsc{i}}
%% Arrows
\draw [->] (2,4.75) -- (h1.north) ;
\draw (2,4.5) {[put left]{\tiny $A\otimes B$}};
\draw [->] (h1.south west) -- (h2.north) ;
\draw[fill=white] (h1.south west) circle (1pt);
\draw (1.33,3.66) {[put left]{\tiny $A$}};
\draw [->] (h1.south east) -- (h3.north) ;
\draw[fill=black] (h1.south east) circle (1pt);
\draw (2.66,3.66) {[put right]{\tiny $B$}};
\draw [->] (h2.south) -- (h4.north west) ;
\draw (1.33,2.33) {[put left]{\tiny $\neg A$}};
\draw [->] (h3.south) -- (h4.north east) ;
\draw (2.66,2.33) {[put right]{\tiny $\neg B$}};
\draw [->] (h5.north) -- (h4.south) ;
\draw (2,1.5) {[put left]{\tiny $\neg A\oplus \neg B$}};
\draw [->] (h5.south) -- (2,0.25);
\draw (2,0.5) {[put left]{\tiny $\neg(\neg A\oplus \neg B)$}};
\end{pgfpicture}
In this case drawing nodes is trivial. But the paths aren't.
I'd like the paths between nodes (such as \draw [->] (h1.south west) --
(h2.north) ; etc) not go through the anchor points, but pass from the
center of one node to another, clipped by the nodes at each end. (This
would mean that the diagram would look fine even if rotated. If you
choose fixed anchors for the sources and targets, it is not robust
under this transformation.)
Second, I'd like the labels on the paths (such as \draw (2.66,3.66) {[put
right]{\tiny $B$}}; etc) be specified instead by saying that it should be
two thirds of the way between h1 and h3, (for example) instead of
calculating the coordinate explicitly.
Thanks again for the package. I look forward to seeing it develop.
Best wishes,
Greg Restall
--
Philosophy Department / University of Melbourne / http://consequently.org
|