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 would like to include a full width image, aligned to the top of a frame with a frame title. The problem is, I cannot get rid of a line of white space between the orange frame title header and the lion image.

\documentclass[t]{beamer}
% Frames are 128x96mm and top-aligned by default.

% Calculate with \sidebarwidth
\usepackage{calc}
\newlength{\sidebarwidth}

% Theme
\setlength{\sidebarwidth}{28mm}
\usetheme[height=16mm, right, width=\sidebarwidth]{Goettingen}
% Hence, a full frame image is 100x80mm
\usecolortheme{crane}

% Include full-width graphics
\usepackage{graphicx}
\newcommand{\includefullwidthgx}[2][]{%
\noindent\makebox[\columnwidth]{\includegraphics[width=128mm-\sidebarwidth, #1]{#2}}%
}%

\begin{document}
\begin{frame}
\frametitle{frame title text}
\includefullwidthgx{lion.jpg}
\end{frame}
\end{document}

enter image description here

share|improve this question
4  
What a beautiful picture for TeX site! :-) –  Przemysław Scherwentke Apr 23 '13 at 11:59
2  
That was on purpose! It is a Wikimedia Commons image. Here is the link to the original: commons.wikimedia.org/wiki/File:Lion_in_masai_mara.jpg –  Serge Stroobandt Apr 23 '13 at 12:03
    
If I'm not wrong, when you fix only one option width (or height) for includegraphics, option keepaspectratio is true by default, so image keeps its original proportions. If you want to cover all this area select another image or also fix option height. –  Ignasi Apr 23 '13 at 12:19
    
    
@Ignasi: I am aware of that, but I do not want to lose the white space below the picture. –  Serge Stroobandt Apr 23 '13 at 12:24
show 2 more comments

1 Answer

up vote 2 down vote accepted

I helped myself out by adding a \vspace{-9.5pt}. The value seems not to change with standard themes. Nor does it matter whether a subtitle is present in the header. Still, I find it a non-general, somewhat sub-optimal solution. Who does better?

\documentclass[t]{beamer}
% Frames are 128x96mm and top-aligned by default.

% Calculate with \sidebarwidth etc.
\usepackage{calc}
\newlength{\sidebarwidth}

% Theme
\setlength{\sidebarwidth}{28mm}
\usetheme[height=16mm, right, width=\sidebarwidth]{Goettingen}
% Hence, a full frame image is 100x80mm
\usecolortheme{crane}

% Include full-width graphics
\usepackage{graphicx}
\newcommand{\includefullwidthgx}[2][]{%
\vspace{-9.5pt}
\noindent\makebox[\columnwidth]{\includegraphics[width=128mm-\sidebarwidth, #1]{#2}}%
}%

\begin{document}
\begin{frame}
\frametitle{Sub-optimal solution.}
\framesubtitle{Anyone does better?}
\includefullwidthgx{lion.jpg}
\end{frame}

\end{document}

enter image description here

share|improve this answer
    
I am still looking for the mystery length;\vspace{\topskip} also eats too much space. –  Serge Stroobandt May 15 '13 at 18:01
add comment

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.