我希望能够将图片标题描述设置为粗斜体。我使用命令\usepackage[font={color=blue,bf},figurename=Fig.]{caption}
序言中的命令将图形名称设置为蓝色和粗体。我想知道如何附加序言代码以使图形描述显示红色粗斜体(在此示例中,测试 1 和测试 2 显示红色粗斜体)。谢谢。
以下是代码(摘自这里):
\documentclass{article}
\usepackage{mwe}
\usepackage{xcolor}
\usepackage[justification=centering]{subcaption}
\usepackage[font={color=blue,bf},figurename=Fig.]{caption}
\begin{document}
\begin{figure}[t]
\caption{Test 1}
\label{fig:test1}
\begin{subfigure}{0.45\columnwidth}
\centering
\includegraphics[width=\linewidth]{example-image-a}%
\caption{}
\label{fig:test11}
\end{subfigure}
\hfill
\begin{subfigure}{0.45\columnwidth}
\centering
\includegraphics[width=\linewidth]{example-image-b}%
\caption{}
\label{fig:test12}
\end{subfigure}
{\footnotesize Source: Here comes the figures description.}
\end{figure}
\begin{figure}[!h]
\centering
\caption{Test 2}
\label{fig:test2}
\includegraphics[width=0.6\columnwidth]{example-image-c}
\begin{minipage}{\linewidth}\footnotesize
Source: Here comes the figures description.
\end{minipage}
\end{figure}
Figures \ref{fig:test1} is composed of \ref{fig:test11} e \ref{fig:test12}.
Figure \ref{fig:test2} is an ordinary include entry.
\end{document}
答案1
这应该有效:
\captionsetup{labelfont={color=red,bf,it}}