58

Customizing spacing between paragraphs in Beamer plagues me constantly. To split two paragraphs by one empty line I usually put \medskip tag between paragraphs, but this is very ugly solution.

Now I try with \parskip, which works fine, but fails inside various environments (e.g., also affecting spacing between items in itemize environment). Minimum example is pasted below.

Any help is much appreciated.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{parskip}
\setlength{\parskip}{\smallskipamount} 

\begin{document}
\begin{frame}{Test frame}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum quis erat dolor. Aenean tincidunt sem non quam feugiat tempus.

Sed semper justo vitae sem ultrices semper. Mauris urna leo, dictum eget vulputate vitae, venenatis ut leo.
\end{frame}
\end{document}
6
  • @Andrej: Welcome to tex.sx! Note that it is unusual around here to sign your questions (as there is already a box with your name below it) or to have any greeting. Feb 21, 2011 at 11:19
  • It would be helpful to know what effect you want to achieve...
    – Seamus
    Feb 21, 2011 at 12:12
  • A crude solution would be to define a wrapper for itemize etc that setlength to what it needed, and then set it back again after the environment. But I think the explicit spacing is probably the easiest in general. It's not often you'll have more than a couple of paragraphs on a slide, surely...
    – Seamus
    Feb 21, 2011 at 13:09
  • 1
    @Seamus To split two paragraphs by one empty line.
    – Andrej
    Feb 21, 2011 at 15:05
  • @Andrej and you want this to be done automatically? Without having to add \medskip manually?
    – Seamus
    Feb 21, 2011 at 15:23

5 Answers 5

84

I had the same problem: blank lines in latex articles produces a clearly separated paragraph, but in Beamer, with the limited space and no indentation, the default new paragraph is does not strikingly separate the paragraphs.

My hack solution was to append the following latex code to the end of the paragraph that should have the space.

\\~\

For example, try inserting this into a Beamer latex file:

\frame{
  This is text that should have a blank line after it. \\~\\
  Here is text following a blank line.
}
4
  • 9
    I get an "There's no line here to end. See the LaTeX manual..." error. EDIT: since it was at the beginning of the line, I had to put "~\\" instead. Dec 14, 2013 at 14:12
  • @Kalin: you left end backspace first occurrance?
    – pevik
    Aug 20, 2018 at 15:40
  • This solution is so simplistic! May 12, 2019 at 9:13
  • 4
    A more versatile hack is, e.g., \\[2ex]. This allows for custom gaps.
    – Jollywatt
    Aug 12, 2019 at 0:02
12

I think your original approach works just fine, if you just discard the parskip package. Doing that DOES increase between paragraph spaces while leaving the itemize environment unaffected.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\setlength{\parskip}{\baselineskip} 

\begin{document}
\begin{frame}{Test frame}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum quis     erat dolor. Aenean tincidunt sem non quam feugiat tempus.

\begin{itemize} \itemsep0em
\item abcdefg 
\item abcdefgabcdefgabcdefg
\item abcdefg
\end{itemize}


Sed semper justo vitae sem ultrices semper. Mauris urna leo, dictum eget vulputate vitae, venenatis ut leo.

Sed semper justo vitae sem ultrices semper. Mauris urna leo, dictum eget vulputate vitae, venenatis ut leo.
\end{frame}
\end{document}
1
  • 2
    This is by far the cleanest solution. Sep 2, 2021 at 14:58
12

I've noticed this too when preparing slides. Rather than have two paragraphs and separate them with vertical space explicitly, I've often used one of the following workarounds:

  • convert each of the paragraphs you want to split to a block-like environment such as theorem, question, answer, etc. That way (in my theme, at least) they get boxed and visually separated.

  • if the two paragraphs are simply text, it should be sufficient to use either the center, flushleft, or flushright environment with the second paragraph

  • if the two paragraphs are supporting material to the same point, use an itemize environment and make each its own \item. Then you get some vertical separation and a visual cue (bullet, triangle, or anything else you want) indicating that these are separate ideas.

Any of these should make the frame more readable.

11

I'm not sure exactly what you want, but perhaps you'll find the tex command \vfill to be useful. I often put that between chunks of text so they get spaced out over the slide, which makes the slide easier for the viewer.

My other hint, as a long-time lecturer and audience member, is to use as few words as possible. Use slides for diagrams (in technical talks) or pretty pictures that evoke changing themes (in non-technical talks). Avoid paragraphs, and even sentences. Don't force audience members to decide whether to listen to you or read your material.

3
  • This solution has the problem that it's just as "manual" and "ugly" as the OP's \medskip solution
    – Seamus
    Feb 21, 2011 at 13:05
  • 1
    \vfill makes "horrid" spaces between paragraphs. Spaces are also not consistent across frames. @dan I accept your suggestion to use as few words as possible, but sometimes it's necessary.
    – Andrej
    Feb 21, 2011 at 14:58
  • @Andrej: Yes, \vfill inserts "as much space as possible," which can be be more or less on different frames. Feb 21, 2011 at 16:02
9

I am using this command for defining distance between block or expanding blocks. This one for vertical

\vspace{0.3cm}

This one for horizontal.

\hspace{0.3cm}
6
  • 3
    why not the build in \bigskip, \medskip, \smallskip?
    – daleif
    Feb 2, 2014 at 15:37
  • Usually I want to define size of white block for every case separately. Especially in case of moving pictures. Feb 3, 2014 at 8:16
  • overlayarea env?
    – daleif
    Feb 3, 2014 at 8:53
  • I had to use google, to find out what is it... I would say I never used overlay features. It is possible, that I did, but I didn’t knew about it. I didn’t wrote all code in my templates. Feb 3, 2014 at 12:01
  • Next time look in the Beamer manual, google does not always give the best answers.
    – daleif
    Feb 3, 2014 at 12:41

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.