[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-657519-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-657519-en":130},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","mdiagrams","Mdiagrams","","Diagrams package installation and usage guide for creating commutative diagram arrows and labels in LaTeX. Explains supported arrow behaviors such as automatic stretching to fit long labels or large objects, the lack of curved arrows by default, and key package options including small, nohug, and heads styling. Provides diagram syntax examples using directional prefixes and arrow suffixes, methods to add arrow labels via superscripts/subscripts or tilde-based breaks, and advanced construction with coordinate-based diagonal arrows and custom curved arrow commands. Also includes guidance on manual-based permissions and attribution requirements for research, textbooks, and related academic publications.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/mdiagrams/657519/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/mdiagrams/657519.png","ImageObject",300,407,{"name":42,"@type":43},"River Wang","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-10-30","2026-10-26",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",6,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"How do you install the diagrams package?","Question",{"text":63,"@type":64},"Rename the diagrams.sty file and place it where TEX can find it (e.g., in the same directory as the TEX file). A manual dated 15 June 1997 is available on the same site.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What options change arrow and label behavior?",{"text":68,"@type":64},"The guide shows using options like small (reduces spacing), nohug (stops label rotation with arrows, mostly), and heads=vee (controls arrowhead size/shape). It also demonstrates setting label style to script style.",{"name":70,"@type":61,"acceptedAnswer":71},"How are arrow labels added and can arrows be broken?",{"text":72,"@type":64},"Arrow labels are placed as superscripts or subscripts on the arrow (using braces if needed). Labels can also break arrows by using ~ instead of ^ in the arrow command.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},657519,1792981946,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":55,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":33,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":80,"read_time":123},1099514067438,"https://ap-avatar.wpscdn.com/avatar/100002539ee87300030?x-image-process=image/resize,m_fixed,w_180,h_180&k=1780474512215547542","The diagrams package  \nIf this is not already on your computer, you can download diagrams.tex from [http://www](http://www) . [paultaylor.eu/diagrams/](paultaylor.eu/diagrams/. To install)[. To install](paultaylor.eu/diagrams/. To install) it, simply rename the ﬁle diagrams.sty and put it somewhere that TEX can ﬁnd it, for example, in the same directory as your TEX ﬁle. A manual dated 15 June 1997 is available on the same site.  \nThe program supports a great variety of arrows, which automatically stretch or contract to match long labels or large objects. However it doesn't curve arrows. It allows a large number of options. For this ﬁle, I loaded it using  \n\\usepackage[small,nohug,heads=vee]{diagrams}\\diagramstyle[labelstyle=\\scriptstyle]  \nThe “small” reduces the distances between objects,“nohug” stops the labels rotating with their arrows (mostly), and “heads=vee” determines the size and shape of the heads on the arrows (alternatives LaTeX, littlevee, triangle, . . . ) . The second row makes the labelsprint in scriptstyle.  \nThe syntax is similar to that of array, as illustrated by:  \na A ~~ >~~ B  \nb c  \n_ d _C ~~ >~~ D  \n\\begin{diagram}  \nA &\\rTo^{a} &B\\\\  \n\\dTo_ {b} & &\\dTo_ {c}\\\\  \nC &\\rTo^{d} &D  \n\\end{diagram}  \nArrows are speciﬁed by a one-or two-letter preﬁx describing the direction, and a sufﬁx describing the body of the arrow. For example:  \nlu u ru ~~ >~~ To  \n^ ~~ >~~ Mapsto  \n~~ ~~ Line  \n􀀚~~ >~~ Into  \nl ~~\u003C ~~ ~~ >~~ r  \n~~ >>~~ Onto  \n.......>.. Dotsto  \n_ ~~ ~~ ~~>~~ Dashto  \nld d rd ===) Implies  \nTo invoke an arrow, combine the two, as illustrated by:  \n\\begin{diagram}  \nA 􀀚~~ >~~ B ~~\u003C ~~􀀛 C A &\\rInto &B &\\lInto &C\\\\  \n.  \n... &\\rdOnto &\\dDotsto &\\ldOnto\\\\  \n.  \n_.... & &D  \nD \\end{diagram}  \n\u003C >  \n\u003C\u003C  \n\u003C >  \n>>  \nThis is part of: Guide to Commutative Diagrams, [www.jmilne.org/not/CDGuide.html](www.jmilne.org/not/CDGuide.html)[ ](www.jmilne.org/not/CDGuide.html)September 23, 2010  \nTo add labels to arrows, place them as superscripts or subscripts on the arrow (between braces if necessary), as illustrated by:  \n\\begin{diagram}  \nA  \nu  \nd > B \u003C  \nu d  \nu d  \n_  \nud  \nud  \nD  \n\u003C  \n>  \nC  \nA &\\rTo^u_d &B &\\lTo^u_d &C\\\\  \n&\\rdTo^u_d &\\dTo^u_d &\\ldTo^u_d \\\\  \n& &D  \n\\end{diagram}  \nA superscript places the label above (or to the left) of an arrow. Labels can also be made to break arrows by using ~ instead of ^  \nA ~~ ~~ a~~ >~~ B A &\\rTo~{a} &B  \nArrows stretch to match long labels:  \nA ~~ >~~ B very long lab C  \n_ _ smaller _  \nD ~~ >~~ E ~~ >~~ F  \nNotice that the lower arrow also stretched.  \nArrows also stretch (or contract) to match large objects:  \nA 􀀂 A 􀀂 A 􀀂 A 􀀂 A  a > B  \nb c  \n_ d _  \nC ~~ >~~ D  \nIf a diagonal arrow is to go across x cells horizontally and y cells vertically instead of the usual 2+2, this can be achieved by placing (x,y) after the arrow command, as illustrated by:  \nF  \n\u003C  \n\u003C  \nc >  \nd >  \ne >  \n\\begin{diagram}  \nE  \n& &A\\\\  \n&\\ldTo(2,4)^f&&\\rdTo~c\\rdTo(4,2)~d\\rdTo(6,2)~e\\\\  \n& &B&\\rTo &C&\\rTo&D&\\rTo&E\\\\  \n&\\ldTo\\\\  \nF  \n\\end{diagram}  \nAnother example to illustrate the above rules:  \nT  \n x  \n􀀂 ZY ~~ ~~p~~ >~~  \nq_  \nY ~~ ~~g~~ >~~  \n>  \n(x;y) >  \n>  \nX  \nf  \n_ Z  \n\\begin{diagram} T&&&&\\\\  \n&\\rdTo~{(x,y)}\\rdTo(4,2)^x\\rdTo(2,4)_y&&&\\\\& &X\\times_ZY&\\rTo_p&X\\\\  \n& &\\dTo_q & &\\dTo_f\\\\  \n& &Y &\\rTo^g&Z  \n\\end{diagram}  \nIt is possible to introduce curved arrows into a diagram if you ﬁrst deﬁne them using the picture environment:  \n\\newcommand{\\lift}[2]{%\\setlength{\\unitlength}{1pt}\\begin{picture}(0,0)(0,0)  \n\\put(0,{\\#1}){\\makebox(0,0)[b]{${\\#2}$}}\\end{picture}  \n}  \n\\newcommand{\\lowerarrow}[1]{%  \n\\setlength{\\unitlength}{0.03\\DiagramCellWidth}\\begin{picture}(0,0)(0,0)  \n\\qbezier(-28,-4)(0,-18)(28,-4)  \n\\put(0,-14){\\makebox(0,0)[t]{$\\scriptstyle {\\#1}$}}\\put(28.6,-3.7){\\vector(2,1){0}}  \n\\end{picture}}  \n\\newcommand{\\upperarrow}[1]{%  \n\\setlength{\\unitlength}{0.03\\DiagramCellWidth}\\begin{picture}(0,0)(0,0)  \n\\qbezier(-28,11)(0,25)(28,11)  \n\\put(0,21){\\makebox(0,0)[b]{$\\scriptstyle {\\#1}$","cbCaitNutvbm8e0k","https://ap.wps.com/l/cbCaitNutvbm8e0k","pdf",122747,"English","# Installation and basic setup\n## Supported arrow behavior and package options\n# Arrow syntax and directions\n## Building arrows from prefixes and suffixes\n# Labeling arrows\n## Superscripts/subscripts and breaking with tilde\n# Stretching and coordinate-based diagonals\n## Diagonal arrows with (x,y)\n# Curved arrows via picture-defined commands\n## Example configurations and head styles\n# License and permission notes","[{\"question\":\"How do you install the diagrams package?\",\"answer\":\"Rename the diagrams.sty file and place it where TEX can find it (e.g., in the same directory as the TEX file). A manual dated 15 June 1997 is available on the same site.\"},{\"question\":\"What options change arrow and label behavior?\",\"answer\":\"The guide shows using options like small (reduces spacing), nohug (stops label rotation with arrows, mostly), and heads=vee (controls arrowhead size/shape). It also demonstrates setting label style to script style.\"},{\"question\":\"How are arrow labels added and can arrows be broken?\",\"answer\":\"Arrow labels are placed as superscripts or subscripts on the arrow (using braces if needed). Labels can also break arrows by using ~ instead of ^ in the arrow command.\"}]","Mdiagrams | PDF"]