Closed Enivex closed 4 weeks ago
You can work around the problem by loading another colour theme first:
\documentclass{beamer}
\usecolortheme{orchid}
\usetheme{moloch}
\molochset{block=fill}
\useinnertheme{tcolorbox}
\begin{document}
\begin{frame}
\begin{block}{title}
content...
\end{block}
\end{frame}
\end{document}
@samcarter
Thanks, that indeed works. I like having rounded corners on my theorem boxes.
Hm, I see. Do you have a minimal working example?
I can only reproduce this when first loading some other color theme, then moloch, then the innertheme from tcolorbox (like in @samcarter's example). I get this:
.../beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty|118 error| (Package xcolor) Undefined color `structure.fg'. See the xcolor package documentation for explanation. ...
.../beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty|118 error| (Package xcolor) Undefined color `structure.fg'. See the xcolor package documentation for explanation. ...
when compiling this:
\documentclass{beamer}
\usecolortheme{orchid}
\usetheme{moloch}
\useinnertheme{tcolorbox}
\begin{document}
\begin{frame}[c]
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{frame}
\end{document}
But with
\usetheme{moloch}
\usecolortheme{orchid}
\useinnertheme{tcolorbox}
it compiles just fine.
Does it compile fine without the "\usecolortheme{orchid}"?
Yes, this works fine:
\documentclass{beamer}
\usetheme{moloch}
\useinnertheme{tcolorbox}
\begin{document}
\begin{frame}[c]
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{frame}
\end{document}
What versions of tcolorbox, moloch, and beamer are you on?
Your example works @jolars , but the following does not
\documentclass{beamer}
\usetheme[block=fill]{moloch}
\useinnertheme{tcolorbox}
\begin{document}
\begin{frame}[c]
\begin{theorem}
Hello
\end{theorem}
\end{frame}
\end{document}
Yes, this works fine:
\documentclass{beamer} \usetheme{moloch} \useinnertheme{tcolorbox} \begin{document} \begin{frame}[c] \begin{tcolorbox} This is a \textbf{tcolorbox}. \end{tcolorbox} \end{frame} \end{document}
What versions of tcolorbox, moloch, and beamer are you on?
You need the block=fill
option for moloch.
@samcarter
Thanks, that indeed works. I like having rounded corners on my theorem boxes.
\documentclass{beamer}
\usecolortheme{orchid}
\usetheme{moloch}
\molochset{block=fill}
\useinnertheme[rounded]{tcolorbox}
\begin{document}
\begin{frame}
\begin{block}{title}
content...
\end{block}
\end{frame}
\end{document}
Yes, I'm aware how to achieve that
(I use shaded=false
too, since I think the gradient transition does not look good)
Yes, I'm aware how to achieve that
(I use
shaded=false
too, since I think the gradient transition does not look good)
In this case I don't understand what "I like having rounded corners on my theorem boxes." meant
It was just an explanation for why I wanted to use the tcolorbox inner theme instead of the moloch one
It was just an explanation for why I wanted to use the tcolorbox inner theme instead of the moloch one
Ah!
Minimal non-working example:
\documentclass{beamer}
\usetheme{moloch}
\molochset{block=fill}
\setbeamertemplate{blocks}[rounded]
\begin{document}
\begin{frame}
\begin{block}{title}
content...
\end{block}
\end{frame}
\end{document}
... so looking in the code, the difference between moloch and other colour themes, seems to be the use=block title
Something like
\documentclass{beamer}
\usetheme{moloch}
\makeatletter
\renewcommand{\moloch@block@fill}{
\setbeamercolor{block title}{%
bg=normal text.bg!80!fg
}
\setbeamercolor{block body}{%
use=block title,bg=block title.bg!50!normal text.bg
}
\setbeamercolor{block title alerted}{%
bg=block title.bg,
}
\setbeamercolor{block title example}{%
bg=block title.bg,
}
}
\makeatother
\molochset{block=fill}
\setbeamertemplate{blocks}[rounded]
\begin{document}
\begin{frame}
\begin{block}{title}
content...
\end{block}
\end{frame}
\end{document}
would compile.
Thanks @samcarter, I implemented your proposed change. I'm not sure if there's anything else that needs to be done (?), but the failing cases here seem to work fine now.
Thanks @samcarter, I implemented your proposed change. I'm not sure if there's anything else that needs to be done (?), but the failing cases here seem to work fine now.
Great! I don't think anything else needs to be done.
Trying to load
\useinnertheme{tcolorbox}
aftermoloch
results inThis works with metropolis