# Figure label in one color, figure text in another as a document rule

By adding the following package with parameters, all captions for tables, figures etc. change color, font-size and distance between label and text:

%Caption formatting


If I still want the text to be black and only the "Figure 1" label to change color, then I simply set it back to black manually in every caption at the moment:

\caption{\color{black} test caption text }


The result is perfect:

but can I make these different colors automatic along with the package parameters in the preamble so I don't have to add \color{black} in every single caption?

A code example:

\documentclass[11pt,a4paper]{article}

\usepackage[utf8x]{inputenc}    %Character set
\usepackage{graphicx}           %Figures
\usepackage{caption}            %Main caption for subfigures
...

%Caption formatting

\begin{document}

\begin{figure}[p]
\centering
\includegraphics[width=0.8\textwidth]{image.png}
\caption{Test caption text}
\label{fig:test}
\end{figure}

\end{document}

• It would really nice to post minimal but compilabel examples. It saves a lot of time for a helper to write an answer. – Johannes_B Jun 17 '15 at 12:11

Use labelfont to control the font of the label. You can also use captionsetup to treat figures and tables (and all compaitble self-defined floats) differently.
\documentclass{article}

• Johannes, you solve all my questions today. Thank you very much. This works: \usepackage[font=footnotesize,labelfont={color=red},labelsep=quad,width=.75\textwidth]{caption} – Steeven Jun 17 '15 at 12:19