I would like to change the color of the "FIGURE 1:" portion of my caption to blue (including the number & colon), but I want the remainder of the caption to be black. I have tried the following in my preamble, however, the whole caption is blue:
\documentclass{article}
\usepackage{color}
\renewcommand{\figurename}{\color{blue}{FIGURE}}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics[width=\linewidth]{../ubmFigures/exampledoc}
\caption{An example figure}
\end{figure}
\end{document}
Best Answer
The
caption
package provides better control over caption elements. Specifically, you can set thelabelfont
andtextfont
to include colour or not. With the elements grouped, just settinglabelfont{color=blue}
prints the\figurename
, number and separator in blue:A discussion on the options are available from the
caption
documentation (section 2.3 Fonts, p 9-10).