Graphics, Figures & Tablesfloat | Color of Caption Number for new Float Type

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Kenton
Posts: 2
Joined: Mon Feb 27, 2012 2:02 am

float | Color of Caption Number for new Float Type

Post by Kenton »

I've used a \newfloat to distinguish one set of figures from another. I've been able to change the title and text of the caption to blue but cannot seem to change the counter number to blue. Any thoughts would be appreciated.

Code: Select all

\documentclass[12pt]{report}
\usepackage{color}
\usepackage{float}
\floatstyle{plain}
\newfloat{Teacher}{thp}{lop}
\floatname{Teacher}{\textcolor{blue}{Teacher's Guide}}

\begin{document}
\begin{Teacher}[h!]
\begin{center}
A picture would go here.
\end{center}
\caption{\textcolor{blue}{Caption for the picture goes here.}}
\end{Teacher}
\end{document}
Last edited by Stefan Kottwitz on Mon Feb 27, 2012 9:10 am, edited 1 time in total.

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

float | Color of Caption Number for new Float Type

Post by Stefan Kottwitz »

You could use the caption package for coloring captions for a specific float type.

Code: Select all

\usepackage{caption}
\DeclareCaptionFont{blue}{\color{blue}}
\captionsetup[Teacher]{font={blue}}
Stefan
LaTeX.org admin
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

float | Color of Caption Number for new Float Type

Post by sommerfee »

This one will work, too:

Code: Select all

\usepackage{caption}
\captionsetup[Teacher]{font={color=blue}}
Kenton
Posts: 2
Joined: Mon Feb 27, 2012 2:02 am

Re: float | Color of Caption Number for new Float Type

Post by Kenton »

That's what I needed. Thanks.
Post Reply