Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem of spurious space, but I can't find its origin.

Here is my MWE:

\documentclass{beamer}

\begin{document}
\begin{frame}{Dimensions et boites}{Commandes de manipulation des boites}
\parbox[c][.3\textheight][t]{\columnwidth}{%
%   \mbox{}%
    \only<+>{%
        \begin{itemize}
        \item Exemple: 
        \end{itemize}
        \parbox[c][.15\textheight][c]{\columnwidth}{%
            \centering\fbox{exemple}\raisebox{0pt}{\fbox{exemple}}\fbox{exemple}%
            \vphantom{\raisebox{-1ex}{\fbox{exemple}}\raisebox{\totalheight}{\fbox{exemple}}}
        }%
    }%
    \only<+>{%
        \begin{itemize}
        \item Exemple: 
        \end{itemize}
        \parbox[c][.15\textheight][c]{\columnwidth}{%
            \centering\fbox{exemple}\raisebox{1ex}{\fbox{exemple}}\fbox{exemple}
            \vphantom{\raisebox{-1ex}{\fbox{exemple}}\raisebox{\totalheight}{\fbox{exemple}}}
        }%
    }%
    \only<+>{%
        \begin{itemize}
        \item Exemple: 
        \end{itemize}
        \parbox[c][.15\textheight][c]{\columnwidth}{%
            \centering\fbox{exemple}\raisebox{\totalheight}{\fbox{exemple}}\fbox{exemple}
            \vphantom{\raisebox{-1ex}{\fbox{exemple}}\raisebox{\totalheight}{\fbox{exemple}}}
        }%
    }%
    \only<+>{%
        \begin{itemize}
        \item Exemple: 
        \end{itemize}
        \parbox[c][.15\textheight][c]{\columnwidth}{%
            \centering\fbox{exemple}\raisebox{-1ex}{\fbox{exemple}}\fbox{exemple}
            \vphantom{\raisebox{-1ex}{\fbox{exemple}}\raisebox{\totalheight}{\fbox{exemple}}}
        }%
    }%
}
\end{frame}
\end{document}

The \vphantom construction is here to make no vertical shift between the 4 baselines.

The first slide of the frame is slightly left shifted in comparison to the next 3, as shown on the picture below, resulting a bad looking animation.

enter image description here

share|improve this question
1  
After the \fbox{exemple} (second, third and last slide)? –  Qrrbrbirlbel Mar 7 '13 at 17:01

1 Answer 1

up vote 5 down vote accepted

You have \fbox{exemple}% in the first case but just \fbox{exemple} in the other cases so the spacing is out by one space.

share|improve this answer
    
Thanks, but why LaTex take this space into account? The paragraph is centred and this is the last space! Does \vphantom count as a box and not as a space? –  Lionel MANSUY Mar 7 '13 at 18:50
    
@LionelMANSUY vphantom is a box yes. –  David Carlisle Mar 7 '13 at 18:51
    
if you delete the % in the first case the line is longer by one space so it all moves to the left by half a space so matches the others. But really I don't think that hard Just seeing the subject line before I saw the code it was bound to be a missing % so I just spotted it straight away and answered although I did run the code just to check before posting. –  David Carlisle Mar 7 '13 at 19:11
    
Sorry, I was mistaken on the direction of the shift... –  Lionel MANSUY Mar 8 '13 at 8:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.