[Xy-pic] On how diagxy calls XyPic
Eduardo Ochs
eduardoochs at gmail.com
Sun Feb 3 08:25:03 CET 2019
Hi list,
this idea is on the frontier between diagxy and XyPic, but I thought
that this would be the best place to discuss it.
Consider, for example, this diagram in diagxy:
\documentclass{article}
\input diagxy
\xyoption{curve}
\begin{document}
$$\bfig
\morphism(0,-675)|a|/{@{->}@<2.5pt>@/^15pt/}/<900,675>[{X}`{Y};{f}]
\morphism(0,-675)|b|/->/<900,675>[{X}`{Y};{g}]
\morphism(900,0)|a|/{@{->}@<2.5pt>@/^15pt/}/<900,-675>[{Y}`{Z};{h}]
\morphism(900,0)|b|/->/<900,-675>[{Y}`{Z};{i}]
\morphism(0,-675)|a|/{@{->}@/^15pt/}/<1800,0>[{X}`{Z};{k}]
\morphism(0,-675)|m|/->/<1800,0>[{X}`{Z};{j}]
\morphism(0,-675)|m|/{@{->}@<-15pt>}/<1800,0>[{X}`{Z};{hf}]
\morphism(0,-675)|m|/{@{->}@<-15pt>@/_15pt/}/<1800,0>[{X}`{Z};{ig}]
\morphism(225,-337)|a|/->/<225,0>[{\phantom{O}}`{\phantom{O}};{\beta}]
\morphism(1350,-337)|a|/<-/<225,0>[{\phantom{O}}`{\phantom{O}};{\delta}]
\morphism(900,-540)|l|/{@{<-}@<-15pt>}/<0,-450>[{\phantom{O}}`{\phantom{O}};{t}]
\morphism(900,-652)|r|/{@{<-}@<15pt>}/<0,-225>[{\phantom{O}}`{\phantom{O}};{s}]
\efig
$$
\end{document}
If we take a look at diagxy.tex, that in my machine is in this path,
/usr/local/texlive/2018/texmf-dist/tex/generic/barr/diagxy.tex
we see that the high-level macro "\morphism" can be called with some
of its arguments omitted; it calls "\morphismp", that calls
"\morphismpp", that calls "\morphismppp", that calls "\morphismppp",
that call "\domorphism", and "\domorphism" has lots of "if"s and lots
of calls to XyPic. The first of them is:
\POS(#1,#2)*+!!<0ex,\axis>{#7}\ar#4^-{#9}
(\xend,\yend)*+!!<0ex,\axis>{#8}%
If we replace it by
\XYPIC{\POS(#1,#2)*+!!<0ex,\Axis>{#7}\ar#4^-{#9}
(\Xend,\Yend)*+!!<0ex,\Axis>{#8}}%
and do the same for all the other calls to XyPic, and define
\def\XYPIC#1{{%
\def\POS {POS }%
\def\ar {ar }%
\def\labelstyle{labelstyle }%
\def\beta {beta }%
\def\delta {delta }%
\def\phantom {phantom }%
\def\Axis{\the\axis}%
\def\Xend{\the\xend}%
\def\Yend{\the\yend}%
\directlua{print("#1")}%
}}
then we get this on stdout:
POS (0,-675)*+!!<0ex,2.5pt>{X}ar @{->}@<2.5pt>@/^15pt/^-{f}
(900,0)*+!!<0ex,2.5pt>{Y}
POS (0,-675)*+!!<0ex,2.5pt>{X}ar @{->}_-{g} (900,0)*+!!<0ex,2.5pt>{Y}
POS (900,0)*+!!<0ex,2.5pt>{Y}ar @{->}@<2.5pt>@/^15pt/^-{h}
(1800,-675)*+!!<0ex,2.5pt>{Z}
POS (900,0)*+!!<0ex,2.5pt>{Y}ar @{->}_-{i} (1800,-675)*+!!<0ex,2.5pt>{Z}
POS (0,-675)*+!!<0ex,2.5pt>{X}ar @{->}@/^15pt/^-{k}
(1800,-675)*+!!<0ex,2.5pt>{Z}
POS (0,-675)*+!!<0ex,2.5pt>{X}ar @{->}|-*+<1pt,4pt>{labelstyle
j}(1800,-675)*+!!<0ex,2.5pt>{Z}
POS (0,-675)*+!!<0ex,2.5pt>{X}ar @{->}@<-15pt>|-*+<1pt,4pt>{labelstyle
hf}(1800,-675)*+!!<0ex,2.5pt>{Z}
POS (0,-675)*+!!<0ex,2.5pt>{X}ar
@{->}@<-15pt>@/_15pt/|-*+<1pt,4pt>{labelstyle
ig}(1800,-675)*+!!<0ex,2.5pt>{Z}
POS (225,-337)*+!!<0ex,2.5pt>{phantom {O}}ar @{->}^-{beta }
(450,-337)*+!!<0ex,2.5pt>{phantom {O}}
POS (1350,-337)*+!!<0ex,2.5pt>{phantom {O}}ar @{<-}^-{delta }
(1575,-337)*+!!<0ex,2.5pt>{phantom {O}}
POS (900,-540)*+!!<0ex,2.5pt>{phantom {O}}ar @{<-}@<-15pt>_-{t}
(900,-990)*+!!<0ex,2.5pt>{phantom {O}}
POS (900,-652)*+!!<0ex,2.5pt>{phantom {O}}ar @{<-}@<15pt>^-{s}
(900,-877)*+!!<0ex,2.5pt>{phantom {O}}
that is ALMOST the XyPic code that diagxy calls, except for the
missing backslashes - that I don't know how to add.
The code is here:
http://angg.twu.net/LATEX/2019diagxyhack.tex
Cheers,
Eduardo Ochs
http://angg.twu.net/dednat6.html
http://angg.twu.net/math-b.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xy-pic/attachments/20190203/18f98a9b/attachment.html>
More information about the xy-pic
mailing list