Is there a way to draw a huge red cross (x) on top of a slide in LaTeX beamer? I want to discuss a position and then say that it is definitely wrong and mark this by crossing out the whole page. It would be great if this cross looked like drawn by hand.
[Tex/LaTex] crossing out whole slide with LaTeX beamer
beamer
Related Solutions
A blank slide is easy to produce by adding the argument plain
. By also adding c
you center the text on the page (you also have the options t
: top and b
: bottom). Note that you must also omit the frame title.
\begin{frame}[plain,c]
%\frametitle{A first slide}
\begin{center}
\Huge Coming up: Our Work
\end{center}
\end{frame}
As for text type face and colour, I do not want to make any specific suggestions. For the type face, use the type face you use in the presentation, mixing too many type faces udually is not a good idea. The colour depnds on you colour scheme. If you want it to "scream" then use red or some other bright colour. You can always chose something that clearly deviates from the colour scheme you use but on the whole having too many colours that do not fit the scheme may jsut make the presentation look messy.
Here's one way to do it:
The code:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\newcounter{tmp}
\newcommand<>\Highlight[1]{%
\stepcounter{tmp}%
\only#2{\begin{tikzpicture}[remember picture,overlay]
\fill[green!60!black,opacity=0.5]
([xshift=-.2em,yshift=2ex]pic cs:start-\thetmp)
rectangle
([xshift=.2em,yshift=-1ex]pic cs:end-\thetmp);
\end{tikzpicture}}%
\tikzmark{start-\thetmp}#1\tikzmark{end-\thetmp}%
}
\begin{document}
\begin{frame}
\begin{minipage}{0.2\textwidth}
\begin{enumerate}
\item \Highlight<+>{this is 1}
\item \Highlight<+>{this is 2}
\item \Highlight<+>{this is 3}
\item \Highlight<+>{this is 4}
\item \Highlight<+>{this is 5}
\end{enumerate}
\end{minipage}
\hfill
\begin{minipage}{0.75\textwidth}
\only<1> {\includegraphics[width=.75\textwidth]{fig4-2}}
\only<2> {\includegraphics[width=.75\textwidth]{fig4-3}}
\only<3> {\includegraphics[width=.75\textwidth,height=0.7cm]{example-image-a}}
\only<4> {\includegraphics[width=.75\textwidth,height=0.7cm]{example-image-b}}
\only<5> {\includegraphics[width=.75\textwidth,height=0.7cm]{example-image-c}}
\end{minipage}
\end{frame}
\end{document}
Using the tikzmark
library, the \Highlight
command places a colorized rectangle in the background. I assumed here that the text to be highlighted spans no more than a line; otherwise, a modification on the definition will be required; for example,
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\newcounter{tmp}
\newcommand<>\Highlight[1]{%
\stepcounter{tmp}%
\only#2{\begin{tikzpicture}[remember picture,overlay]
\fill[green!60!black,opacity=0.5]
([xshift=-.2em,yshift=2ex]pic cs:start-\thetmp)
rectangle
([xshift=.2em,yshift=-1ex]pic cs:end-\thetmp);
\end{tikzpicture}}%
\tikzmark{start-\thetmp}#1\hfill\tikzmark{end-\thetmp}%
}
\begin{document}
\begin{frame}
\begin{minipage}{0.3\textwidth}
\begin{enumerate}
\item \Highlight<+>{this is 1 and some other text}
\item \Highlight<+>{this is 2}
\item \Highlight<+>{this is 3}
\item \Highlight<+>{this is 4}
\item \Highlight<+>{this is 5}
\end{enumerate}
\end{minipage}
\hfill
\begin{minipage}{0.65\textwidth}
\only<1> {\includegraphics[width=\linewidth]{fig4-2}}
\only<2> {\includegraphics[width=\linewidth]{fig4-3}}
\only<3> {\includegraphics[width=\linewidth,height=0.7cm]{example-image-a}}
\only<4> {\includegraphics[width=\linewidth,height=0.7cm]{example-image-b}}
\only<5> {\includegraphics[width=\linewidth,height=0.7cm]{example-image-c}}
\end{minipage}
\end{frame}
\end{document}
The code needs two or thee runs to stabilize.
Best Answer
Initially I misread the question and thought that the cross should be below the text; now I see that it has to go on top of the text; in this case, there's no need to use the
background canvas
template:You can use TikZ to draw the cross in the
background canvas
template:Using
percusses's answer
to Simulating hand-drawn lines you can get the handwritten effect: