3

I am having an issue when writing a commutative diagram in Beamer using the \xymatrix command. The diagram is meant to be built piece-by-piece during the presentation. However, as I move through the slides, pieces of the diagram like to kind of shift around. It's not much a real problem as it is a potential distraction to members of the audience. Does anyone know how to fix it? Notice that the "shifts" occur once pieces that include the \cdots show up. However, I'm not sure if this has anything to do with it.

\documentclass[24pt]{beamer}

\usepackage{amssymb,amscd,amsthm,amsmath,graphicx,color}
\usepackage{booktabs}
\usepackage{color}
\usepackage[color,matrix,arrow]{xy}
\usepackage{ragged2e}
\usepackage[scale=2]{ccicons}
\usepackage{multicol}

\begin{document}

\begin{frame}
\pause
\xymatrix{
& & & & & & \uncover<1->{X \ar[dllllll]|-{f_0}} \only<4->{\ar[dlllll]|-{f_1}} \only<9->{\ar@{.>}[dllll]} \only<12->{\ar[dlll]|-{f_k}} \only<17->{\ar@{.>}[dll]} \only<20->{\ar[dl]|-{f_{i-1}}} \only<24->{\ar[dr]|-{\color{red}{f_i}}}\\
\uncover<1->{Y_0} & \only<5->{\ar[l]^{g_0}} \uncover<3->{Y_1} & \only<7->{\ar@{.>}[l] \cdots} & \only<13->{\ar[l]^{g_{k-1}}} \uncover<11->{Y_k} & \only<15->{\ar[l]^{g_k} \cdots} & \only<21->{\ar[l]^{g_{i-2}}} \uncover<19->{Y_{i-1}} & & \only<25->{\ar[ll]^{\color{red}{g_{i-1}}}} \uncover<23->{\color{red}{Y_i}}
}

\end{frame}


\end{document}
2
  • Try \visible instead of \only... Feb 27, 2017 at 23:00
  • That command wasn't useful. Thanks for the suggestion though. Feb 27, 2017 at 23:11

1 Answer 1

3

Here is a solution:

\documentclass[24pt]{beamer}

\usepackage{amssymb,amscd,amsthm,amsmath,graphicx,color}
\usepackage{booktabs}
\usepackage{color}
\usepackage[color,matrix,arrow]{xy}
\usepackage{ragged2e}
\usepackage[scale=2]{ccicons}
\usepackage{multicol}

\begin{document}

\begin{frame}
\pause
\xymatrix{
  & & & & & &
  \uncover<1->{X \ar[dllllll]|-{f_0}}
  \only<4->{\ar[dlllll]|-{f_1}}
  \only<9->{\ar@{.>}[dllll]}
  \only<12->{\ar[dlll]|-{f_k}}
  \only<17->{\ar@{.>}[dll]}
  \only<20->{\ar[dl]|-{f_{i-1}}}
  \only<24->{\ar[dr]|-{\color{red}{f_i}}}\\
  \uncover<1->{Y_0}
  &
  \only<-4>{\ar@{}[l]^{\phantom{g_0}}}
  \only<5->{\ar[l]^{g_0}}
  \uncover<3->{Y_1}
  &
  \only<7->{\ar@{.>}[l]}
  \visible<7->{\cdots}
  &
  \only<13->{\ar[l]^{g_{k-1}}}
  \uncover<11->{Y_k}
  &
  \only<15->{\ar[l]^{g_k}}
  \visible<15->{\cdots}
  &
  \only<21->{\ar[l]^{g_{i-2}}}
  \uncover<19->{Y_{i-1}}
  &
  &
  \only<25->{\ar[ll]^{\color{red}{g_{i-1}}}}
  \uncover<23->{\color{red}{Y_i}}
}

\end{frame}


\end{document}

enter image description here

2
  • Thank you very much! I will study and apply what you have done. Also, I am quite new to posting things on TeX StackExchange. How do I include the code AND the output like you have? Feb 28, 2017 at 0:11
  • @gorzardfu I convert PDF to GIF via convert -delay 50 -density 120 a.pdf a.gif Feb 28, 2017 at 0:32

You must log in to answer this question.

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