[Xy-pic] Re: two more xypic questions if you would permit me please :)

David Marceau davidmarceau at sympatico.ca
Sat May 1 10:08:18 CEST 2004


Ross Moore wrote:
>> 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
> Use an extended modifier, such as    [F-:red]
Yes this worked.

>> -arrows
> modifiers start with @ ;  e.g.   \ar @[red] ....
This trick I didn't know.  Thank you.

>> -arrow tips
> This is harder.
> You need to set the arrow twice, using different colors for the stem  
> and tips,
> as on the 2nd line of the following:
> 
>   \xymatrix @C+15pt @R-15pt {
>   *+[F-:red]{A} \ar @{-}[r] \ar @[red] @{{}>}[r] & B \\
>   C & D}
I might use it but actually if I use the arrow trick about the arrow and 
tip are the same color which is adequate for me.  Thank you for this 
trick :)  I might use it later if I see a reason for it.

> Alternatively, you could define a new directional object, using   \newdir ,
> to be the colored arrow-head, then use that as the arrow-style.
> 
>> 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.
> 
> Use @-modifiers after  \xymatrix, as in the above example.
> 
> These options are all explained, with examples, in the Xy-pic reference  
> manual.
Actually this was all very helpful in the xyrefer.ps but none of the 
color stuff worked for me until you gave me the trick this follows below 
about using package dvips.

>> 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 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?
> Using dvips as the .dvi driver ?
> Load Xy-pic as a LaTeX package, with options:
> \usepackage[dvips,all,color]{xy}
> \usepackage[dvips,ps,all,color]{xy}
I tried both of these.  They both worked for me.  These two lines were 
the catalyst for everything to work for me.  Thank you for this tip.

> The latter uses PostScript \special commands for drawing.
> It'll end up being faster to process and gives more flexibility
>  (e.g. smoother curves, and you can have different
>    line-thicknesses, and line-joins, etc.)
> but the results will not show in a .dvi-only viewer that
> doesn't support embedded PostScript .
I will listen to your advice and use the latter for best printer 
results.  I appreciate all these valuable tricks you have shown me.
Thank you.  I have everything I need to finish my little project.

Cheers,
David Marceau




More information about the xy-pic mailing list