15 Mar 11:09
Problem with Scopes and To Paths
Marc van Dongen <dongen <at> cs.ucc.ie>
2010-03-15 10:09:44 GMT
2010-03-15 10:09:44 GMT
Dear all,
I can't see why to path styles `rectangle 1' and `rectangle 2',
which are included below, behave differently.
Am I missing something?
TIA for your help.
Rgards,
Marc van Dongen
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{scopes}
\tikzset{side 1/.style={to path={%
{[] let \p1=(\tikztostart), \p2=(\tikztotarget)
in (\p1) -- (\p2) \tikztonodes}
}}}
\tikzset{rectangle 1/.style={to path={%
let \p1=(\tikztostart), \p2=(\tikztotarget)
in (\p1) to[side 1] (\p1 -| \p2)
to[side 1] (\p2)
to[side 1] (\p1 |- \p2)
to[side 1] (\p1) \tikztonodes (\p1 -| \p2)}}}
\tikzset{side 2/.style={to path={%
let \p3=(\tikztostart), \p4=(\tikztotarget)
in (\p3) -- (\p4) \tikztonodes
}}}
\tikzset{rectangle 2/.style={to path={%
let \p1=(\tikztostart), \p2=(\tikztotarget)
in (\p1) to[side 2] (\p1 -| \p2)
to[side 2] (\p2)
to[side 2] (\p1 |- \p2)
to[side 2] (\p1) \tikztonodes (\p1 -| \p2)}}}
\begin{document}
\begin{tikzpicture}
\draw[red] (0,0) to[rectangle 1] (2,2);
\draw[blue] (3,0) to[rectangle 2] (5,2);
\end{tikzpicture}
\end{document}
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
RSS Feed