I am on a committee to consider what the *syntax* for commutative diagrams ought to be in the next implementation of latex. Thinking about I realized that this cannot and should not be based on just what I need, but should be based broadly on the needs of the whole community, meaning the whole categorical community, since we are clearly the heaviest consumers of this technology. Now I am going to make a preliminary proposal. I emphasize that this is purely mine, has not been approved of, or even seen by the committee and I want your reactions. I am interested either in a reaction like, ``Here is my counter-proposal'' or ``This aspect could be improved in this way''. ``I think it stinks'' is not helpful (even if true). I should say that this is not a complete proposal, just a fragment and would need lots of filling out to become a complete proposal. Consider the following diagram, which is a correction of something from TTT. % TT-------------\>T % |\ \ % | \ \ % | \ \ % | \ \ % | \ \ % | \ \ % | \ \ % | \ 1 \ % | TT\eta'\ T\eta'\ % | \ \ % | \ \ % | \ \ % | \ \ % | \lr \mu%T' \lr % | TTT'===========\>TT' % T\eta'T| 2 | T\sigma | \ % | | | \ % | | | \ % | | | \ % | T\eta'TT'| 3 T\eta'T'| 6 \\$id$\l % (6) | | | \ % | | | \ % \v TT'T\eta' \v TT'\sigma \v T\mu' \lr\l % TT'T---------\>TT'TT'-------\>TT'T'----\>TT' % | | | | % | | | | % | | | | % | | | | % \sigma%T| 4 \sigma%TT'| 5 \sigma%T'| 7 |\sigma\l % | | | | % | | | | % \v \v \v \v % T'T---------\>T'TT'---------\>T'T'-----\>T' % T'T\eta' T'\sigma \mu' % \efig What I am thinking of would have the following syntax: \diagram(4,4) % make a diagram on a 4 x 4 grid \object(1,1){TT} % object at pos (1,1) on the grid is TT \object(2,1)T % object at pos (2,1) is T \object(2,2){TTT'} % and so on ..... \arrow(1,1)(2,2)_{TT\eta'} % draw an arrow with a subscript TT\eta % from position (1,1) to (2,2). Subscript means that it would be a % subscript if it were rotated to pointing along the x axis. \arrow(1,1)(2,1)_\mu % Similarly \twoarrow(2,2)(3,2)_{T\sigma}^{\mu T} % draw a double arrow, with a % subscript T\sigma on the bottom one and a superscript \mu T on top. ... % continue in this way to build a diagram, piece by piece \enddiagram Without the comments, this looks like: \diagram(4,4) \object(1,1){TT} \object(2,1)T \object(2,2){TTT'} ..... \arrow(1,1)(2,2)_{TT\eta'} \arrow(1,1)(2,1)_\mu \twoarrow(2,2)(3,2)_{T\sigma}^{\mu T} ... \enddiagram all in all, 12 objects and 15 arrows. Of course, abbreviations \ob and \ar can obviously be used. Would you prefer to be able to say, e.g. \object11{TT} Or even \object11 TT (I don't know if it is possible to use line ends as an argument delimiter, but if it is then that could be done.) More is needed. For example, sometimes you want a triangle to be isoceles and there should be a way of specifying that. The basic idea of this syntax is that TeX should work out the arrangements and place the labels (centred on the arrows, needless to say) and grow the arrows to encompass the labels and so on. In addition I think there should be more shapes. For example the names \ptriangle, \Vtriangle,... that I used in my package. I think those names are one of the best things about my package. I never have trouble recalling which is which. There is also the question of those numbers that are placed in the diagrams. I really don't know how to handle them, but they are quite unusual. Here is one kind of problem diagram I can forsee. If there is an shape \Vtriangle it will, of course, be isoceles. But consider a diagram of the shape . -----------> . | | | | | | | | | | | | v v . ------------> . \ / \ / \ / \ / \ / \ / v v . I want to be able to say \subdiagram(1,1)(3,2){\square...} \subdiagram(1,2)(3,3){\Vtriangle...} whose semantics is, I hope, evident. Many other things come to mind. Of course, sometimes there are three arrows, sometimes they go in different directions, sometimes they should be dashed and so on. Could this be implemented? Of course it can; TeX is Turing complete. The real question is, is it feasible? I don't know and it is not really my job to find out. Well, it is in a sense, since an unfeasible syntax will just not be implemented. One possibility is that someone will write an extension to TeX (analogous to Michael Ferguson's multi-lingual tex that allows accented words to be hyphenated) that are non-standard, but are an initialization option at least in some versions and that do it quickly, while high level code is written that takes a long time to function. I await your responses, if not with bated breath, then perhaps with my arms covering my face. Michael +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Here is what I think of Michael's proposal. I use XY-pic myself, and I am very satisfied by it. Therefore I am heavily biased in favour of XY-pic. | % TT-------------\>T | % |\ \ | % | \ \ | % | \ \ | % | \ \ | % | \ \ | % | \ \ | % | \ \ | % | \ 1 \ | % | TT\eta'\ T\eta'\ | % | \ \ | % | \ \ | % | \ \ | % | \ \ | % | \lr \mu%T' \lr | % | TTT'===========\>TT' | % T\eta'T| 2 | T\sigma | \ | % | | | \ | % | | | \ | % | | | \ | % | T\eta'TT'| 3 T\eta'T'| 6 \\$id$\l | % (6) | | | \ | % | | | \ | % \v TT'T\eta' \v TT'\sigma \v T\mu' \lr\l | % TT'T---------\>TT'TT'-------\>TT'T'----\>TT' | % | | | | | % | | | | | % | | | | | % | | | | | % \sigma%T| 4 \sigma%TT'| 5 \sigma%T'| 7 |\sigma\l | % | | | | | % | | | | | % \v \v \v \v | % T'T---------\>T'TT'---------\>T'T'-----\>T' | % T'T\eta' T'\sigma \mu' | % \efig | | What I am thinking of would have the following syntax: | | \diagram(4,4) % make a diagram on a 4 x 4 grid Why should I specify the size of the grid? The macros shoul do that for me. (Yes, XY-pic does that). | \object(1,1){TT} % object at pos (1,1) on the grid is TT I don't like to say \object every time. This can be inferred by the macros themselves, by letting everything be an object, except when it is a sub/superscript of an arrow. Also, I like the TeX alignment style of diagram specification, with & as a column separator, and \\ as a row separator better. This makes the code more position-independent, and less wysiwyg,ab-like. | \arrow(1,1)(2,2)_{TT\eta'} % draw an arrow with a subscript TT\eta The same goes for arrows. I like to specify a relative direction, instead of giving the exact co-ordinates. Co-ordinates are like goto's in programming languages: they make writing unreadable code very easy. The XY-pic syntax defines some standard arrows like \uto (up arrow), \drdashed (down-right dashed) or \drrto (one cell down, two to the right arrow). All these arrows can be made from more primitive commands, which specify relative, or absolute co-ordinates. This is extremely flexible, and allows the user to define her own arrows withoout much effort. | \enddiagram Yeah, I really like this. :-) | For example, sometimes you want a triangle to be | isoceles and there should be a way of specifying that. The basic Special things like triangles etc. and even whole diagrams can be made into macros in XY-pic. The relative addressing means that this is completely position-independent (the origin of the diagram is local). | there should be more shapes. For example the names \ptriangle, | \Vtriangle,... that I used in my package. I think those names are It can be done easily in XY-pic. What is even better is that the arrows and the grid will be modified according to the object/arrow labels if you pass them as parameters. | Could this be implemented? It has been implemented. One of the BIG advantages of XY-pic is that it is not just a package for drawing category theoretical diagrams. In the new version (of which I am a beta-tester), diagrams are an option, which you can put on top of the XY core language. This is really a complete graphics drawing language, programmed in TeX. It is incredibly clever, and still small, and fast. There are other options for drawing flow charts, general graphs, etcetera. | One possibility | is that someone will write an extension to TeX (analogous to Michael | Ferguson's multi-lingual tex XY-pic is completely programmed in TeX, and compatible with LaTeX, AMS (La)TeX, (e)plain TeX. One of the big pro's is that it does not depend on any non-TeX features. All you need apart from TeX is MetaFont (for the beautiful arrowtips and circle-pieces), and even that is not needed if you have a standard 300dpi laser printer. At home, I use it on a slow Atari 1040ST with a Canon BJ10 inkjet printer, and it works perfectly well. In summary, I am strongly in favour of XY-pic. If you want to try it out for yourself, you can ftp it from ftp.diku.dk, or mail to the writer of this incredibly versatile, and free (!), package, Kristoffer Rose (kris@diku.dk). -- Nico Verwer | nico@cs.ruu.nl Dept. of Computer Science, University of Utrecht | phone: +31 30 533921 p.o. box 80.089, 3508 TB Utrecht, The Netherlands | fax: +31 30 513791
being minimally competent, I will opt for for using more keystrokes but keeping things as readable as possible i.e. (12,3) for a position is fine standard use of _{ } for subscripting arrows names for special configs being as mnemonic as possible get the wrinkles out of 2-D diagrams before worrying about 3-D don't forget the need for curved arrows more later thanks jim +++++++++++++++++++++++++++++++++++
participants (4)
-
barr@triples.Math.McGill.CA -
CATEGORIES@mta.ca -
jds@math.upenn.edu -
Nico Verwer