While I have given up with beamer tcolorbox inside align, I have realized my mwe
theme is not working to box an align equation either:
The beamerthememwe.sty
:
\mode<presentation>
\usepackage[customcolors,shade]{hf-tikz}
\usetikzlibrary{arrows,shadows,petri,decorations.markings,shapes}
\RequirePackage[most]{tcolorbox}
\definecolor{dcol}{HTML}{3F51B5}
\usecolortheme[named=dcol]{structure}
\usepackage[]{biblatex}
\tcbuselibrary{theorems}
\tcbset{%
left=6mm, right=6mm, top=6mm, bottom=6mm, middle=4mm,
}
\tcbset{%
outerlayer/.style={%
enhanced, sharpish corners=all, colbacktitle=dcol, coltitle=white, coltext=dcol, left=1mm,
right=6mm, top=1mm, bottom=1mm, middle=4mm, toptitle=1mm, bottomtitle=1mm,
% fuzzy shadow={0mm}{0.9mm}{0.6mm}{0.2mm}{black}, % top
% fuzzy shadow={0mm}{-0.6mm}{-0.1mm}{0.2mm}{black}, % bottomSmall
% fuzzy shadow={0mm}{-0.2mm}{-0.2mm}{0.2mm}{black}, % bottomBig
title filled, boxrule=0mm, %
segmentation code={\path[draw=BGrey](segmentation.west) -- (segmentation.east);}
},
innerlayer/.style={outerlayer,
noparskip, breakable, colback=dcol, coltitle=black, coltext=white,
fonttitle={\bfseries \scshape},
bottomtitle=1mm}
}
\newtcolorbox{card}[1][]{%
outerlayer,
title=#1,
}
\newtcolorbox{hlcard}[1][]{%
innerlayer,hbox,
#1
}
and a minimal mwe:
\documentclass[10pt,xcolor=dvipsnames,xcolor=table]{beamer}
\usetheme{mwe}
\usepackage[]{biblatex}
% \usepackage{roboto}
\begin{document}
\begin{frame}\frametitle{Hello}
\begin{card}
\begin{hlcard}[ams align*]
F&=ma\\
E&=mc^{2}
\end{hlcard}
\end{card}
\end{frame}
\end{document}
which is giving error:
! Missing } inserted.
<inserted text>
}
l.14 \end{frame}
? X
No pages of output.
This error is gone if I don't use my theme and simply do:
\documentclass[10pt,xcolor=dvipsnames,xcolor=table]{beamer}
\usetheme{mwe}
\usepackage[]{biblatex}
% \usepackage{roboto}
\begin{document}
\begin{frame}\frametitle{Hello}
% \begin{card}
% \begin{hlcard}[ams align*]
\begin{tcolorbox}[ams align*]
F&=ma\\
E&=mc^{2}
\end{tcolorbox}
% \end{hlcard}
% \end{card}
\end{frame}
\end{document}
So, there must be something I am missing in the card
and hlcard
definition, but I am unable to find it over the weekend.
I will be grateful if you show me some light.
UPDATE The only clue I have is that hbox
is the culprit. I am using hbox
in hlcard
to make the tcolorbox
wrap the text/equation only, not the complete textwidth
.
NB: hlcard
is working fine to cover a single inline equation.
hbox
will give an error asalign*
needs to be in vertical mode. Why do you need thehbox
?hbox
just to maketcolorbox
to be around the text. Withouthbox
, it is occupying fulltextwidth
. So, I will be happy to leavehbox
for something else, which makes thetcolorbox
just wide enough to cover the actual text.$\begin{aligned}...\end{aligned}$
.