10

I am using textpos to control the position of text in a beamer frame. What I want to do, is to place some text on top of an image. I am using the package in absolute mode and I want to place the text on the top-right corner of the frame.

My code is the following

\documentclass{beamer}
\usepackage{graphicx}
\usepackage[absolute]{textpos}
\begin{document}
\begin{frame}
 \includegraphics[width=\textwidth]{BeamONAmp}
 \setlength{\TPHorizModule}{\textwidth}
 \setlength{\TPVertModule}{\textwidth}
 \begin{textblock}{0.5}(0.001,0.001)
  Test
 \end{textblock}
\end{frame}
\end{document}

My output is the following

enter image description here

Any idea on how to properly control the position of the text?

18

If you want to use textpos with beamer and with absolute positioning, you have to use the option overlay, otherwise the frame background obscures the textblock.

MWE:

\documentclass{beamer}
\usepackage[absolute,overlay]{textpos}
\begin{document}
\begin{frame}
 \includegraphics[width=\textwidth]{example-image}
 \setlength{\TPHorizModule}{\textwidth}
 \setlength{\TPVertModule}{\textwidth}
 \begin{textblock}{0.5}(0.001,0.001)
  Test
 \end{textblock}
\end{frame}
\end{document} 

Output

enter image description here


Excerpt from the documentation:

[overlay] When using the absolute-position mode, the textblocks are placed under any other text on the page. This is normally what you want, but if you have page contents, and they have something which obscures the textblocks (for example, a block of opaque colour), then the positioned textboxes disappear. In this case, specify the option [overlay] , to request that the positioned blocks of text overlay any other page contents, rather than being overlaid.

  • How can I put a \url in the text? – user4417 Jan 10 '18 at 10:17
  • @user4417 Simply substitute Test with \url{https://tex.stackexchange.com}. – karlkoeller Jan 18 '18 at 18:43

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.