如何在「caption」套件中使用顏色?

如何在「caption」套件中使用顏色?

我正在使用caption包來自定義論文中的標題。我目前的程式碼是:

\usepackage[width=0.6\textwidth ,font={small, sf,it},labelfont=bf,
labelsep=endash, format=plain,labelsep=period]{caption}

但我想為標題標籤添加顏色。如下圖所示: 說明文字http://img24.ir/uploads/1365940937491.png

答案1

標題文件第 25 頁提供了這樣的範例。

\usepackage{xcolor}
\DeclareCaptionFont{blue}{\color{blue}}
\captionsetup{labelfont={blue,bf}}

正如 Axel Sommerfeld 所提到的,以下內容也將起作用:

\usepackage{xcolor}
\captionsetup{labelfont={color=blue,bf}}

這是一個小例子:

在此輸入影像描述

\documentclass[10pt]{article}
\usepackage{xcolor}
\usepackage[width=0.6\textwidth ,font={small, sf,it},labelfont={color=blue,bf},
labelsep=endash, format=plain,labelsep=period]{caption}
\begin{document}
\begin{figure}
\caption{Eiffel Tower, Paris}
\end{figure}
\end{document}

相關內容