Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm working on a beamer poster template where I need precise control over all margins. I got rid of most, but the mandatory frame environment(1) introduces a 5.69pt(2) which I cannot find(3).

Observe this example:

\documentclass[final,t]{beamer}

\usepackage[orientation=portrait,size=a4]{beamerposter}
\geometry{margin=0pt}%

\begin{document}%
\begin{frame}[t,plain]%
%\vskip-5.69pt%    <--- magical vertical space
\begin{pgfpicture}%
  \pgfsetlinewidth{1pt}%
  \pgfpathmoveto{\pgfpoint{0pt}{0pt}}%
  \pgfpathlineto{\pgfpoint{2cm}{0pt}}%
  \pgfpathlineto{\pgfpoint{2cm}{-2cm}}%
  \pgfusepath{stroke}%
\end{pgfpicture} with frame%
\end{frame}%
\end{document}%

If we build this and zoom in on the top left corner it looks like this:

vertical frame margin

Now, if we remove the \begin{frame}[t,plain] and \end{frame} we get this:

no vertical margin

Note that the thin black frame around the picture is the page border inserted by my pdf viewer.

I have no idea where the distance between the page border and the pdfpicture comes from. How do I get rid of it?


(1) I can omit the frame, but then I run into trouble with \items in itemize environments. TeX then suddenly claims \item to be an undefined control sequence.

(2) That's the overfull-ness of the \hbox reported by latex when I try to insert a minipage of the dimension [\paperheight]{\paperwidth}.

(3) I tried setting virtually every page margin to 0pt to no avail. Also, the official beamer guide does not mention this margin.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

It's a sneaky one: the t option doesn't push everything right to the top, it sets \beamer@frametopskip to 0.2cm plus 0.5\paperheight. (0.2cm are pretty exactly the 5.69pt you observe).

Adding

\makeatletter
\define@key{beamerframe}{t}[true]{% top
  \beamer@frametopskip=0pt %<-- was: .2cm plus .5\paperheight\relax%
  \beamer@framebottomskip=0pt plus 1fill\relax%
  \beamer@frametopskipautobreak=\beamer@frametopskip\relax%
  \beamer@framebottomskipautobreak=\beamer@framebottomskip\relax%
  \def\beamer@initfirstlineunskip{%
    \def\beamer@firstlineitemizeunskip{%
      \vskip-\partopsep\vskip-\topsep\vskip-\parskip%
      \global\let\beamer@firstlineitemizeunskip=\relax}%
    \everypar{\global\let\beamer@firstlineitemizeunskip=\relax}}
}

seems to fix that issue, at least for the tiny example I tested.

share|improve this answer
3  
Regrettably, Till hard-coded a lot of fixed distances into beamer: they make my life tricky! –  Joseph Wright May 27 '13 at 16:52
    
+1 Works like a charm in my template as well. Thanks. –  bitmask May 27 '13 at 17:33
    
Thanks for pointing that out Joseph. This reminded me of my problem with another fixed distance in beamer: tex.stackexchange.com/questions/110229/… –  Serge Stroobandt May 27 '13 at 19:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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