I am trying to highlight, at the end of my slide, several items in a list with a box in something similar as in the method shown in Box around a few items in an itemize environment.
The difference is that instead of only one box I want to use two boxes as I compare the elements with another block.
I used the following code:
\documentclass[pdf,10pt,xcolor=table]{beamer}
\usepackage{xparse}% For \NewDocumentCommand
\usepackage{calc}% For the \widthof macro
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
%
\makeatletter
%
\NewDocumentCommand{\DrawBox}{s O{}}{%
\tikz[overlay,remember picture]{
\IfBooleanTF{#1}{%
\coordinate (RightPoint) at ($(left |- right)+(\linewidth-\labelsep-\labelwidth,0.0)$);
}{%
\coordinate (RightPoint) at (right.east);
}%
\draw[red,#2]
($(left)+(-0.2em,0.9em)$) rectangle
($(RightPoint)+(0.2em,-0.3em)$);}
}
\NewDocumentCommand{\DrawBoxWide}{s O{}}{%
\tikz[overlay,remember picture]{
\IfBooleanTF{#1}{%
\coordinate (RightPoint) at ($(left |- right)+(\linewidth-\labelsep-\labelwidth,0.0)$);
}{%
\coordinate (RightPoint) at (right.east);
}%
\draw[red,#2]
($(left)+(-\labelwidth,0.9em)$) rectangle
($(RightPoint)+(0.2em,-0.3em)$);}
}
%
\makeatother
%
\begin{document}
\begin{frame}
\begin{block}{\centering Unsteady models}
\begin{itemize}\setbeamertemplate{itemize item}[triangle]\small
\item\tikzmark{left}\textbf{Aerodynamics}
\begin{itemize}\small
\item[+] \textbf<3->{Accuracy}
\item[+] \textbf<3->{Flow physics}\tikzmark{right}
\end{itemize}
\item\tikzmark{left}\textbf{Structure}
\begin{itemize}\small
\item[+] \textbf<3->{Full wing flexibility}\tikzmark{right}
\end{itemize}
\item \textbf{Implementation}
\begin{itemize}\small
\item[-] Complex formulation
\item[-] High computational load
\end{itemize}
\end{itemize}
\end{block}
\only<3->{\DrawBoxWide[thick, green, fill=green, fill opacity=.25]}
\end{frame}
\end{document}
Additionally, I am not completely satisfied with the box solution as I am using the list in a block which has a background color and thus diminishes the effect of the surrounding box.
I saw that the tikz style can also highlight parts of a list, as in Beamer overlay box around text - the correct way? and Highlighting in beamer using TikZ nodes, but I didn't see an example around several items without any blank between the items.
Furthermore in the example given the item marker is included by \DrawBoxWide*{}
which is not the case for me.
Do you have a solution, for these issues?
Customizable offsets
you probably just have to adjust the offsets.