我正在尝试获取 sanserif 字体和大写字母的子标题和标题。根据标题包手册,这应该可以通过以下方式实现。但是,这似乎不起作用。我在这里定义错误了吗?
\documentclass{article}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{caption}
\floatsetup[figure]{subcapbesideposition = top}
\captionsetup{labelfont={sf,up}, labelsep=period, format = plain, singlelinecheck = false, textfont=rm, skip = 2pt}
\captionsetup[subfloat]{labelfont = {up,sf},format = plain,textfont = rm,labelformat = simple, labelsep = period}
\begin{document}
\begin{figure}[h!]
\ffigbox[\textwidth]
{\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%
\end{subfloatrow}
\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%
\end{subfloatrow}}
{\caption{this is a caption}}
\end{figure}
\end{document}
答案1
要使单词“Figure”以大写形式显示,可以使用figurename=FIGURE
中的选项\captionsetup
。
要将子图字母改为大写,您可以\renewcommand{\thesubfigure}{\Alph{subfigure}}
在序言中的某处使用。
如果您还想将标题文本变为大写,则可以使用 定义新样式\DeclareCaptionFormat{upper}{#1#2\uppercase{#3}\par}
。
\documentclass{article}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{caption}
\floatsetup[figure]{subcapbesideposition = top}
\DeclareCaptionFormat{upper}{#1#2\uppercase{#3}\par}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup{labelfont={sf}, labelsep=period, format = upper, singlelinecheck = false, textfont=sf, skip = 2pt,figurename=FIGURE}
\captionsetup[subfloat]{labelfont = {sf},format = plain,textfont = rm,labelformat = simple, labelsep = period}
\begin{document}
\begin{figure}[h!]
\ffigbox[\textwidth]
{\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%
\end{subfloatrow}
\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%
\sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%
\end{subfloatrow}}
{\caption{this is a caption}}
\end{figure}
\end{document}