14

I'm using boxes made with tcolorbox in my beamer presentation, using the beamer skin provided by the package. When the box is split in two parts with the \tcblower command, the lower part looks "disconnected" from the upper, while I'd like to hide the graphical difference.

Here is a code sample:

\documentclass{beamer}
\usepackage{tcolorbox}
\tcbuselibrary{skins} 

\begin{document}
\begin{frame}
\begin{tcolorbox}[width=2cm,skin=beamer,boxrule=0pt,after=]
   test
   \tcblower
   test
\end{tcolorbox}
\begin{tcolorbox}[width=2cm,skin=beamer,boxrule=0pt,before=]
   test

   test
\end{tcolorbox} 
\end{frame}
\end{document}

I'd like the first box to look exactly like the second, but at the same time I'd like to keep the ability to specify different properties for the two parts like different alignment, font size, etc.

What I want is to hide the separation between the two parts just from a graphical point of view.

I searched the docs but can't seems to find any clue about this.

12

May I assist with a second answer? It removes the segmentation but keeps the 'beamerish' look also for boxes with title. For demonstration, I added a third box with a title and a shrinked space between upper and lower part which you may prefer. My examples also contain a shadow which you can remove by adding the option no shadow.

\documentclass{beamer}
\usepackage{tcolorbox}
\tcbuselibrary{skins}

\makeatletter
\tcbset{beamer without segmentation/.style={%
  beamer,segmentation code=,
  interior titled code={{\tcb@spec{beamer@color}\tcb@drawwithtitle@path}\tcb@drawspec@T},
  interior code={{\tcb@spec{beamer@color}\tcb@drawwithouttitle@path}}}}
\makeatother

\begin{document}
\begin{frame}
\tcbset{colframe=blue!40!black,colback=blue!20!white}

\begin{tcolorbox}[beamer without segmentation,width=2cm,nobeforeafter]
   test
   \tcblower
   test
\end{tcolorbox}
%
\begin{tcolorbox}[beamer,width=2cm,nobeforeafter]
   test

   test
\end{tcolorbox}
%
\begin{tcolorbox}[beamer without segmentation,width=3cm,nobeforeafter,
  title=My Title,middle=1pt]
   test
   \tcblower
   test
\end{tcolorbox}

\end{frame}
\end{document}

enter image description here

  • Your assist is welcome ;-) – Marco Daniel Jun 28 '13 at 6:26
  • thank you! Maybe this can be added as an option? I mean, an option to have a lower part without changing the appearance of the box? – Lep Jun 28 '13 at 9:10
  • @Lep I will think about it :-) – Thomas F. Sturm Jun 28 '13 at 11:18
  • @Lep From version 2.33 on, you can say lower separated=false to remove the separation. This works for all skins including beamer and also for breakable boxes. – Thomas F. Sturm Jul 4 '13 at 10:43
  • @ThomasF.Sturm awesome, thank you very much – Lep Jul 6 '13 at 10:00
8

You can use the option interior hidden. But if you use this option you have to specify the top/bottom color:

\documentclass{beamer}
\usepackage{tcolorbox}
\tcbuselibrary{skins} 

\begin{document}
\begin{frame}
\begin{tcolorbox}[width=2cm,skin=beamer,boxrule=0pt,enhanced,interior hidden,frame style={top color=black!5!white, bottom color=black!5!white!75!black},]
   test
   \tcblower
   test
\end{tcolorbox}
\begin{tcolorbox}[width=2cm,skin=beamer,boxrule=0pt,before=]
   test

   test
\end{tcolorbox} 
\end{frame}
\end{document}

enter image description here

  • thanks, but I can I remove the segmented line too? – Lep Jun 27 '13 at 19:18
  • 1
    @Lep: Use segmentation style={draw=none}, – Marco Daniel Jun 27 '13 at 20:38

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.