1

In this post I found this command to strike out words with a red cross:

\newcommand\mycrossed[1]{\tikz[baseline=(A.base)]
    \node[cross out, draw= red, draw opacity=0.5, line width=1.5pt,
          inner sep=0pt, outer sep=0pt] (A) {#1};%
                        }

Anyway, if the argument of the post is a beamer block, the command does not work. I tried to include the block in a minipage without success. How I can obtain a similar effect with entire blocks?

Stefano
  • 122

1 Answers1

1

The code below is modified from https://tex.stackexchange.com/a/96304/. It shows a block in a minipage in a tikzpicture. The tikzpicture defines coordinates (north east, south west etc.) that can be used to draw a cross.

The anchors are a bit off at the top (the north anchor is higher than the upper part of the block), so you can lower those coordinates with the calc tikzlibrary and the ($(coord1)+(coord2)$) syntax.

Finally a new command is defined to add other blocks easily without needing to add the tikzpicture manually every time.

\documentclass{beamer}
\usepackage{tikz}
\usetheme{Frankfurt}
\usetikzlibrary{calc}
\begin{document}

\newcommand{\crossblock}[2]{% \begin{tikzpicture} \node (n1) {% \begin{minipage}{\textwidth} \begin{block}{#1}% #2 \end{block}% \end{minipage} }; \draw[red,ultra thick] (n1.south west) -- ($(n1.north east)-(0pt,10pt)$); \draw[red,ultra thick] ($(n1.north west)-(0pt,10pt)$) -- (n1.south east); \end{tikzpicture} } \begin{frame} \crossblock{Block title}{Block text\par another line\par third line} \crossblock{Second title}{Second contents\par next line} \end{frame} \end{document}

enter image description here

Marijn
  • 37,699