[Xy-pic] color for different elements in xypic

David Marceau davidmarceau at sympatico.ca
Sat May 1 06:24:37 CEST 2004


 > Hi there Mr. Ross,
 >
 > I thought maybe you could help me with an xypic question please.
 >
 > I'm having a problem displaying a pipe symbol "|" in an xypic diagram.
 > \xymatrix{
 > % column 1
 > *++[][F=]\txt{\color{blue}EXPONENT\\\color{blue}([eE]\\(+?\vert\ -)
 > \\{INTEGER})}
 > \ar[r]
 > \ & \\}
 >\vert is a math-mode symbol.
 >Within the \txt object you need $\vert$ or $|$.
 >If you want some space around the pipe,
 >then  $\mid$ may be better.

This worked wonderfully Thank you.

Please if you would permit me to bother you for two more questions:
1)How do I activate and control xy color of:
-frame boxes
-arrows
-arrow tips
2)Is there any way of controlling/reducing the y spacing between the 
rows of stuff in the xymatrix?  I would like to get more stuff on a page 
if I can.

My goal is to assign a color in the regex expression and then match the 
path that follows in lines/boxes with the same color.
i.e. _? has one color for showing different the path options responsible 
for this processing this expression, and (blah)* has another color for 
showing iteration.  Then plain old tokens take the standard path with 
black obviously.

I tried the following example from the xyrefer.ps but it turned out all 
black which seems to mean my color is not active.  I use an 
hpdeskjet3820 and it seems to be already ok for ghostcript/postscript 
output because when I use emacs, I can do psnup 4 no problem along with 
printing out color.
\xy *+<1.5pt>[F**:white]++[F**:red] \txt{text with background} 
,+!D+/d1pc/,*++[F**:black][white] \txt\bf{bold white on black}\endxy

I have the following at the top of my .tex file:
\documentclass [12pt,english,epsf]{report}
\usepackage[english]{babel}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{color}
\input xy
\xyoption{all}
\xyoption{color}

Any suggestions to get the xy colors active?

Thank you for taking the time to consider my request Mr. Ross.

Below is where I'm at with my stuff in order for you to see where I'm 
going with this.

Cheers,
David Marceau

\xymatrix{
*++[][F=]\txt{\color{blue}DIGIT \\ \color{blue}[0-9] \\}
\ar[rr]
\ar`r[dr]`[drr][drr]
\ar`r[ddr]`[ddrr][ddrr]
\ar`r[dddr]`[dddrr][dddrr]
\ar`r[ddddr]`[ddddrr][ddddrr]
\ar`r[dddddr]`[dddddrr][dddddrr]
\ar`r[ddddddr]`[ddddddrr][ddddddrr]
\ar`r[dddddddr]`[dddddddrr][dddddddrr]
\ar`r[ddddddddr]`[ddddddddrr][ddddddddrr]
\ar`r[dddddddddr]`[dddddddddrr][dddddddddrr]
\  & & *++[o][F-]{0}
\ar[rr]
\  & & \\
\  & & *++[o][F-]{1}
\ar`r[ur]`[urr][urr]
\  & & \\
\  & & *++[o][F-]{2}
\ar`r[ur]`[uurr][uurr]
\  & & \\
\  & & *++[o][F-]{3}
\ar`r[ur]`[uuurr][uuurr]
\  & & \\
\  & & *++[o][F-]{4}
\ar`r[ur]`[uuuurr][uuuurr]
\  & & \\
\  & & *++[o][F-]{5}
\ar`r[ur]`[uuuuurr][uuuuurr]
\  & & \\
\  & & *++[o][F-]{6}
\ar`r[ur]`[uuuuuurr][uuuuuurr]
\  & & \\
\  & & *++[o][F-]{7}
\ar`r[ur]`[uuuuuuurr][uuuuuuurr]
\  & & \\
\  & & *++[o][F-]{8}
\ar`r[ur]`[uuuuuuuurr][uuuuuuuurr]
\  & & \\
\  & & *++[o][F-]{9}
\ar`r[ur]`[uuuuuuuuurr][uuuuuuuuurr]
\  & & \\
}

\xymatrix{
*++[][F=]\txt{\color{blue}EXTENDED\_DIGIT\\\color{blue}[0-9a-fA-F]\\}
\ar[rr]
\ar`r[dr]`[drr][drr]
\ar`r[ddr]`[ddrr][ddrr]
\ & & *++[o][F-]\txt{[0-9]}
\ar[rr]
\ & & \\
\ & & *++[o][F-]\txt{[a-f]}
\ar`r[ur]`[urr][urr]
\ & & \\
\ & & *++[o][F-]\txt{[A-F]}
\ar`r[uur]`[uurr][uurr]
\ & & \\
}

\xymatrix{
% column 1
*++[][F=]\txt{\color{blue}INTEGER\\\color{blue}({DIGIT}(\_?{DIGIT})*)}
\ar[r]
% column 2
\ & *++[o][F-]\txt{DIGIT} \ar[rrrrr] \ar`r[dd] `d[ddr] [ddrr]
% column 3
\ &
% column 4
\ &
% column 5
\ &
% column 6
\ &
% column 7
\ & \\
  & & & & & & & \\
% column 1
\
% column 2
\ &
% column 3
\ & \ar`r[u]`[ru]`[rru]`[rrr][rrr]
% column 4
\ & *++[o][F-]\txt{''\_''} \ar[rr]
% column 5
\ &
% column 6
\ & *++[o][F-]\txt{DIGIT}
\ar`r[u] `u[uur] [uur]
\ar`r[d]`d[dl]`[dlll]`[lll][ll]
% column 7
\ &
% column 8
\ & \\
\ & & & & & \\
}

\xymatrix{
% column 1
*++[][F=]\txt{EXPONENT\\([eE]\\(\color{blue}+?$\vert$\color{red}-\color{black})\\{INTEGER})}
\ar[rr]
% column 2
\ &
% column 3
\ & *++[o][F-]\txt{[eE]}
% column 4
\ &
% column 5
\ &
% column 6
\ &
% column 7
\ & \\}



More information about the xy-pic mailing list