0

I use some framebox for some sentences. But I want it to appear in the same slide after next click. How can a frame appear around the text on a click in the presentation?

  • Please add some visuals and/or a minimal working example (MWE) that highlights what you mean, since it's not clear as-is. – Werner Jun 22 '14 at 13:54
  • How can I provide example, I mean the things that I want are not seen by me or created by me. Thats why I asking. If I know then why I put a question here. – Deepesh Patel Jun 22 '14 at 14:05
  • an usefull example would be to show the full latex-code for one appearing framebox ... – Faekynn Jun 22 '14 at 14:54
  • @DeepeshPatel: My crystal ball points to \pause and friends. Do you know what they do? – Werner Jun 22 '14 at 17:24
2

A solution using tcolorbox

\documentclass{beamer}
\usepackage{tcolorbox}

\definecolor{mycolor}{RGB}{255,255,255}

\tcbset{colframe=white,colback=white,nobeforeafter}

\begin{document}
    \begin{frame}
        This is 
        \only<2>{\definecolor{mycolor}{RGB}{5,61,245}}
        \tcbox[colback=white,colframe=mycolor,nobeforeafter,tcbox raise base]{a test}
    \end{frame}
\end{document}

enter image description here

1

You could make a makebox without frame, and an additional (empty) framebox appearing at the next click?


e.g.

\documentclass{beamer}
\usepackage{pict2e}
\begin{document}
\begin{frame}
\frametitle{First Slide}

\begin{picture}(4,1)
\put(0,0){\makebox[\textwidth]{some text, soon in a frame}}
\pause
\put(0,0){\framebox[\textwidth]{\phantom{ some text, soon in a frame}}}
\end{picture}

\end{frame}
\end{document}
1

You can use the "tcolorbox" solution and create a command to use at all times

\documentclass{beamer}
\usepackage{tcolorbox}

\newcommand<>{\tmpbox}[1]{
    \definecolor{colorbox}{RGB}{255,255,255}
    \only#2{\definecolor{colorbox}{RGB}{5,61,245}}
    \tcbox[colback=white,colframe=colorbox,nobeforeafter,tcbox raise base]{#1}
}

\begin{document}

\begin{frame}
    This \tmpbox<1>{text} is marked on the first slide and the other \tmpbox<2>{text} in the second.
\end{frame}

\end{document}

slide1 slide2

  • Welcome to TeX.SX! This might work, but the spacing around the box is too large, perhaps? – user31729 Jun 3 '15 at 20:30

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.