1

This code isn´t working. Can anyone please tell me, why this tcolorbox isn´t working? (In documentclass "article" it is working, but not in "beamer").

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

\usetheme[subsectionpage=progressbar]{metropolis}
\usepackage{tcolorbox}

\begin{document}

\begin{frame}
\begin{tcolorbox}[
    sharp corners, breakable, frame hidden, enhanced, boxrule=0pt,
    borderline west={3pt}{0pt}{red},
    segmentation style={red, line width=1.5pt, solid},
    colback=red!10,
    ]
    Test, jetzt bin ich gespannt
\end{tcolorbox}
\end{frame}


\end{document}
3
  • 2
    If I complete your code to be able to compile it (adding a document class, loading the necessary packages and tcolorbox libraries, and adding relevant environments), there are no errors and the output is what I would expect. Can you clarify what you mean by "it isn't working in beamer"? To make your question fully clear, you should provide a minimal example of code that is compilable as is and that still reproduces the problem.
    – Vincent
    Oct 3 at 0:08
  • I now edited my question :) Oct 3 at 0:15
  • 2
    You also need to load the tcolorbox libraries breakable and skins since the code of your box needs them. Is that the only problem?
    – Vincent
    Oct 3 at 0:21

1 Answer 1

4
  • For your definition of \tcolorbox style you need to load tcolorbox package with option many or breakable and skins.
  • After adding many option and compose your code fragments into MWE (Minimal Working Example, see it below) works fine. So it is unclear what is actually your problem.
  • Off-topic, I don't see any sense that you require that \tcolorbox should be breakable.

Test MWE:

\documentclass[aspectratio=169, xcolor=dvipsnames, 10pt]{beamer}
\usetheme[subsectionpage=progressbar]{metropolis}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}

\begin{document}
\begin{frame}
\frametitle{Use of the \texttt{tcolorbox}}
    \begin{tcolorbox}[
        sharp corners, %breakable, 
        frame hidden, enhanced, boxrule=0pt,
        borderline west={3pt}{0pt}{red},
        segmentation style={red, line width=1.5pt, solid},
        colback=red!10,
        ]
    \lipsum[66]
    \end{tcolorbox}
\end{frame}
\end{document}

enter image description here

1
  • I didn´t know that I have to use "many", thanks a lot for your help! :) Oct 3 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .