0

I need to put up a commutative diagram in my latex document but unfortunately I could not find any package which could do that.

I am putting up the diagram in an image below, please take a look.

enter image description here

Thank you for your help :)

schzan
  • 103
  • See the tikz-cd package, do it as a 3x3 grid – daleif Mar 10 '16 at 17:33
  • Searching for latex commutative diagram found this line among others: http://www.jmilne.org/not/CDGuide06.pdf – Ethan Bolker Mar 10 '16 at 17:36
  • If you could please mention page number that would be great. I could not find any such diagram in there. Thanks. – schzan Mar 10 '16 at 17:40
  • The psmatrix environment from pst-node (pstricks family) is another solution. – Bernard Mar 10 '16 at 18:11
  • You could also use the XY-pic package. See [tag:xy-pic] or http://texdoc.net/texmf-dist/doc/generic/xypic/xyguide.pdf – KarlKlammer Mar 10 '16 at 18:28
  • tikz-cd is clearly your choice, if you are going to learn something new. Please do the beginning of that diagram and I will be happy to help you on any issue. There are already question on that circular arrow in tikz-cd around here. – LaRiFaRi Mar 11 '16 at 08:10

1 Answers1

1

Here is a solution with the psmatrix environment from pst-node (pstricks family)

\documentclass{article}
\usepackage{mathtools, amsfonts, amssymb}

\usepackage{pstricks-add}
\usepackage{pst-pdf}

\begin{document}

\[ \begin{postscript}
  \psset{arrows=->, arrowinset=0.15, linewidth=0.6pt, dash=4pt 3pt, nodesep=2pt, labelsep=2pt, colsep=1cm, rowsep=1cm, emnode=R, npos=0.5}
  \begin{psmatrix}
    [name=DF] $ \mathcal{DF}_{\!H_a} $ & &[name=M]$ (\mathcal{M},\bar{\partial}) $\\[-1.5ex]
      & [name=PF] $ \mathcal{PF}_{\!\widetilde{H}_{a}} $ \\
      & $ \mathcal F $
      \everymath{\scriptstyle}
      \ncline[linestyle=dashed, nodesep=4pt]{DF}{M}\naput{$ \varphi $}
      \ncline[arrows=H->, nodesep=1pt,]{2,2}{1,1}\naput[ labelsep= -1pt]{$ i_\mathcal{D} $}%
      \ncline[arrows=H->, hookwidth=-2mm, nodesepA=-1pt]{2,2}{1,3}\nbput[labelsep= 0pt]{$ i_{\mkern-2mu\mathcal{M}} $}%
      \ncline{3,2}{1,1}\naput[labelsep=-2pt]{$ u_{\mathcal{D}} $ }
      \ncline{3,2}{1,3}\nbput{$ u_{\mkern-2mu\mathcal{M}} $}
      \nput[labelsep=18pt]{90}{PF}{\psarcn(0,0){0.25}{-40}{40}}
    \end{psmatrix}
      \everymath{\scriptstyle}
      \ncline[linestyle=dashed, nodesep=4pt]{DF}{M}^{$ \varphi $}
      \ncline[arrows=H->, hookwidth=1.5mm, nodesep=1pt,]{2,2}{1,1}\naput[ labelsep= -1pt]{$ i_\mathcal{D} $}%
      \ncline[arrows=H->, hookwidth=-1.5mm, nodesepA=-1pt, ]{2,2}{1,3}\nbput[labelsep= 0pt]{$ i_{\mkern-2mu\mathcal{M}} $}%
      \ncline{3,2}{1,1}\naput[labelsep=-2pt]{$ u_{\mathcal{D}} $ }
      \ncline{3,2}{1,3}\nbput{$ u_{\mkern-2mu\mathcal{M}} $}
      \nput[labelsep=18pt]{90}{PF}{\psarcn(0,0){0.25}{-40}{40}}
    \end{postscript} \]

\end{document} 

enter image description here

Bernard
  • 271,350
  • If you compile this with pdflatex (as should be) don't forget to add the --enable-write18 switch when launching the compiler, if you're under MiKTeX, or -shell-escape (TeX Live, MacTeX). – Bernard Mar 11 '16 at 12:35
  • Thanks again, I'll let you know if any other problem arises once I try this. – schzan Mar 11 '16 at 12:40
  • Hi @Bernard, I tried to add the switch using this link http://tex.stackexchange.com/questions/37489/how-can-i-enable-write-18-on-a-miktex-installation but unfortunately, it doesn's recognise "intitexmf" command. Could you please tell me how to add this switch. I am using Texmaker 4.0.1 on windows 7 enterprise. – schzan Mar 14 '16 at 16:22
  • Which system and distribution do you have? – Bernard Mar 14 '16 at 21:00
  • I am using Texmaker 4.0.1(compiled with Qt 5.0.1) on windows 7 enterprise (2009). – schzan Mar 16 '16 at 16:00
  • Goto Options > Configure TeXMaker The second line (about pdflatex) should contain the line pdflatex -synctex=1 -interaction=nonstopmode. Replace it with pdflatex -synctex=1 -interaction=nonstopmode --enable-write18 %.tex (if you're under MiKTeX) or pdflatex -synctex=1 -interaction=nonstopmode -shell-escape (TeXLive, MacTeX). Perhaps also you should update TeXmaker (current version is 4.5). – Bernard Mar 16 '16 at 16:26
  • Thank you very much , Now, I am not getting any errors but still this diagram doesn't appears on the pdf doc. At the end there is a warning which says pspicture No1. undefined. – schzan Mar 17 '16 at 13:45
  • @shzan: sorry, I forgot to mention that pstricks code has either to be compiled with xelatex, or with pdflatex , but in the latter case, the ci=$ompiler has to be launched with the --enable-write18 switch, if you have MiKTeX, or -shell-escape for TeX LIve or MacTeX. – Bernard Mar 17 '16 at 18:58
  • Thanks for your reply but again I don't how to do that. I tired to look up online but could not find anything. Sorry for being a newb. – schzan Mar 21 '16 at 20:45
  • What are your distribution, editor and operating system? – Bernard Mar 21 '16 at 21:00
  • Texmaker 4.0.1(compiled with Qt 5.0.1) on windows 7 enterprise (2009) with Miktex 2.9 – schzan Mar 21 '16 at 21:11
  • Go to Options > Configure TeXmaker. In the 2nd line, replace pdflatex -synctex=1 -interaction=nonstopmode %.tex with pdflatex -synctex=1 -interaction=nonstopmode --enable-write18 %.tex. – Bernard Mar 21 '16 at 21:19
  • This is I have already done. – schzan Mar 21 '16 at 21:21
  • Well, you should be able to compile with pdflatex then. Note I've just midfied a detail in the code to be sure. What does the .log file say,exactly? – Bernard Mar 21 '16 at 21:42
  • File `AGF-pics.pdf' not found and pspicture No. 1 undefined. Name of my file is "AGF" and I dont understand what is "AGF-pics.pdf". I have not used it anywhere. – schzan Mar 23 '16 at 11:18
  • Hi @Bernard, Could you please help me with this query. – schzan Mar 31 '16 at 19:59
  • Oh! yes, sorry, I had forgotten your problem was not completely solved. Let me explain: pdflatex can't manage postscript files (it does not incorporate a computation engine for postscript instructions), so it has to outsource them (whence the --enable-write18 switch). During this process a postscript file is created, then changed into a .pdf graphic file, and the latter is finally incorporated into the main .pdf file. Your compiler seems not to fing these intermediate files. You should try first to compile via latex->dvips->pstopdf to see if there's no other problem. – Bernard Mar 31 '16 at 20:27
  • Thanks for replying. But there is no option for latex->dvips. – schzan Mar 31 '16 at 20:57
  • Goto Options > Configure TeXmaker > Quick Build and select the 3rd item. – Bernard Mar 31 '16 at 21:04
  • Now there are so many errors like1.! Undefined control sequence. @PackageInfoNoLine, 2.LaTeX Error: Missing \begin{document}.See the LaTeX manual or LaTeX Companion for explanation.Type H for immediate help.... @PackageInfoNoLine{e – schzan Mar 31 '16 at 21:10
  • Did you compile exactly the code I posted? – Bernard Mar 31 '16 at 21:12
  • yes, I did exactly what you have done. – schzan Apr 01 '16 at 00:03