ビーマーテンプレートの右上端に動的な情報を追加する

ビーマーテンプレートの右上端に動的な情報を追加する

私は次のように、beamer で AnnArbor テンプレートを使用しています。

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

また、いくつかのスライドに情報を追加したいと思います。この情報は、次のスクリーン キャプチャの矢印に示すように、上部の水平領域の右端に表示される必要があります。

ここに画像の説明を入力してください

この情報は各フレームに属する必要があります (これは、プリアンブルで一度だけ定義されるグローバル ロゴではありません)。実際、フレームの内容の参考文献を追加したいので、フレームまたは空白ごとに異なる場合があります。

これを実現するには何を再定義する必要がありますか?

追加: ジェシー・ナイトは、最小限の動作例を求めました。

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

ここで「Cat01」はスライドの右上隅に表示されます(上部の水平バーの青い部分にあるセクションタイトル「Phonétique / phonologie」と同じ高さとフォントサイズ)。これは、このスライドの主な参考文献が「Cat01」、つまりJC Catfordであることを思い出させるものです。音声学の実践入門, Oxford University Press 2001. 別の(おそらくよりエレガントな)構文としては、

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

しかし、私にとっては、結果を得るための構文よりも結果のほうが重要です。

答え1

infolines見出し定義 ( にあります)を使用するとbeamerouterthemeinfolines.sty、右上のボックスが空白になるように見出しを再定義できます。次に、フレームに渡された場合に、 のコンテンツが右上のボックスに表示される myinfoように見出しを再定義するオプションを定義できます。myinfo

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

ここに画像の説明を入力してください

答え2

north eastTikz を使用した解決策は次のとおりです。ページの右上隅 (技術的には ) にノードを配置します。その他のオプションは次のとおりです。Beamer で画像を任意の位置に配置するにはどうすればよいですか?

[注: 以下の例では、色を自分で考えなければなりませんでした。将来的には、最小限の動作例、つまり他のユーザーが追加などkugreenせずにコピーして貼り付けてすぐにコンパイルできる TeX ファイルの内容を提供していただけると助かります。]\documentclass{...}

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

関連情報