6

I want a box with the header frame for empty title. How can I do that? If I remove the title, the header frame will be removed automatically. I've tried to put an empty title so that I can keep the header frame but with no luck.

\begin{frame}[t]
    \frametitle{KKKKKKKK}
\begin{tcolorbox}[colback=green!5, colframe=green!30!black, title = {}]

\end{tcolorbox}
\end{frame}

2 Answers 2

7
\documentclass{beamer}
\usepackage{tcolorbox}
\begin{document}

\begin{frame}[t]
\frametitle{Test}
\begin{tcolorbox}[colback=green!5, colframe=green!30!black, title = {\strut}]
Test
\end{tcolorbox}
\end{frame}

\end{document}

enter image description here

Instead of \strut you could use an empty box: \mbox{}, or a phantom: \phantom{Ag}- Here's the result with an empty box:

\documentclass{beamer}
\usepackage{tcolorbox}
\begin{document}

\begin{frame}[t]
\frametitle{Test}
\begin{tcolorbox}[colback=green!5, colframe=green!30!black, title = {\mbox{}}]
Test
\end{tcolorbox}
\end{frame}

\end{document}

enter image description here

4
  • how to reduce the height of the header? It is a little big.
    – CroCo
    May 26, 2014 at 20:31
  • @CroCo As I said, change \strut to \mbox{}. May 26, 2014 at 20:32
  • ^^ sorry I commented before your update. Thanks it worked
    – CroCo
    May 26, 2014 at 20:34
  • @CroCo Ah, I see. No problem. In any case, I updated the answer with an example using the box. May 26, 2014 at 20:35
0

You can add toprule in the options. (page 22)

\documentclass{beamer}
\usepackage{tcolorbox}

\begin{document}

\begin{frame}[t]
\begin{tcolorbox}[colback=green!5, colframe=green!30!black,toprule=12pt]

\end{tcolorbox}
\end{frame}

\end{document}
4
  • Notice that this dosen't exactly give the shape for the upper part as with a real title. May 26, 2014 at 20:28
  • @SLx64, it gives me error.
    – CroCo
    May 26, 2014 at 20:30
  • @Gonzalo Medina Oh yes, you're right! CroCo Could you post the error message please?
    – SLx64
    May 26, 2014 at 20:32
  • ! Package pgfkeys Error: I do not know the key '/tcb/toprule' and I am going to
    – CroCo
    May 26, 2014 at 20:35

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.