3

I want to put a box to highlight a state from an algorithm inside beamer frame. For example, the state shown below. How can I draw a such highlight box around it?

\documentclass[xcolor=table,10pt,aspectratio=169]{beamer}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[noend]{algpseudocode}

\begin{document}

\begin{frame}{Test}
\begin{algorithmic}
\Procedure{Test}{$a, b$}
    \State $a + b$
\EndProcedure
\end{algorithmic}
\end{frame}

\end{document}
0

May I suggest an alternative? Make use of beamer's \alert:

enter image description here

\documentclass{beamer}

\usepackage[noend]{algpseudocode}

\begin{document}

\begin{frame}{Test}
  \begin{algorithmic}
  \Procedure{Test}{$a, b$}
    \State \alert<2>{$a + b$}
  \EndProcedure
  \end{algorithmic}
\end{frame}

\end{document}

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.