4

I'm using the AnnArbor template in beamer as follows:

\mode<presentation>
{ 
\usetheme{AnnArbor}
\usecolortheme[named=kugreen]{structure}
\useinnertheme{circles}
\usefonttheme[onlymath]{serif}
\setbeamercovered{transparent}
\setbeamertemplate{blocks}[rounded][shadow=true]
}

And I would like to add a piece of information to some slides, which should be displayed on the top horizontal zone, right edge, as the arrow in the following screen capture shows:

enter image description here

This information should belong to each frame (it is not a global logo defined once and for all in the preamble), in fact I want to add bibliographical references for the contents of the frame, so it may be different for every frame or void.

What do I need to redefine to obtain this?

ADDITION: Jesse Knight asked for a minimal working example, that would be

\begin{frame}[fragile]
\frametitle{Phonèmes}\infoForRightCorner{Cat01}
Contents of the slide
\end{frame}

where “Cat01” should appear on the upper right corner of the slide (same height and font size as the section title “Phonétique / phonologie” which you can see in the blue part of the top horizontal bar) of this slide. This should serve as a reminder that the main bibliographic reference for this slide is “Cat01”, namely J.C. Catford, A Practical Introduction to Phonetics, Oxford University Press 2001. Another (maybe more elegant) syntax could be

\begin{frame}[fragile,topbarright={Cat01}]
\frametitle{Phonèmes}
Contents of the slide
\end{frame}

but for me the result matters more than the syntax to obtain it.

2
  • Please could you provide a minimal working example? Feb 3 '20 at 14:41
  • dear @JesseKnight I just added a minimal example
    – yannis
    Feb 4 '20 at 11:26
1
+100

Using the infolines headline definition (found in beamerouterthemeinfolines.sty), you can redefine the headline such that the top right box is blank. You can then define an option myinfo that, if passed to the frame, will redefine the headline such that the content of myinfo appears in the box at top-right.

\documentclass{beamer}
\mode<presentation>
{ 
\usetheme{AnnArbor}
\useinnertheme{circles}
\usefonttheme[onlymath]{serif}
\setbeamercovered{transparent}
\setbeamertemplate{blocks}[rounded][shadow=true]
}

%% Make top right box blank for each new frame
\makeatletter
\BeforeBeginEnvironment{frame}{%
  \setbeamertemplate{headline}{%
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{section in head/foot}%
    \usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{subsection in head/foot}%
    \usebeamerfont{subsection in head/foot}
%    \insertsubsectionhead
\hspace*{2ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}}

%% If myinfo option is passed to frame, add to headline
\define@key{beamerframe}{myinfo}[true]{%
\setbeamertemplate{headline}{%
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{section in head/foot}%
    \usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{subsection in head/foot}%
    \usebeamerfont{subsection in head/foot}
    #1
%    \insertsubsectionhead
\hspace*{2ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}}
\makeatother 

\begin{document}

\section{Phonétique / phonologie}
\subsection{First subsection title}

\begin{frame}[fragile,myinfo=Cat01 or something]
\frametitle{Phonèmes}
Slide with info
\end{frame}

\begin{frame}
\frametitle{Next frame}
No info for this slide
\end{frame}
\end{document}

enter image description here

1

Here's a solution using Tikz: place a node in the top right (technically: north east) corner of the page. Some other options are here: How can I position an image in an arbitrary position in beamer?

[Note: in the example below, I had to invent the kugreen colour. It would be helpful if you could provide a minimal working example in future, which means the contents of a TeX file that other users could copy and paste and immediately compile, without adding \documentclass{...} and so on.]

\documentclass{beamer}
\usepackage{tikz}
\definecolor{kugreen}{RGB}{50,93,61}
\mode<presentation>
{ 
\usetheme{AnnArbor}
\usecolortheme[named=kugreen]{structure}
\useinnertheme{circles}
\usefonttheme[onlymath]{serif}
\setbeamercovered{transparent}
\setbeamertemplate{blocks}[rounded][shadow=true]
}
\newcommand{\infoForRightCorner}[1]{%
\tikz[remember picture,overlay]{
    \node[anchor=north east] at (current page.north east) {#1};}
    }
\begin{document}

\begin{frame}[fragile]
\frametitle{Phonèmes}
\infoForRightCorner{Cat01}
Contents of the slide

\end{frame}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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