如何画 Quiver
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
\documentclass{amsart} \usepackage{mpgraphics} \begin{mpdefs} u=10pt; vardef pst(expr labdr)= begingroup os:=.7u; pair odr; if (labdr="u") : odr:=os*up; fi; if (labdr="d") : odr:=os*down; fi; if (labdr="l") : odr:=os*left; fi; if (labdr="r") : odr:=os*right; fi; endgroup; odr enddef; vardef quiver(expr P, Q, labP, labQ, labPQ, pstP, pstQ) = begingroup os:=0.3u; pair dr; dr:=unitvector(Q-P); pickup pencircle scaled 1pt; drawarrow P+os*dr--Q-os*dr; pickup pencircle scaled 1pt; label(btex $\circ$ etex, P); label(labP, pst(pstP)+P); label(btex $\circ$ etex,Q); label(labQ, pst(pstQ)+ Q); label (labPQ, os*(dr rotated 90)+(P+Q)/2); endgroup; enddef; \end{mpdefs} \begin{document} this is a test \begin{mpdisplay} z1=origin; z2=3u*(down+right); z3=z2+3u*(left+down); z4=z3+6u*(up+left); quiver(z1,z2,"1","2", btex $\alpha_1$ etex, "u", "r"); quiver(z2,z3,"2","3", btex $\alpha_2$ etex, "r", "d"); quiver(z3,z4,"3","4", btex $\alpha_3$ etex, "d", "l"); quiver(z4,z1,"4","1", btex $\alpha_4$ etex, "l", "u"); \end{mpdisplay} and this is not right \end{document} |
This is just a basic idea, after a while, I find the following complete package METAGRAPH.
本作品采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循署名-非商业用途-保持一致的创作共用协议.
发表回复