Graphics, Figures & TablesChanging color of captions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
carlosmg1982
Posts: 3
Joined: Fri Dec 10, 2010 11:45 pm

Changing color of captions

Post by carlosmg1982 »

Hi!!

I am introducing in a document some float images, and I would like to change automatically the color of the captions. I have tried this in the preamble:

\renewcommand{\figurename}{\color{Blue}Figure}

But it does not work. It is still black :(

Anyone has any idea what I can do??

I use LyX under MAC OSX
Last edited by carlosmg1982 on Fri Dec 17, 2010 6:19 pm, edited 1 time in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Changing color of captions

Post by meho_r »

Documentation of caption package, section 4.

An example (goes into the Preamble: Document > Settings > LaTeX Preamble):

Code: Select all

\usepackage{caption}
\usepackage[svgnames]{xcolor}
\DeclareCaptionFont{myblue}{\color{RoyalBlue}}
\captionsetup{labelfont={myblue,bf}}
I used "RoyalBlue" color provided by xcolor package with "svgnames" option just to point out that you don't have to stick with "standard" colors, but you may choose any color you like (or mix your own).
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Changing color of captions

Post by sommerfee »

meho_r wrote:

Code: Select all

\usepackage{caption}
\usepackage[svgnames]{xcolor}
\DeclareCaptionFont{myblue}{\color{RoyalBlue}}
\captionsetup{labelfont={myblue,bf}}
Addendum: This could also we written as:

Code: Select all

\usepackage[svgnames]{xcolor}
\usepackage[labelfont={color=RoyalBlue,bf}]{caption}
carlosmg1982
Posts: 3
Joined: Fri Dec 10, 2010 11:45 pm

Re: Changing color of captions

Post by carlosmg1982 »

It worked!!! Thank you very very much!!! Sorry for the late reply...I have been in the hospital after a surgery. I really appreciate your answers!
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Changing color of captions

Post by meho_r »

carlosmg1982 wrote:It worked!!! Thank you very very much!!! Sorry for the late reply...I have been in the hospital after a surgery. I really appreciate your answers!
Oh, my! Hope you're OK.

Best wishes,

M.
Post Reply