Changing \parskip to add space between paragraphs (but nowhere else)

1,648 views
Skip to first unread message

Markus Kuhn

unread,
Jan 17, 2011, 12:21:50 PM1/17/11
to LaTeX Beamer class
As a new user, I've run so far into only one nagging problem with
Beamer:

It uses \parskip=0pt by default, i.e. there is no space between
paragraphs, which I find rather inconvenient.

Unfortunately, I've not found a satisfying way to change \parskip:

If I simply use

\setlength{\parskip}{\smallskipamount}

then this not only adds the desired space between paragraphs, but also
at lots of other places, where I don't want it, especially list
environments such as itemize, displayed equations, etc.

As LaTeX comes with a parskip package to fix this in the standard
classes, I've also tried

\usepackage{parskip}
\setlength{\parskip}{\smallskipamount}

which works much better. I have now a small skip between paragraphs,
without changing the other places.

Unfortunately, this fails inside various blocks, e.g. inside the
columns environment, which seems to be immune to the efforts of the
parskip package.

Any suggestions?

What is needed for Beamer to properly support the parskip package, or
offer an equivalent facility (e.g., a parskip option)?

Markus Kuhn

--
Markus Kuhn, Computer Laboratory, University of Cambridge
http://www.cl.cam.ac.uk/~mgk25/ || CB3 0FD, Great Britain

Markus Kuhn

unread,
May 27, 2014, 6:51:16 PM5/27/14
to beamer...@googlegroups.com
So far, I've added to my beamer theme

% define an option for setting \parskip (space between paragraphs)
\DeclareOptionBeamer{parskip}[\smallskipamount]{\def\beamer@parskip{#1}}
\ExecuteOptionsBeamer{parskip}
\ProcessOptionsBeamer
\ifdim\beamer@parskip=0pt\else
  \usepackage{parskip}
  \setlength{\parskip}{\beamer@parskip}
  \newcommand{\@minipagerestore}{\setlength{\parskip}{\beamer@parskip}}
\fi

in order to set \parskip to a non-zero value (default: \smallskipamount). If the
theme is called with \usetheme[parskip=0pt]{...} this still preserves the
original setting.

Setting \parskip in \@minipagerestore helps the setting to propagate
into minipage-like environments, such as 'columns'.

Unfortunately, this is not yet a complete solution: a positive
\parskip still causes unwanted space in the heading of any 'block'
environment.

Reply all
Reply to author
Forward
0 new messages