答案1
答案2
附带caption
包装:
\usepackage{xcolor}
\colorlet{labelcolor}{blue}
\DeclareCaptionLabelFormat{bluenum}{#1~\textcolor{labelcolor}{#2}}
\captionsetup{labelformat=bluenum}
答案3
重新定义\fnum@figure
以添加颜色。
\documentclass{article}
\usepackage{xcolor}
\renewcommand\figurename{Figure}
\makeatletter
\def\fnum@figure{\figurename\nobreakspace\textcolor{red}{\thefigure}}
\makeatother
\begin{document}
\begin{figure}[ht]
\centering
\rule{1in}{1in}
\caption{This is a caption}
\end{figure}
\end{document}
这只会改变标题的颜色,而不会改变例如对图的引用的颜色。如果您希望数字的颜色甚至在引用中也发生变化,则可以重新定义\thefigure
:
\documentclass{article}
\usepackage{xcolor}
\let\svthefigure\thefigure
\def\thefigure{\textcolor{red}{\svthefigure}}
\begin{document}
\begin{figure}[ht]
\centering
\rule{1in}{1in}
\caption{This is a caption}
\label{fg:A}
\end{figure}
In figure\nobreakspace\ref{fg:A}
\end{document}