Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with beamertheme-tcolorbox #28

Closed
Enivex opened this issue Oct 29, 2024 · 15 comments · Fixed by #20
Closed

Incompatibility with beamertheme-tcolorbox #28

Enivex opened this issue Oct 29, 2024 · 15 comments · Fixed by #20
Labels
bug Something isn't working

Comments

@Enivex
Copy link

Enivex commented Oct 29, 2024

Trying to load \useinnertheme{tcolorbox} after moloch results in

Package xcolor: Undefined color `block title.bg'.
Package xcolor: Undefined color `normal text.bg'.

This works with metropolis

@samcarter
Copy link

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}

@Enivex
Copy link
Author

Enivex commented Oct 29, 2024

@samcarter

Thanks, that indeed works. I like having rounded corners on my theorem boxes.

@jolars
Copy link
Owner

jolars commented Oct 29, 2024

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.

@Enivex
Copy link
Author

Enivex commented Oct 29, 2024

Does it compile fine without the "\usecolortheme{orchid}"?

@jolars
Copy link
Owner

jolars commented Oct 29, 2024

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?

@Enivex
Copy link
Author

Enivex commented Oct 29, 2024

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}

@samcarter
Copy link

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
Copy link

@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}

@Enivex
Copy link
Author

Enivex commented Oct 29, 2024

Yes, I'm aware how to achieve that

(I use shaded=false too, since I think the gradient transition does not look good)

@samcarter
Copy link

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

@Enivex
Copy link
Author

Enivex commented Oct 29, 2024

It was just an explanation for why I wanted to use the tcolorbox inner theme instead of the moloch one

@samcarter
Copy link

It was just an explanation for why I wanted to use the tcolorbox inner theme instead of the moloch one

Ah!

@samcarter
Copy link

samcarter commented Oct 29, 2024

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.

@jolars jolars added the bug Something isn't working label Oct 29, 2024
@jolars jolars closed this as completed in e8921a6 Oct 29, 2024
@jolars
Copy link
Owner

jolars commented Oct 29, 2024

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.

@samcarter
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants