9

Is there an option that I can use within \begin{frame}... \end{frame} so that the enclosed text always appears at same location on different beamer slides?

Ideally, I want something like this:

\begin{frame}{slide title}
some-option{\bf mytext} 
.....
\end{frame}

What I want is that no matter what "mytext" is, and no matter what the stuff following it is "....", "mytext" is always placed at same location: just below the title, at the right corner.

I tried using \hspace{..}\vspace{..}{\bf mytext}, but I need to change the space values in every single slide manually. And even then, the placement looks only approximately same on slides (visually).

Caramdir
  • 89,023
  • 26
  • 255
  • 291
AmB
  • 91
  • have you looked at the textpos package with absolute (option) positioning? – prettygully Mar 31 '11 at 22:07
  • 3
  • As already pointed out, textpos is the way to go here. Note, however, that textpos does not go well together with pgfpages, which is used internally by beamer for stuff like [notes on second screen]; some also use it to produce 4up handouts. The problem is that textpos and pgfpages interact on the shipout level -- the textpos-placed material ends up on every pgfpage! – Daniel Apr 01 '11 at 07:21
  • Just for sake of completeness: An often mentioned alternative to textpos that does not work is to employ tikzs absolute positioning (via the(current page)node and the[overlay]option). With beamer frames I never got it working, it seems that the size of(current page)` is somehow calculated on the fly by beamer and changes with the content. – Daniel Apr 01 '11 at 07:28

2 Answers2

8

As already said, tikz can help you to do the job:

\documentclass{beamer}

\usepackage{tikz}

\addtobeamertemplate{frametitle}{}{\tikz[overlay, remember picture] \node at (current page.north east) [left,yshift=-0.15\textheight] {\bf text};}

\begin{document}
\begin{frame}{title 1}
\end{frame}
\begin{frame}{title 2}
\end{frame}
\end{document}
Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751
5

With the help of the textpos package you can define a command that puts its argument at an absolute position; an example:

\documentclass{beamer}
\usepackage[absolute,overlay]{textpos}
\usepackage{everypage}

\newcommand\MyText[1]{% \begin{textblock}{5cm}(.7\textwidth,1cm)% #1 \end{textblock} } \begin{document}

\begin{frame}{First frame} \MyText{\bfseries Text for the first frame} Some test text \end{frame}

\begin{frame}{Second frame} \MyText{\itshape Text for the second frame} Some test text \end{frame}

\end{document}

Babelfish
  • 165
Gonzalo Medina
  • 505,128