I could get them to look good for both horizontal and vertical arrows, but then the 45 degrees looked terrible. The second is microcode, burned into the chip, that interprets assembly language instructions into directly executable ones. The third level is the language, usually C but originally Pascal, in which Web code is compiled, the fourth level.
Level six is the XY-pic code in which these macros, level seven, are written. The old package had dashed lines for horizontal and vertical arrows, but not any other direction. The reason for this was that LATEX used rules for horizontal and vertical arrows, but had its own fonts for other directions.
It was mostly tested with version 3.7, so there's no guarantee it would work with any earlier (or, for that matter, later) versions. A limited amount of testing with version 3.6 suggests that the only thing that doesn't work is the 2 arrows; these come up too short.
The latest version
The other two have no parameters and are intended only to set the right or This started when a user of my old package wrote me a diagram and asked if dashed lines were possible. While the rules could be arbitrarily large, the smallest lines in other directions were too long for decent lines.
Presumably Lamport was concerned about compile time and file size if the lines were too short, considerations that have diminished in the years since. On the other hand, the graphics engine underlying XY-pic is really quite remarkable, and it occurred to me that I could try to reformulate the diagram as a front end. So, despite the desire for logic programming, it still seems desirable for some purposes to have a system where you specify what goes where and where the arrows are drawn.
Main features
Compatibility
Errant spaces
Font sizes
Acknowledgments
License
If you give {@{->>}@/^5pt/}, you will get an epic arrow curved in the direction perpendicular to the direction of the arrow with five points. It is imperative that a specification like @{>}@/5pt/ be enclosed in brackets because of the /s. Each of the first four sets of parameters is optional and any subset of them can be omitted.
The next four give the shapes of the arrows with the same syntax as discussed above. The x-coordinate is the center of the leftmost node and their coordinate is the baseline of the lowest node. Triangles with lowercase names have their legs horizontal and vertical and the dimension parameters are the lengths of the legs.
In all cases, the order of the notes and arrows is linguistic, first moving from left to right and then down. The first set of parameters is exactly like for\square, and the remaining parameters are for the nodes and labels for the outer arrows. There are no positioning parameters for them; rather, you set the horizontal and vertical separation of the outer node from the square.
The nodes can be given simple identifiers and those used to specify the source and target of the arrows.
Complex diagrams
The way it works is that \node id(x,y)[N] maps the nodeN at position (x,y) to the identifier id which is then used to reference that node. There are also optional arguments for the position of the label and the shape of the arrowhead, so that the entire macro looks like|p|/sh/[id'id;L]. If done outside, the definitions will remain (unless they are redefined) and can be reused.
The arrow parameters are not listed in the usual order, but first all the horizontal arrows and then all the vertical ones, each in their usual order. The fifth parameter is the octal number'5436(In TEX "introduces octal numbers and"introduces hexadecimal numbers) which corresponds to the binary number that describes the distribution of the 0's around the margins. The same results would have been obtained if the number had been the hexadecimal number "B1E or the decimal number.
The sixth parameter gives the horizontal and vertical offset of the 0s, which you often want smaller than the others. You must not provide the sixth parameter unless you have provided a value (which can be 0) for the fifth, or an error condition will occur. Note that the positioning parameters ignore the 0s, so it's the lower left node that appears at position (x,y).
A similar macro\iiixii has been added for an image between exact ranges, with parameters similar to those above. The number n is a number between 0 and 15 (default 15) that specifies whether and where zeros appear (think binary, with the high bit at the top left) and dx' specifies the separation of the zeros.
Empty placement and moving labels
Here's another version of the cube we looked at above, using these special layouts and holes to break up some of the lines and arrange it.
Inline macros
Added
Macros\toand\two can have optional parameters of the form /{sh}/
Mixing XY-pic code
There are three points to note here regarding the two lines that begin. The effect is to reset the baseline to the baseline of the object (instead of the vertical center) and then lower it by 3/4 of the x-height so that the arrow goes to the right place. Without it, an object like Re would be set lower than R. Second, the first arrow has no target and the second has no source.
This does not give the same result as an empty source and destination, since in the latter cases spaces would be allowed around them and then the lines would not meet. It would be possible to add code that tests for empty nodes, but it occurs so rarely that I refrained. In the meantime, the only option is to revert to the base XY-pic code.
Care must be taken using this construction, however, as it appears to malfunction if the line segment fails to intersect the current line, or if it intersects but happens to be too long. Ross Moore says it works fine in the version he has, which, . however, it has not been released.). The last line simply uses |\hole which positions the space in the middle of the arrow.
Diagram from TTT
We provide a few diagrams here to contrast the predefined shapes of diagxy with those produced by xymatrix. These are not meant to be hostile, but they are chosen to show the right matrix in the worst light. The charts can be improved by using xymatrix special options, but the second charts are the default in diagxy.
Of course diagxy uses xypic but not the xymatrix option. So this isn't meant to be a patronage of xypic, just a comparison when you're trying to decide which one to use. In the end, you will probably decide based on what you feel most comfortable with. The following example shows what happens to the label if the nodes are quite different in length.
I don't know how to fix this one, although xypic has so many options that there is probably some way. In all cases, consult the documentation for the syntax and a discussion of the optional parameters. Note that \Square, along with \hSquares and \vSquares grows in width to accommodate the nodes and labels.
In this overview, optional parameters are enclosed in braces ({}) because the more usual parentheses are overused. In only two cases below must braces be used and they will be made clear. In all cases, the set of parameters is optional; you must accept the default for all, or set them all.
If you break one of these macros, make sure you end the line with %, unless you're inside the [..], where everything is done in math mode and spaces are ignored. The coordinates of the lower left corner of the smallest rectangle that encloses the figure, regardless of whether that corner is actually in the shape.