10

I do not understand why my attempts to introduce horizontal spacing in beamer (with hspace or typographical spacing) fail when within a minipage:

\documentclass[10pt]{beamer}

\begin{document}
  \frame{
    text \\
    \hspace{1cm} text \\
    \begin{minipage}{5cm}
      text \\
      \hspace{1cm} \quad text
    \end{minipage}
  } 
\end{document}

Why? How can I introduce this spacing? Thanks in advance.

11

The command \hspace{} won't be effective at the start of a line inside the minipage. You should use \hspace*{1cm} or \null\hspace{1cm}. As David notes the \null version should not be used at the start of the line at paragraph begining.

A MWE:

\documentclass[10pt]{beamer}

\begin{document}
\frame{
    text \\
    \hspace*{1cm} text \\
    \begin{minipage}{5cm}
      text \\
      \hspace*{1cm} \quad text
    \end{minipage}
}
\end{document}

enter image description here

  • 2
    The \null version would be OK after \\ but not at the start of a line that starts a paragraph. – David Carlisle Sep 23 '12 at 8:39
  • @DavidCarlisle: Thanks. Added to the answer. – user11232 Sep 23 '12 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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