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).

4
  • have you looked at the textpos package with absolute (option) positioning? – prettygully Mar 31 '11 at 22:07
  • 3
    See also Absolute positioning in beamer and LaTeX and the answer to Insert graphic at precise place on a page where 5 ways are described. – Stefan Kottwitz Mar 31 '11 at 22:10
  • 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 1 '11 at 7: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 1 '11 at 7:28
7

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}
1
  • Hi! Welcome to TeX-SX. I put your code into a code block to make it easier to read. – Andrew Stacey Apr 1 '11 at 12:14
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}

\end{document}
1
  • there are two \end{document} – js bibra Nov 16 '19 at 16:22

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.