3

I would like to draw a very single commutative diagram, I look for some basic examples to modify but did not found one that uses an arrow towards the left and the right (<--->): My diagram, if I write \leftarrow the resulting arrow is very small. I have found that tutorial for commutative diagrams, but was not very useful. If you can help, I would like to know the code that allows to fix the diagram in a slide.

2 Answers2

3
% arara: pdflatex

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

\begin{document}
\begin{tikzcd}[column sep=6em, row sep=10ex]
    \parbox[t]{9.5em}{\raggedright SU(N) gauge theory (Quantum)} \arrow[<->]{r}{\text{Duality}} \arrow{d}{\parbox[c]{9.5em}{\raggedright\scriptsize Saddle point approximation}}& \parbox[t]{9.5em}{\raggedright String Theory Gravity (Quantum)} \arrow{d} \\
    \parbox[t]{9.5em}{\raggedright Large N gauge theory} \arrow[<->]{r}{\text{Duality}} & \parbox[t]{9.5em}{Classical Gravity}
\end{tikzcd}
\end{document}

enter image description here

LaRiFaRi
  • 43,807
  • your code worked in article class. I tried to use your code for my beamer class document but it does not work. I wrote the code I'm using for my beamer in the answer below. – Patrick El Pollo Nov 05 '14 at 17:42
0

This code, based on pstricks, works with beamer. I use the eqparbox package to avoid to compute the width of parboxes by trial and error. It is compilable with pdflatex if you set the -shell-escape (TeX Live, MacTeX) or --enable-write18 (MiKTeX) switch.

\documentclass[pdf]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{pst-node}
\usepackage{eqparbox}

\begin{document}
\vspace*{1cm}
    \sffamily\bfseries\centering
    \psset{arrows=->, arrowinset=0.1, nodesep=3pt, labelsep=2pt, colsep=2.5cm, rowsep=2cm}%,
    \begin{psmatrix}
    \eqparbox{L}{SU(N) gauge theory\\Quantum} & \eqparbox{R}{String Theory \\Gravity (Quantum)} \\
    \eqparbox{L}{Large N gauge theory} & \eqparbox{R}{Classical Gravity}
    \ncline{1,1}{2,1}\naput{\begin{tabular}{@{}l}Saddle point \\ approximation\end{tabular}} \ncline{1,2}{2,2}
     \ncline[ arrows=<->]{1,1}{1,2}\naput{Duality}
     \ncline[arrows=<->]{2,1}{2,2}\naput{Duality}
    \end{psmatrix}
\end{document} 

enter image description here

Bernard
  • 271,350