Graphics, Figures & Tablesbeamer | Change Background Color for Float Captions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
timwryan
Posts: 1
Joined: Fri Feb 17, 2012 5:53 am

beamer | Change Background Color for Float Captions

Post by timwryan »

I would like colored captions in figures and tables. Right now to get the look I want I am cheating:

Code: Select all

\documentclass[red, compress, xcolor=dvipsnames,table]{beamer}
\setbeamertemplate{navigation symbols}{}
\usetheme{Frankfurt}
\setbeamercovered{transparent}

\definecolor{CaptionTitle}{RGB}{209,34,42}
\definecolor{CaptionBG}{RGB}{243,237,230}
\definecolor{TableRow}{RGB}{255,247,233}

\begin{document}
\frame
{
\rowcolors{1}{TableRow}{white}
  \begin{table}
    \begin{tabular}\hline
	\multicolumn{2}{| ll |}{\cellcolor{CaptionBG}\color{CaptionTitle}Table. \color{black} Common Nevi}\\ \hline
	\textbf{Number} & \textbf{Risk (95\% CI)}\\
	0-15		&1.00\\
	16-40	&1.47 (1.36-1.59)\\
	41-60	&2.24 (1.90-2.64)\\
	61-80	&3.26 (2.55-4.15)\\
	81-100	&4.74 (3.44-6.53)\\
	101-120	&6.89 (4.63-10.25)\\
	\hline
    \end{tabular}
  \end{table}
}
\end{document}
Is there a way I can get \caption{} to produce something similar?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply