# Beamer: effect of newline and hphantom

Why is it that the file

\documentclass{beamer}
\begin{document}
\begin{frame}
a\\
\hphantom{ }b
\end{frame}
\end{document}


produces an a and a b vertically aligned with a line skip in between whereas the same file with \\ replaced by \newline produces the expected: an a, then a b on the next line, indented by one space?

Is that a bug in Beamer (in documentclass Article, both versions have the same, expected effect)?

Thanks!

-

I'd call this a feature of how beamer redefines \\. After it TeX is in vertical mode, so the \hphantom, which ultimately does \box2 doesn't start horizontal mode.

Use

\leavevmode\hphantom{ }


Note that standard LaTeX doesn't start vertical mode after \\.

-
That's a strange vision of a 'feature' but ok, it makes sense. Thanks! –  mqtthiqs Sep 4 '12 at 12:33
@mqtthiqs Well, our beloved moderator Joseph, who has taken over maintenance of beamer, is looking. :) –  egreg Sep 4 '12 at 12:36