# Gratuitous vertical space with nested list environments given a certain line length

In the following MWE the simple addition of ":" causes some extra vertical spacing to appear before the nested enumerate environment, despite the fact that adding ":" does not cause the text to split across another line. Any idea what's going on?

\documentclass{beamer}
\usetheme{CambridgeUS}

\begin{document}

\begin{frame}{Test}

\begin{itemize}
\item{Actional verbs appeared in full \emph{be}-passive, full \emph{get}-passive, and active
\begin{enumerate}[(1)]
\item{\ldots}
\end{enumerate}
}
\item{Actional verbs appeared in full \emph{be}-passive, full \emph{get}-passive, and active:
\begin{enumerate}[(1)]
\item{\ldots}
\end{enumerate}
}
\end{itemize}

\end{frame}

\end{document}


The question here is why this is happening. That is, I'm happy to just leave out the ":" for the beamer presentation that I'm putting together, so I'm not particularly interested in a 'solution' to the 'problem'. I'm just curious why this is happening and whether this is by design in beamer.

(Note: the effect is dependent on use of this particular theme. Although, if this is underlyingly an issue with beamer one could presumably construct analogous cases for other themes. Although, if this is underlyingly an issue with (La)TeX (see update), one could presumably construct analogous cases in other beamer themes and other document classes that exhibit this behavior. (Although, see update 2.))

Update:

As per some of the comments and @Thruston's answer, I thought I would update the question.

First, I've removed the beamer tag, as this does not seem to be about beamer. Given @KevinC's comment, the hunch is that this is related to glue in (La)TeX. (See below.)

Second, I wanted to point out that this behavior persists even if one puts everything on one line without any space after ":", so it's still a mystery (at least to me, given my naive understanding of how things are set in horizontal mode), why there would be white space after the ":" that gets pushed to the next line. Does anyone have an explanation?

\documentclass{beamer}
\usetheme{CambridgeUS}

\begin{document}

\begin{frame}{Test}

\begin{itemize}
\item{Actional verbs appeared in full \emph{be}-passive, full \emph{get}-passive, and active:\begin{enumerate}[(1)]\item{\ldots}\end{enumerate}}
\end{itemize}

\end{frame}

\end{document}


Update 2:

I've added the beamer tag again, as @Thruston seems to think it has to do with how the beamer macros process space.

-
The second line is a little bit to long. Not enough to put last word in new line, bur enough to make empty space below next enumerating environment. try to make second line shorter for few character o longer for the same number of them /which can be hyphenated). Hopefully this will help. –  Zarko Jan 24 at 2:53
A quick-fix to still keep it but not let it influence anything else is to use \rlap{:}... –  Werner Jan 24 at 5:09
@Zarko thanks for the tip, but, as I tried to convey in the question, I'm mostly interested in why it makes that empty space, if nothing is actually put on a new line. It just seems like strange and unintuitive behavior to me, so I'm curious why it's happening. –  Adam Jan 24 at 5:16
@Werner thanks for the suggestion. I'll use that for the sake of my presentation, though I'm still curious why this is actually happening. It seems like pretty unexpected behavior, at least to my naive mind. –  Adam Jan 24 at 5:19
Hmm... I got \spaceskip0pt working last night but not now. However, using active:\spaceskip1pt works. This is more of a diagnostic tool to detect where the problem might come from. The TeXbook does suggest that the stretchability will increase after a punctuation mark. Your case is slightly different, because if you change ":" to a letter say "i", the problem remains. Whatever the reason, I think it'll have to do with glues in LaTeX, although I don't have a good explanation for this. –  Kevin C Jan 25 at 1:44

You need to finish the paragraph in each top level item before you start the nested enumerate list. The whole enumerate is being included in the item paragraph and this has caused the extra space in the output.

Try coding it like this:

\begin{itemize}
\item Actional verbs appeared in full \emph{be}-passive, full \emph{get}-passive, and active

\begin{enumerate}[(1)]
\item \ldots
\item \ldots
\end{enumerate}

\item Actional verbs appeared in full \emph{be}-passive, full \emph{get}-passive, and active:

\begin{enumerate}[(1)]
\item \ldots
\end{enumerate}

\end{itemize}


Note the absence of { braces } after the \item control sequences, and the blank lines to end the paragraph before the enumerate environments.

Actually the braces are irrelevant to the problem here because groups can span paragraphs, but you still don't really need them here, so best to leave them out.

Not ending the paragraph before the enumerate environments means that they are processed by TeX in horizontal mode rather than in vertical mode, and this changes the way that the Beamer format deals with them. If you set \tracingmacros=1 you will see that much of the processing is conditional on which mode you are in. To answer your "why" question fully you would need to unravel the Beamer macros to see how the extra space in your longer line gets processed.

-
+ 1 : But, I don't think the { and } are relevant. If you add back the braces into your MWE, the behavior is the exact same as it is without them. Additionally, I'm still not sure why there is any space after the colon that gets wrapped to the next line. You say "all the space between your colon and the \begin{enumerate} is being included", but there is no space after the colon. For example, this behavior persists even if you put the entire thing on one line with no space after the colon. –  Adam Jan 25 at 22:16
I agree the braces are irrelevant to the problem (since a group can span paragraphs) but you still don't need them. –  Thruston Jan 27 at 9:36
I'll edit the reply to explain more about the space. –  Thruston Jan 27 at 9:42
Thanks for the further clarification, though I'm hoping someone can still provide a more detailed explanation of why this is happening. –  Adam Jan 27 at 16:12
Good luck with that; the Beamer macros are a work of art. –  Thruston Jan 27 at 16:55