Closed gqqnbig closed 7 months ago
You can switch off the space between new lines like this:
\documentclass{beamer}
\begin{document}
\begin{frame}[t]
\offinterlineskip
\begin{overlayarea}{0pt}{0pt}\gdef\x{Hello}\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}\gdef\y{World}\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}something\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}\end{overlayarea}%
\begin{overlayarea}{0pt}{0pt}\end{overlayarea}
\strut\color{red}\x \y
\end{frame}
\end{document}
beameruserguide only says "Everything within the environment will be placed in a rectangular area of the specified size."
Probably my fundamentals are not solid, but the user guide doesn't mention the margin of the rectangular area.
Can you add some text like "the margin (or line skip) of the area is determined by xxxx, even if you specify the height of the area to 0pt"?
The overlay area is not adding a margin, the space is the space added in the source file, just as X X
is wider than XX
or closer to the example
X
X
is wider than
X%
X
Here the letter X is not adding a mrgin it just has or does not have a space after it. The overlay area is the same (except it has no width)
The command \offinterlineskip for sure works like a charm. It's defined in latex2e to change a bunch of lineskip thingummy.
Is my understanding correct that overlayarea will create a paragraph and vertical space will be created?
I'm not sure whether all environments in latex create a paragraph, if not, probably it's worth noting it in the user guide.
overlayarea
internally uses a \vbox
, so it basically boils down to https://tex.stackexchange.com/questions/274147/extra-interline-glue-between-vboxes
The output is this
The environment overlayarea certainly occupies space.
But since I specify the height 0pt, it should in my opinion take 0pt height.
Can you fix this bug?