3

enter image description here

Please help me to draw this diagram in LaTeX

  • 2
    tikz-cd package – Manuel Nov 11 '14 at 16:44
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – cfr Nov 11 '14 at 16:52
  • 16
    Your question leaves all the effort to our community, even typing the essentials of a TeX document such as \documentclass{}...\begin{document} etc. As it is, most of our users will be very reluctant to touch your question, and you are left to the mercy of our procrastination team who are very few in number and very picky about selecting questions. You can improve your question by adding a minimal working example (MWE) that more users can copy/paste onto their systems to work on. If no hero takes the challenge we might have to close your question. – cfr Nov 11 '14 at 16:53
10

The picture you show was created with Xy-pic. A modern replacement is tikz-cd:

\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz-cd}

\begin{document}
\[
\begin{tikzcd}
Y \arrow[r,hook] \arrow[d,swap,"T(f)"] &
\mathcal{H}(D^{\infty}(Y)) \arrow[r,"h"] \arrow[d,swap,"\widehat{T(f)}"]
  \arrow[dr,swap,dashed,"\widehat{f}\circ h"] &
\mathcal{H}(D^{\infty}(X)) \arrow[d,"\widehat{f}"] &
X \arrow[l,hook'] \arrow[d,"f"]
\\
\mathbb{R} & \mathbb{R} & \mathbb{R} & \mathbb{R}
\end{tikzcd}
\]

\end{document}

The hook' arrow type reverses the side of the hook. The rest should be almost self explanatory: you build a matrix, specifying the arrows with d for “down”, r for “right” and so on. The key swap refers to the position of the label (default is on the left of the arrow, going from tail to tip).

enter image description here

  • Would you be able to expand on why tikz-cd is a modern improvement on xypic? I don't know anything about their advantages and disadvantages relative to each other, and would love to learn. – Arun Debray Nov 11 '14 at 19:56
  • 1
    @ArunDebray tikz-cd is based on the powerful TikZ-PGF graphic creation package. Not only this, the syntax for commutative diagrams is far superior to Xy-pic's. – egreg Nov 11 '14 at 20:33
5

A pstricks-add solution, that can be compiled with pdflatex if the -shell-escape switch is enabled (TeX Live, MacTeX) or the --enable-write18 switch (MiKTeX).

\documentclass[pdf]{article}
\usepackage{amssymb}
\usepackage{pstricks-add}

\begin{document}
\[%
\begin{psmatrix}
%%% Matrix nodes
Y & \mathcal{H}\smash{(D^{\infty}(Y))} & \mathcal{H}\smash{(D^{\infty}(X))} & X \\
\mathbb{R} & \mathbb{R} & \mathbb{R} & \mathbb{R}
%%% Arrows
\psset{arrows=->, arrowinset=0.2, nodesep=2pt, shortput=nab, hookwidth=-4pt, hooklength=4pt}
\ncline{1,1}{2,1}_{T(f)}\ncline[arrows = H->]{1,1}{1,2}
\ncline{1,2}{2,2}_{\widehat{T(f)}}\ncline{1,2}{1,3}^{h}
\ncline{1,3}{2,3}_{\widehat{f}}
\ncline{1,4}{2,4}_{f}\ncline[arrows=H->, hookwidth=4pt]{1,4}{1,3}
\ncline[linestyle=dashed, nodesepA=6pt]{1,2}{2,3}\nbput[labelsep=0pt, npos=0.4]{\widehat{f}\circ h}
\end{psmatrix}
\]%

\end{document} 

enter image description here

  • 1
    @Svend Tveskæg: Sorry, I forgot my editor configuration displays (and saves \infty, naturally). Corrected. Thanks for pointing that. – Bernard Nov 11 '14 at 23:13
  • Thanks again! WinEdt is powerful, but it can be inconvenient sometimes… – Bernard Nov 11 '14 at 23:19
  • Emacs + AUCTeX is also powerful ... and doesn't have any inconveniences. ;) – Svend Tveskæg Nov 11 '14 at 23:22
  • 1
    Unfortunately, I never could get used to emacs — although it can make a good coffee. – Bernard Nov 11 '14 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.