Hi Owen, I agree that the TeXmacs support for commutative diagrams could be further improved. I see two things to be done:
1) Improved long arrows that use the arrow heads from the current font and with better support for text above and below arrows. 2) A better interface which allows TeXmacs to know between which pieces of text there are arrows. It is not clear for me whether (2) should be based on tables or on the graphics mode. Commutative diagrams are fairly graphical in nature, so complex diagrams are indeed very much like drawings. But the spacing is very rigid for simple commutative diagrams and very table-like indeed. Maybe both possibilities should be improved, in fact. Point (1) requires some work, but I do not see any big difficulties. Point (2) is more subtle, and would require quite some hacking, both on the C++ side and on the Scheme side. Indeed, on the C++ side, we would need markup and typesetter support for arrows between different pieces of markup. It would be nice if we could turn pieces of text into "magnets" and then have a special arrow mode for connecting such magnets. But I fear that this is quite some work, since it seems that this is really a new kind of mode besides the existing text/math/prog/graphics modes. Best wishes, --Joris On Wed, Oct 07, 2020 at 12:19:14PM +0200, Owen Lynch wrote: > Hello, > > I'm a semi-lapsed TeXmacs user. I love TeXmacs, but a majority of my > mathematical work uses commutative diagrams, and the friction between TeXmacs > and xypic is one of the big reasons why I head to LaTeX a lot. > > The way that tikzcd/xypic does commutative diagrams is very natural; the > items are put into a grid, and then arrows are drawn between them. It seems > to me that this could be a great match for TeXmacs; all that would have to be > done is add support for arrows to a subclass of the existing "table" layout. > I know that commutative diagrams could be done with the figure drawing > interface, however it's just not convenient enough to produce commutative > diagrams in volume. > > Essentially my idea is to subclass table and add a list of arrows with source > and target. Then during layout, after the layout of each of the table cells > has been calculated, each arrow would go from the boundary of its source cell > to the boundary of its target cell. > > As a newbie to the TeXmacs source, I would like to ask for some guidance > about how to go about implementing this, however. Should it be done in C++, > or could it be done in pure scheme? Are there "developer docs" somewhere that > I should look at? Are there previous attempts along these lines, or similar > pieces of code which I could look to for calculating the arrow > source/targets? What is the minimal implementation of this that would get a > commutative diagram on the screen, so that I can work off of that for > developing the UI? Ideally, the UI would end up looking something like: > https://tikzcd.yichuanshen.de/. > > -Owen > > _______________________________________________ > Texmacs-dev mailing list > Texmacs-dev@gnu.org > https://lists.gnu.org/mailman/listinfo/texmacs-dev _______________________________________________ Texmacs-dev mailing list Texmacs-dev@gnu.org https://lists.gnu.org/mailman/listinfo/texmacs-dev