# Adding dynamic information to the right upper edge of beamer template

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}
}


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:

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.

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

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}
}

%% Make top right box blank for each new frame
\makeatletter
\BeforeBeginEnvironment{frame}{%
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}}

\define@key{beamerframe}{myinfo}[true]{%
\leavevmode%
\hbox{%
\end{beamercolorbox}%
#1
\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}


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}
}
\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}