Change label caption color of a single figure












5















Is it possible to change the caption color in a single figure without changing the color labels of other figures?



I have used this code Change color of figure caption text but every figure is changing its color. I want to do it for only one figure.



My code is mainlyfrom Change color of figure caption text



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}

begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}









share|improve this question

























  • Could you post what you've tried?

    – Bernard
    Feb 14 at 19:42











  • Do you want to change only color of caption or also the Figure and number? For 1st case, caption[Test figure A]{textcolor{red}{Test figure A}} should work.

    – Sigur
    Feb 14 at 19:47













  • Both the caption and the number, but I mostly care about the number (with Fig.).

    – zdm
    Feb 14 at 19:48













  • To change everything, you can try {color{red}caption{text}}.

    – Sigur
    Feb 14 at 20:10
















5















Is it possible to change the caption color in a single figure without changing the color labels of other figures?



I have used this code Change color of figure caption text but every figure is changing its color. I want to do it for only one figure.



My code is mainlyfrom Change color of figure caption text



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}

begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}









share|improve this question

























  • Could you post what you've tried?

    – Bernard
    Feb 14 at 19:42











  • Do you want to change only color of caption or also the Figure and number? For 1st case, caption[Test figure A]{textcolor{red}{Test figure A}} should work.

    – Sigur
    Feb 14 at 19:47













  • Both the caption and the number, but I mostly care about the number (with Fig.).

    – zdm
    Feb 14 at 19:48













  • To change everything, you can try {color{red}caption{text}}.

    – Sigur
    Feb 14 at 20:10














5












5








5








Is it possible to change the caption color in a single figure without changing the color labels of other figures?



I have used this code Change color of figure caption text but every figure is changing its color. I want to do it for only one figure.



My code is mainlyfrom Change color of figure caption text



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}

begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}









share|improve this question
















Is it possible to change the caption color in a single figure without changing the color labels of other figures?



I have used this code Change color of figure caption text but every figure is changing its color. I want to do it for only one figure.



My code is mainlyfrom Change color of figure caption text



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}

begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}






floats color captions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 14 at 21:10









Christian Hupfer

151k15199394




151k15199394










asked Feb 14 at 19:39









zdmzdm

23716




23716













  • Could you post what you've tried?

    – Bernard
    Feb 14 at 19:42











  • Do you want to change only color of caption or also the Figure and number? For 1st case, caption[Test figure A]{textcolor{red}{Test figure A}} should work.

    – Sigur
    Feb 14 at 19:47













  • Both the caption and the number, but I mostly care about the number (with Fig.).

    – zdm
    Feb 14 at 19:48













  • To change everything, you can try {color{red}caption{text}}.

    – Sigur
    Feb 14 at 20:10



















  • Could you post what you've tried?

    – Bernard
    Feb 14 at 19:42











  • Do you want to change only color of caption or also the Figure and number? For 1st case, caption[Test figure A]{textcolor{red}{Test figure A}} should work.

    – Sigur
    Feb 14 at 19:47













  • Both the caption and the number, but I mostly care about the number (with Fig.).

    – zdm
    Feb 14 at 19:48













  • To change everything, you can try {color{red}caption{text}}.

    – Sigur
    Feb 14 at 20:10

















Could you post what you've tried?

– Bernard
Feb 14 at 19:42





Could you post what you've tried?

– Bernard
Feb 14 at 19:42













Do you want to change only color of caption or also the Figure and number? For 1st case, caption[Test figure A]{textcolor{red}{Test figure A}} should work.

– Sigur
Feb 14 at 19:47







Do you want to change only color of caption or also the Figure and number? For 1st case, caption[Test figure A]{textcolor{red}{Test figure A}} should work.

– Sigur
Feb 14 at 19:47















Both the caption and the number, but I mostly care about the number (with Fig.).

– zdm
Feb 14 at 19:48







Both the caption and the number, but I mostly care about the number (with Fig.).

– zdm
Feb 14 at 19:48















To change everything, you can try {color{red}caption{text}}.

– Sigur
Feb 14 at 20:10





To change everything, you can try {color{red}caption{text}}.

– Sigur
Feb 14 at 20:10










2 Answers
2






active

oldest

votes


















5














In my point of view captionsetup{labelfont={color=blue}} etc. in the local environment is sufficient:



enter image description here



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

clearpage

begin{figure}
captionsetup{labelfont={color=blue}}
A
caption{Test figure A}
end{figure}

begin{figure}
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer



















  • 1





    Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

    – koleygr
    Feb 14 at 21:18






  • 1





    @koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

    – Christian Hupfer
    Feb 14 at 21:24



















4














Here's a start. For the caption itself, you could do as the comments suggest and place a textcolor in the caption argument. The number (like "1.2" is contained in thefigure, while the descriptor word "Figure" is kept in figurename.



kolygr correctly points out that I don't really need to renew thefigure, because the color change applied before figurename will carry through. I will leave the code as is though, in case one gets ideas about changing figurename and thefigure to two separate colors.



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
newcommandfigcolor[1]{%
renewcommandthefigure{bfseriessffamilycolor{#1}svthefigure}
renewcommandfigurename{bfseriessffamilycolor{#1}svfigurename}
}
begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}


enter image description here



kolygr also points out that the above code will retain the color in ref attributes. That can be avoided by storing the figure markup in a separate markup macro, and protecting it so that the expansion (with color) doesn't get written to the aux file:



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
renewcommandthefigure{protectmyfigmarkupsvthefigure}
renewcommandfigurename{protectmyfigmarkupsvfigurename}
letmyfigmarkuprelax
newcommandfigcolor[1]{%
defmyfigmarkup{bfseriessffamilycolor{#1}}%
}
begin{document}
In Figure~ref{fg1.2}...

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
label{fg1.2}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer


























  • You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

    – koleygr
    Feb 14 at 20:24













  • I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

    – koleygr
    Feb 14 at 20:40











  • @koleygr I see. Let me think on that more.

    – Steven B. Segletes
    Feb 14 at 20:52











  • @koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

    – Steven B. Segletes
    Feb 14 at 20:57













  • Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

    – koleygr
    Feb 14 at 20:59











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f474932%2fchange-label-caption-color-of-a-single-figure%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














In my point of view captionsetup{labelfont={color=blue}} etc. in the local environment is sufficient:



enter image description here



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

clearpage

begin{figure}
captionsetup{labelfont={color=blue}}
A
caption{Test figure A}
end{figure}

begin{figure}
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer



















  • 1





    Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

    – koleygr
    Feb 14 at 21:18






  • 1





    @koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

    – Christian Hupfer
    Feb 14 at 21:24
















5














In my point of view captionsetup{labelfont={color=blue}} etc. in the local environment is sufficient:



enter image description here



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

clearpage

begin{figure}
captionsetup{labelfont={color=blue}}
A
caption{Test figure A}
end{figure}

begin{figure}
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer



















  • 1





    Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

    – koleygr
    Feb 14 at 21:18






  • 1





    @koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

    – Christian Hupfer
    Feb 14 at 21:24














5












5








5







In my point of view captionsetup{labelfont={color=blue}} etc. in the local environment is sufficient:



enter image description here



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

clearpage

begin{figure}
captionsetup{labelfont={color=blue}}
A
caption{Test figure A}
end{figure}

begin{figure}
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer













In my point of view captionsetup{labelfont={color=blue}} etc. in the local environment is sufficient:



enter image description here



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage[labelfont={color=red}]{caption}

begin{document}

chapter{Test chapter}

clearpage

begin{figure}
captionsetup{labelfont={color=blue}}
A
caption{Test figure A}
end{figure}

begin{figure}
B
caption{Test figure B}
end{figure}

end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 14 at 21:07









Christian HupferChristian Hupfer

151k15199394




151k15199394








  • 1





    Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

    – koleygr
    Feb 14 at 21:18






  • 1





    @koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

    – Christian Hupfer
    Feb 14 at 21:24














  • 1





    Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

    – koleygr
    Feb 14 at 21:18






  • 1





    @koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

    – Christian Hupfer
    Feb 14 at 21:24








1




1





Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

– koleygr
Feb 14 at 21:18





Glad that removed my answer before you answer this... Already feel somehow stupid (+1 already)

– koleygr
Feb 14 at 21:18




1




1





@koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

– Christian Hupfer
Feb 14 at 21:24





@koleygr: Thanks, no need to feel stupid, however. Good packages (and caption is a very good one, in my point of view) provide such local group-aware ...setup like macro, that simplifies customization...

– Christian Hupfer
Feb 14 at 21:24











4














Here's a start. For the caption itself, you could do as the comments suggest and place a textcolor in the caption argument. The number (like "1.2" is contained in thefigure, while the descriptor word "Figure" is kept in figurename.



kolygr correctly points out that I don't really need to renew thefigure, because the color change applied before figurename will carry through. I will leave the code as is though, in case one gets ideas about changing figurename and thefigure to two separate colors.



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
newcommandfigcolor[1]{%
renewcommandthefigure{bfseriessffamilycolor{#1}svthefigure}
renewcommandfigurename{bfseriessffamilycolor{#1}svfigurename}
}
begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}


enter image description here



kolygr also points out that the above code will retain the color in ref attributes. That can be avoided by storing the figure markup in a separate markup macro, and protecting it so that the expansion (with color) doesn't get written to the aux file:



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
renewcommandthefigure{protectmyfigmarkupsvthefigure}
renewcommandfigurename{protectmyfigmarkupsvfigurename}
letmyfigmarkuprelax
newcommandfigcolor[1]{%
defmyfigmarkup{bfseriessffamilycolor{#1}}%
}
begin{document}
In Figure~ref{fg1.2}...

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
label{fg1.2}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer


























  • You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

    – koleygr
    Feb 14 at 20:24













  • I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

    – koleygr
    Feb 14 at 20:40











  • @koleygr I see. Let me think on that more.

    – Steven B. Segletes
    Feb 14 at 20:52











  • @koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

    – Steven B. Segletes
    Feb 14 at 20:57













  • Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

    – koleygr
    Feb 14 at 20:59
















4














Here's a start. For the caption itself, you could do as the comments suggest and place a textcolor in the caption argument. The number (like "1.2" is contained in thefigure, while the descriptor word "Figure" is kept in figurename.



kolygr correctly points out that I don't really need to renew thefigure, because the color change applied before figurename will carry through. I will leave the code as is though, in case one gets ideas about changing figurename and thefigure to two separate colors.



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
newcommandfigcolor[1]{%
renewcommandthefigure{bfseriessffamilycolor{#1}svthefigure}
renewcommandfigurename{bfseriessffamilycolor{#1}svfigurename}
}
begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}


enter image description here



kolygr also points out that the above code will retain the color in ref attributes. That can be avoided by storing the figure markup in a separate markup macro, and protecting it so that the expansion (with color) doesn't get written to the aux file:



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
renewcommandthefigure{protectmyfigmarkupsvthefigure}
renewcommandfigurename{protectmyfigmarkupsvfigurename}
letmyfigmarkuprelax
newcommandfigcolor[1]{%
defmyfigmarkup{bfseriessffamilycolor{#1}}%
}
begin{document}
In Figure~ref{fg1.2}...

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
label{fg1.2}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer


























  • You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

    – koleygr
    Feb 14 at 20:24













  • I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

    – koleygr
    Feb 14 at 20:40











  • @koleygr I see. Let me think on that more.

    – Steven B. Segletes
    Feb 14 at 20:52











  • @koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

    – Steven B. Segletes
    Feb 14 at 20:57













  • Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

    – koleygr
    Feb 14 at 20:59














4












4








4







Here's a start. For the caption itself, you could do as the comments suggest and place a textcolor in the caption argument. The number (like "1.2" is contained in thefigure, while the descriptor word "Figure" is kept in figurename.



kolygr correctly points out that I don't really need to renew thefigure, because the color change applied before figurename will carry through. I will leave the code as is though, in case one gets ideas about changing figurename and thefigure to two separate colors.



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
newcommandfigcolor[1]{%
renewcommandthefigure{bfseriessffamilycolor{#1}svthefigure}
renewcommandfigurename{bfseriessffamilycolor{#1}svfigurename}
}
begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}


enter image description here



kolygr also points out that the above code will retain the color in ref attributes. That can be avoided by storing the figure markup in a separate markup macro, and protecting it so that the expansion (with color) doesn't get written to the aux file:



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
renewcommandthefigure{protectmyfigmarkupsvthefigure}
renewcommandfigurename{protectmyfigmarkupsvfigurename}
letmyfigmarkuprelax
newcommandfigcolor[1]{%
defmyfigmarkup{bfseriessffamilycolor{#1}}%
}
begin{document}
In Figure~ref{fg1.2}...

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
label{fg1.2}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}





share|improve this answer















Here's a start. For the caption itself, you could do as the comments suggest and place a textcolor in the caption argument. The number (like "1.2" is contained in thefigure, while the descriptor word "Figure" is kept in figurename.



kolygr correctly points out that I don't really need to renew thefigure, because the color change applied before figurename will carry through. I will leave the code as is though, in case one gets ideas about changing figurename and thefigure to two separate colors.



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
newcommandfigcolor[1]{%
renewcommandthefigure{bfseriessffamilycolor{#1}svthefigure}
renewcommandfigurename{bfseriessffamilycolor{#1}svfigurename}
}
begin{document}

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}


enter image description here



kolygr also points out that the above code will retain the color in ref attributes. That can be avoided by storing the figure markup in a separate markup macro, and protecting it so that the expansion (with color) doesn't get written to the aux file:



documentclass[12pt,twoside]{report}
usepackage{xcolor}
usepackage{caption}
usepackage{caption}
letsvthefigurethefigure
letsvfigurenamefigurename
renewcommandthefigure{protectmyfigmarkupsvthefigure}
renewcommandfigurename{protectmyfigmarkupsvfigurename}
letmyfigmarkuprelax
newcommandfigcolor[1]{%
defmyfigmarkup{bfseriessffamilycolor{#1}}%
}
begin{document}
In Figure~ref{fg1.2}...

chapter{Test chapter}

begin{figure}
centering
A
caption{Test figure A}
end{figure}
begin{figure}
figcolor{blue}
centering
B
caption{Test figure B}
label{fg1.2}
end{figure}
begin{figure}
centering
B
caption{Test figure B}
end{figure}

end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 14 at 20:57

























answered Feb 14 at 20:09









Steven B. SegletesSteven B. Segletes

156k9201411




156k9201411













  • You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

    – koleygr
    Feb 14 at 20:24













  • I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

    – koleygr
    Feb 14 at 20:40











  • @koleygr I see. Let me think on that more.

    – Steven B. Segletes
    Feb 14 at 20:52











  • @koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

    – Steven B. Segletes
    Feb 14 at 20:57













  • Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

    – koleygr
    Feb 14 at 20:59



















  • You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

    – koleygr
    Feb 14 at 20:24













  • I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

    – koleygr
    Feb 14 at 20:40











  • @koleygr I see. Let me think on that more.

    – Steven B. Segletes
    Feb 14 at 20:52











  • @koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

    – Steven B. Segletes
    Feb 14 at 20:57













  • Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

    – koleygr
    Feb 14 at 20:59

















You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

– koleygr
Feb 14 at 20:24







You may replace color by textcolor or a similar change because the color will be maintained in a possible reference.... (+1... I learn something new again from you!)

– koleygr
Feb 14 at 20:24















I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

– koleygr
Feb 14 at 20:40





I didn't thought about that... I just tested with a previous version of mine by adding "Figure~ref{label} is red" and the text "is red" was red too... So, you need to enclose color command inside braces or use textcolor instead to avoid the color be maintained after a possible reference (that is also another problem if the op want it in black and not colored])

– koleygr
Feb 14 at 20:40













@koleygr I see. Let me think on that more.

– Steven B. Segletes
Feb 14 at 20:52





@koleygr I see. Let me think on that more.

– Steven B. Segletes
Feb 14 at 20:52













@koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

– Steven B. Segletes
Feb 14 at 20:57







@koleygr Thank you again for pointing that out. I added an addendum to address it, depending on what the OP wants.

– Steven B. Segletes
Feb 14 at 20:57















Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

– koleygr
Feb 14 at 20:59





Just realized how close was my code to yours and deleted my answer... I didn't mentioned that your svthefigure was defined by a let command like mine.... I thought it had to do with something internal to the figure and tried to learn from it... But finally my answer had nothing more to offer than yours and deleted

– koleygr
Feb 14 at 20:59


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f474932%2fchange-label-caption-color-of-a-single-figure%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?