[Xy-pic] diamond-shaped frames

Maja Karaga karaga at math.hr
Thu Nov 6 19:50:10 CET 2003

Many thanks to Ross Moore for his swift answer. However, there is a slight
problem still remaining in using so defined diamond-shaped frames, namely,
the arrows are either too short or too long for new objects. Here is my
code, so you can see it yourselves:



%  \diamondframe[6]   for drawing a diamond-shaped frame
%                     around the current <pos>
%  (just a quick hack, by Ross Moore  2003/11/6)
  \save           % save the current state
    c!C           % center on the current <pos>
   ,*#1+=\frm{}%  % drop empty frame with modifiers, equalized
    ="@f@"        % name it
   ,"@f@"+U,{\ar@{#2}"@f@"+R#3}%   draw each side, allowing labels
   ,"@f@"+R,{\ar@{#2}"@f@"+D#4}%  (could be more efficiently done
   ,"@f@"+D,{\ar@{#2}"@f@"+L#5}%    as a single \PATH)
 \restore         % return to the saved state
% allow the 1st argument to be of variable-length, pre-{

% redefine these user-commands using the new methods


\xymatrix@!=1.7pc{ & \delete \ar[d] \ar[r] \ar[ddr]
  & \deleted \ar[d]
\ar[r] \ar[ddr] & \delete \ar[d] \ar[ddr] & \\
           \diamx \dframe++{-}{}{}{}{} \ar@(dl,ul)[] \ar[dr] \ar[ur]&
 \diam \ar@(dl,ul)[] \ar[dr] \ar[ur]  & \diami \ar@(dl,ul)[] \ar[dr]
\ar[ur]& \diam  \ar@(dl,ul)[] \ar[dr] & & \\
          \matchb \ar[u] \ar[r] \ar[uur] & \match \ar[u] \ar[r]
\ar[uur] &
\matchm \ar[u] \ar[r] \ar[uur]& \match \ar[u]\ar[r]& \matche \\


I belive that this most likely can be solved by simple shortening or
prolongation of arrows, but I don't know how to do it.
Any suggestions?


Department of Mathematics,
University of Zagreb

More information about the xy-pic mailing list