3

I would like to reproduce the result of the following code

\documentclass[a4paper,11pt]{article}

\usepackage{amsmath,amsfonts}

\usepackage{xypic}

\begin{document}
\[\xymatrix{
&&&& \mathcal{T}\ar@{-}[dr]\ar@{-}[dl]\\
&&&\mathcal{A}^\perp\ar@{-}[dr]\ar@{-}[dl] && **[r] \mathcal{A} = \mathcal{A}_3\\
&&\mathcal{B}^{\perp, \mathcal{A}^\perp}\ar@{-}[dr]\ar@{-}[dl] && **[r] \mathcal{B} = \mathcal{A}_2\\
& \mathcal{C}^{\perp, \mathcal{B}^\perp}\ar@{-}[dr]\ar@{-}[dl] && **[r] \mathcal{C} = \mathcal{A}_1 \\
\mathcal{D}^{\perp, \mathcal{C}^\perp} & & **[r] \mathcal{D} = \mathcal{A}_0
\ar@{.}(55,-10);(127,-10)
\ar@{.}(55,-18);(127,-18)
\ar@{.}(55,-18);(55,-10)
\ar@{.}_{=t_3}(127,-18);(127,-10) 
%
\ar@{.}(35,-23);(107,-23)
\ar@{.}(35,-32);(107,-32)
\ar@{.}(35,-23);(35,-32)
\ar@{.}^{=t_2}(107,-23);(107,-32)
%
\ar@{.}(10,-38);(82,-38)
\ar@{.}(10,-47);(82,-47)
\ar@{.}^{=t_1}(82,-38);(82,-47)
\ar@{.}(10,-38);(10,-47)
%
\ar@{.}(-7,-52);(66,-52)
\ar@{.}(-7,-61);(66,-61)
\ar@{.}^{=t_0}(66,-52);(66,-61)
\ar@{.}(-7,-52);(-7,-61)
}\]
\end{document}

in a more efficient and smart way (y'know, I have a life to live and stuff to do :) ). More precisely, how can I draw the boxes you see, telling xypic only a minimum informations (e.g. the nodes that the box has to cover) and more importantly in a uniform manner (same size, same length, etc.)? Here is the output I want:

enter image description here

4
  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Sep 10, 2014 at 13:45
  • 2
    Done. Sorry!!!!
    – fosco
    Sep 10, 2014 at 13:48
  • 1
    Maybe doable with Xy, but perhaps TikZ is much better at this.
    – egreg
    Sep 10, 2014 at 13:59
  • I'll be glad to accept a tikz solution to the problem.
    – fosco
    Sep 10, 2014 at 14:36

1 Answer 1

3

A starting point in tikz, using the fit library for the boxes and the cd library for tikz-cd features.

\documentclass[tikz]{standalone}
\usetikzlibrary{cd, fit}
\tikzset{myboxgroup/.style={draw, densely dotted}} % style for the boxed groups

\begin{document}
\begin{tikzpicture}[commutative diagrams/every diagram]
\matrix[matrix of math nodes, name=m, commutative diagrams/every cell] {
 & & \mathcal{T} & \\
 & \mathcal{A}^{\perp} & & \mathcal{A} = \mathcal{A}_3 \\
 \mathcal{B}^{\perp,\mathcal{A}^{\perp}} & & \mathcal{B} = \mathcal{A}_2 \\
};
\node[myboxgroup, fit=(m-2-2) (m-2-4), label={right:$=t_3$}] {};
\node[myboxgroup, fit=(m-3-1) (m-3-3), label={right:$=t_2$}] {};
\path[commutative diagrams/.cd, every arrow/.append style={dash}]
  (m-1-3) edge (m-2-2)
  (m-1-3) edge (m-2-4)
  (m-2-2) edge (m-3-1)
  (m-2-2) edge (m-3-3);
\end{tikzpicture}
\end{document}

enter image description here

Further information in response to a comment:

The keys commutative diagrams/every diagram and commutative diagrams/every cell are used by the tikz-cd package to make a few settings at the beginning of every tikzcd environment. Since the tikzcd environment is not used here directly (I use a normal tikzpicture environment to allow for the fitted boxes), I set them manually. This ensures an appearance similar to that obtained using the tikzcd environment. The full definition of these keys is given in the tikz-cd package documentation, section 2.1.

3
  • Wonderful! Let me doodle a bit with the library for today and if nobody else proposes something better, you are the winner
    – fosco
    Sep 10, 2014 at 15:58
  • What does the "[commutative diagrams/every diagram]" part do? Also, the "commutative diagrams/every cell" part gives me a "TeX capacity exceeded" error... No clue why. If I remove it, no error, same output as you.
    – fosco
    Sep 10, 2014 at 21:20
  • I added some details about these keys to the post. About the error: Is your TeX distribution up to date? I'm on an updated TeX Live 2014, with Tikz/PGF v3.0.0 and tikz-cd v0.9b. Sep 10, 2014 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .