[texhax] Problem with beamer adding spaces

Michael Barr barr at math.mcgill.ca
Mon Sep 28 22:35:55 CEST 2015


The problem is illustrated with this file:

\documentclass{beamer}
\input diagxy
\begin{document}

\begin{frame}

 $$\bfig
 \node 1(0,500)[A]
 \node 2(500,500)[B]
 \node 3(0,0)[C]
 \node 4(500,0)[D]
 \arrow [1`2;f]
 \arrow [1`3;g]
 \arrow [2`4;h]
 \arrow [3`4;k]
 \efig$$
\end{frame}

\begin{frame}
 $$\bfig
 \node 1(0,500)[A]
 \node 2(500,500)[B]
 \node 3(0,0)[C]
 \node 4(500,0)[D]
 \uncover<2->{\arrow [1`2;f]}
 \uncover<3->{\arrow [1`3;g]}
 \uncover<4->{\arrow [2`4;h]}
 \uncover<5->{\arrow [3`4;k]}
 \efig$$
\end{frame}

\begin{frame}
 $$\bfig
 \node 1(0,500)[A]
 \node 2(500,500)[B]
 \node 3(0,0)[C]
 \node 4(500,0)[D]
 \only<2->{\arrow [1`2;f]}
 \only<3->{\arrow [1`3;g]}
 \only<4->{\arrow [2`4;h]}
 \only<5->{\arrow [3`4;k]}
 \efig$$
\end{frame}

\end{document}

As you see if you tex it, the beamer command \uncover adds spaces.  Yes, you can work around it by adding % at the end of each line, but that is a nuisance.  The one using \only has its own minor problems that are unfixable.  That is caused by the fact that \only actually just throws its argument away and as an arrow and label are added, the picture shifts slightly since it grows higher and wider (only slightly in this example, but one could imagine an example in which the shift is larger).  What is odd is that spaces are invariably ignored in math modes and even blank lines are ignored in xy diagrams.  I tried replacing uncover, defined as follows:
\def\unc<#1>#2{\uncover<#1>#2\ignorespaces} but that just led to an incomprehensible error message.

Is this a bug?  Is there an easy fix?

Michael


More information about the texhax mailing list