![如何在「caption」套件中使用顏色?](https://rvso.com/image/266434/%E5%A6%82%E4%BD%95%E5%9C%A8%E3%80%8Ccaption%E3%80%8D%E5%A5%97%E4%BB%B6%E4%B8%AD%E4%BD%BF%E7%94%A8%E9%A1%8F%E8%89%B2%EF%BC%9F.png)
我正在使用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}