我希望能够显示一张幻灯片,然后在下一次转换时在文本上方的某个位置放置一个不透明的文本框,以解释其中的某些方面。这是一个效果不佳的例子。
\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}
就我而言,我的文字为白色,背景为黑色。
你怎么能这样做呢?
使用链接的问题我得到:
\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}
我怎样才能使文本块在黑色背景上显示白色文字,并去除其顶部的彩色块?
答案1
您绝对可以使用当前页面节点来放置一些 tikz 代码。需要两次编译才能获得正确的位置:
\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}
答案2
\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}