1

I would like to be able to show a slide and then on the next transition place an opaque text box at some position over the text which explains some aspect of it. This is an example which doesn't work well.

\documentclass{beamer}
\usepackage{default}
\usepackage[pangram]{blindtext}
\usepackage{lipsum}
\usepackage[absolute,overlay]{textpos}
\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}
\begin{document}
\begin{frame}
\lipsum[50]
\pause
\begin{textblock*}{64mm}(32mm,0.25\textheight)
    \begin{exampleblock}{}
        This is wrong!
    \end{exampleblock}
\end{textblock*}
\end{frame}
\end{document}

In my case I have white text with a black background.

How can you do this?


Using the linked question I get:

\documentclass{beamer}
\usepackage{lmodern}
\usetheme{Luebeck}
\usepackage{lipsum} % <= to insert dummy text
\usepackage[absolute,overlay]{textpos}
\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}
\begin{document}
\begin{frame}
\frametitle{Example of block over the text}
\lipsum[1]
\only<2>{
\begin{textblock*}{64mm}(32mm,0.25\textheight)
    \begin{exampleblock}{}
    This is wrong!
    \end{exampleblock}
\end{textblock*}
}
\end{frame}
\end{document}

How can I make the text block have white text on a black background and get rid of the block of color at the top of it?

  • Please have a look here. – user121799 Apr 30 '18 at 15:19
  • Thank you for the link to tex.stackexchange.com/questions/59826/…. How can I make the text white on black and get rid of the different colored block at the top of the text block? – Anush Apr 30 '18 at 15:27
  • Also, if I replace \only with \pause the textblock shows all the time. Why is that? – Anush Apr 30 '18 at 15:35
  • \pause and \only do very different things. – user121799 Apr 30 '18 at 15:41
  • 1
    To change the colour of the example block: \setbeamercolor{block body example}{fg=white,bg=black} \setbeamercolor{block title example}{bg=black} – samcarter_is_at_topanswers.xyz Apr 30 '18 at 16:10
2

You can use the current page node to place some tikz code absolutly. It needs two compilations to get the correct placement:

\documentclass{beamer}
\usepackage{default}
\usepackage[pangram]{blindtext}
\usepackage{lipsum}
\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}
\usepackage{tikz}
\begin{document}
\begin{frame}
\lipsum[50]
\only<2>{%
\tikz[overlay,remember picture]
\node[fill=red,text=white] at ([xshift=1cm,yshift=1cm]current page.center){This is wrong!};
}

\end{frame}
\end{document}

enter image description here

| improve this answer | |
1
\documentclass{beamer}
\usepackage{lmodern}
\usetheme{Luebeck}
\usepackage{lipsum} % <= to insert dummy text
\usepackage[absolute,overlay]{textpos}
\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}

\setbeamercolor{block body example}{fg=white,bg=black} \setbeamercolor{block title example}{bg=black}
\begin{document}
\begin{frame}
\frametitle{Example of block over the text}
\lipsum[1]
\only<2>{
\begin{textblock*}{\textwidth}(.35\textwidth,0.25\textheight)
    \begin{beamercolorbox}[wd=.5\textwidth,center,sep=0.3cm]{block body example}
        This is wrong!
    \end{beamercolorbox}
\end{textblock*}
}
\end{frame}
\end{document}

enter image description here

| improve this answer | |
  • Thank you! Is it possible to add a white border to the box? Also, which parameters control where the box appears on the page? – Anush May 1 '18 at 10:08
  • Ah ok. So .35\textwidth,0.25\textheight is setting the position on the page? – Anush May 1 '18 at 10:11
  • @Anush If you want a box with boarder, use tex.stackexchange.com/a/59836/36296 – samcarter_is_at_topanswers.xyz May 1 '18 at 10:15

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.