Beamer: Using \hfill in \frametitle{}

812 views
Skip to first unread message

bpabbott

unread,
Mar 26, 2010, 1:32:44 PM3/26/10
to LaTeX Users Group, bpab...@mac.com
I'm running TeX Live 2008, on MacOS X.

I'd like to put my companies logo on the far right of each framtitle.
My quick and dirty solution was to use \hfill ...

\frametitle{Title \hfill Logo}

Unfortunately, this didn't work for me.

A short example is below.

\documentclass{beamer}
\mode<presentation>
\begin{document}
\begin{frame}
\frametitle{Title \hfill Logo}
\end{frame}
\end{document}

The result is that "Logo" show up a bit right of center, with equal
white space on each side of "Logo". From the appearance, it looks to
me like there is a implicit \hfill to the right. Meaning the title
looks like {Title \hfill Logo \hfill}.

How might I get the desired result?

TiA
Ben

Donald Arseneau

unread,
Mar 27, 2010, 6:32:50 AM3/27/10
to LaTeX Users Group
On Mar 26, 10:32 am, bpabbott <abbott...@gmail.com> wrote:

> \frametitle{Title \hfill Logo}


> The result is that "Logo" show up a bit right of center, with equal
> white space on each side of "Logo".

Obviously the frame title is made flush-left with \hfill
instead of the more sensible \hfil. You could triple dare:

\frametitle{Title \hspace{1 filll} Logo}

(there is no \hfilll command)

r

unread,
Mar 27, 2010, 7:37:57 AM3/27/10
to LaTeX Users Group
I would create the logo on a blank a4 size canvas (landscape
orientation) using a program such as openoffice draw, where the logo
is positioned on the appropriate area (e.g. top right corner).

Then use the following:

\documentclass[usepdftitle=false]{beamer}
\mode<presentation>
\setbeamertemplate{navigation symbols}{}
\logo{\includegraphics[height=90mm]{bananarepublicflag}}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{helvet}
\usepackage{graphicx}
\hypersetup{pdftitle={preferred title}}
\title{new title}
\institute{~}
\author{~}
\date{~}


\mode<presentation>
\begin{document}
\begin{frame}

\frametitle{company introduction}
\begin{itemize}
\item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\item Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{presentation content}
\begin{itemize}
\item Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
\item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\end{itemize}
\end{frame}
\end{document}

The logo can be obtained from http://www.openclipart.org/people/Anonymous/Anonymous_Banana_Republic_Flag.svg,
and then converted to eps format.

bpabbott

unread,
Mar 27, 2010, 11:28:00 PM3/27/10
to LaTeX Users Group
Thanks for the help. I found a simple solution.

I added the following line to my document ...

\setbeamertemplate{frametitle}[default][none]

... with this the \hfill work as I had expected.

Ben

Reply all
Reply to author
Forward
0 new messages