[Xy-pic] Problems with <path>s
Ross Moore
ross at maths.mq.edu.au
Fri Sep 3 02:22:16 CEST 2004
Hi Richard,
On 28/08/2004, at 2:26 AM, Richard Lewis wrote:
> Hi everyone, I've noticed a few problems with the <path> construct,
> any fixes possible?
> Accordin to page 41 of the reference manual, you can apply any <arrow>
> to any <path>. However
>
> \section{Where is the hole?}
> \[
> \xygraph{%!Z{2cm}{2cm}%
> A[r]B[dr]C[rr]D[ul]E
> []!{%
> "A"\ar@{-}
> ~+{|>*\dir{>}} % all segments get a `>' at end
> '"B" %^-{a}
> '"C" %_-{b}
> '"D" |-{\hole}
> "E"
> }
> }
> \]
In fact it is there!
If you look at the output carefully, you will see that
the 2nd part of the arrow between "C" and "D" has been
overprinted. This is because it is effectively:
"C" \ar@{-} "D" |>*\dir{>} |-{\hole}
which draws to the end to place the > then
goes back to halfway for the \hole ,
then continues to the end again.
Compare this to
"C" \ar@{-} "D" |-{\hole} |>*\dir{>}
which does the subsegments in ascending order
(of the linear <place> parameter along the line).
When there are multiple <break>s in a path segment,
they must be specified in ascending order. This is
documented in the reference manual, I believe.
Since you are using \xygraph then the coding
for this example could be done more easily as:
\xygraph{%!Z{2cm}{2cm}%
A[r]B[dr]C[rr]D[ul]E
"A" : "B" : "C" : "D" |-{\hole}
"D" : "E"
}
> It works if we remove the \string~\string+ bit:
> \[
> \xygraph{
> A[r]B[dr]C[rr]D[ul]E
> []!{%
> "A"\ar@{-}
> %~+{|>*\dir{>}} % all segments get a `>' at end
> '"B"
> '"C"
> '"D" |-{\hole}
> "E"
> }
> }
> \]
Yes; because now you aren't placing the arrowhead
as a <break> in the path segment, before a <break>
having an earlier <place>.
>
> \section{Curves dont play well with paths}
> Here, the second segment starts in the wrong place
> \[
> \xygraph{%
> A[r]B[dr]C[rr]D[ul]E
> []!{%
> "A"\ar@/^/
> '"B" %^-{a}
> '"C" %_-{b}
> '"D"
> "E"
> }
> }
> \]
That's definitely a bug somewhere in the interactions
between very complicated coding for curves, arrows,
labels, and xy-graphs.
But using \xygraph the example is done more easily
using the \newgraphescape mechanism; e.g. as follows:
\xygraph{%
!~-{@{-}@/^/} % adjust the style for all - arrows
A[r]B[dr]C[rr]D[ul]E
"A" - "B" - "C" - "D" - "E"
}
or
\xygraph{
!~-{@{-}@/^/} % adjust the style for all - arrows
A - [r]B - [dr]C - [rr]D - [ul]E
}
>
> And when labels are used, subsequent sections start from the label,
> rather than the end of the path
> \[
> \xygraph{%
> A[r]B[dr]C[rr]D[ul]E
> []!{%
> "A"\ar@/^/
> '"B" ^-{a}
> '"C" _-{b}
> '"D" _-{c}
> "E"
> }
> }
> \]
Same comment as above:
That's definitely a bug somewhere in the interactions
between very complicated coding for curves, arrows,
labels, and xy-graphs.
I'll need to look carefully into this.
It'll be perhaps a couple of days work, just to identify
the problem.
However, there's no urgency, as this works:
\xygraph{%
!~-{@{-}@/^/}
A[r]B[dr]C[rr]D[ul]E
"A" - "B" ^-{a}
- "C" _-{b}
- "D" _-{c}
- "E"
}
>
> \section{Curved sections don't honour the style}
> \[
> \xygraph{%
> A[r]B[dr]C[rr]D[ul]E
> []!{%
> "A"\ar@{.>}
> `dl^r"B" ^-{a}
> `"C" _-{b}
> `"D" _-{c}
> `"E"
> "E"
> }
> }
> \]
Those curved corners use characters out of a font.
There is no corresponding font in a dotted style.
If you want dotted curves, then you have to use
the various spline constructions, or the
circle/ellipse constructions in xyarc.tex .
Sorry, we never wrote coding to attach styles to
the \cir pieces --- which anyway would be useable
only with a PostScript backend. I recall having
this idea many years ago now, but it didn't get done.
>
>
> \end{document}
Hope this helps,
Ross Moore
>
> _______________________________________________
> xy-pic mailing list
> http://tug.org/mailman/listinfo/xy-pic
>
------------------------------------------------------------------------
Ross Moore ross at maths.mq.edu.au
Mathematics Department office: E7A-419
Macquarie University tel: +61 +2 9850 8955
Sydney, Australia fax: +61 +2 9850 8114
------------------------------------------------------------------------
More information about the xy-pic
mailing list