1

I'm trying to make all arrows in the following diagram look the same length.

enter image description here

In beamer, the code is as follows:

\documentclass[14pt]{beamer}
\usepackage{xypic}
\begin{document}
\begin{frame}{A visualization of $\mathcal{Q}_n$}
\begin{spacing}{1.5}
\begin{center}
\centerline{\xymatrix@R=1pc@C=0.1em{
&   &                   &      &       \ar[dl](0,n)\ar[dr] &      &        &                                  & &\\
&   &                   &      (0,n-1)\ar[dl]\ar[dr] &                   &     \ar[dl](1,n)\ar[dr]& &      &               & &\\
&   &                   \Ddots\ar[dr]\ar[dl] &       &                   &          & \ddots\ar[dr]\ar[dl] &               & &\\
&   (0,1)\ar[dr]\ar[dl] &      &       & \cdots            &      & &          \ar[dl](n-1,n)\ar[dr]  & &\\
(0,0) &                 &(1,1)           &      &   \cdots     &            &          &       &     (n,n)}}
\end{center}
\end{spacing}
\end{frame}
\end{document}

How can I edit this to make all arrows the same length?

3
  • \phantom{(0,0)} in those empty nodes?
    – Manuel
    Commented Mar 14, 2015 at 14:52
  • Please make your example compilable. It is at least missing \begin{document} and some definition or package for \begin{spacing}. If possible, give a very minimal example using the article or standalone class. Like this, it is not clear if the problem depends on beamer or not. Thank you.
    – LaRiFaRi
    Commented Mar 16, 2015 at 8:19
  • You should have a look on trees made with TikZ.
    – LaRiFaRi
    Commented Mar 16, 2015 at 8:44

2 Answers 2

2

Here is something to start with. The only thing you will have to do is to smash the diagonal dots in order to get them on the same height as the other stuff:

% arara: pdflatex

\documentclass{standalone}
\usepackage{tikz-cd}
\newcommand{\placeholder}{\phantom{(0,n)}}

\begin{document}
\begin{tikzcd}[%
    ,row sep={1cm,between origins}
    ,column sep={1cm,between origins}
    ]
& & & & \ar[dl](0,n)\ar[dr] & & & & \\
& & & (0,n-1)\ar[dl]\ar[dr] & & \ar[dl](1,n)\ar[dr] & & & \\
& & \placeholder\ar[dr]\ar[dl] & & \placeholder & & \placeholder\ar[dr]\ar[dl] & & \\
& (0,1)\ar[dr]\ar[dl] & & \placeholder & \cdots & \placeholder & & \ar[dl](n-1,n)\ar[dr] & \\
(0,0) & & (1,1) & & \cdots & & \placeholder & & (n,n)
\end{tikzcd}
\end{document}

enter image description here

2

Adding @!0 forces and ignores entry sizes between rows and columns, and then you can make them the size you want, I chose 15mm:

\documentclass{article}
\usepackage[all]{xy}
\begin{document}
\xymatrix@!0@R=15mm@C=15mm{
&&&&\ar[dl](0,n)\ar[dr]&&&&\\
&&&(0,n-1)\ar[dl]\ar[dr]&&\ar[dl](1,n)\ar[dr]&&&\\
&&\Ddots\ar[dr]\ar[dl]&&&&\ddots\ar[dr]\ar[dl]&&\\
&(0,1)\ar[dr]\ar[dl]&&&\cdots&&&\ar[dl](n-1,n)\ar[dr]&\\
(0,0)&&(1,1)&&\cdots&&&&(n,n)}}
\end{document}

You must log in to answer this question.