除了無襯線字體和小字體之外,我怎麼能製作labelfont
出相同的字體?\spacedlowsmallcaps
\documentclass{article}
\usepackage{microtype}
\usepackage{caption}
\microtypesetup{expansion=false}%
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}%
\renewcommand{\sfdefault}{iwona}
\captionsetup{%
format=hang,%
labelfont={small,sf},%
font={small,sf},%
width={.8\textwidth}%
}
\captionsetup[table]{skip=\medskipamount}
\begin{document}
\begin{table}
\caption{Test}
\end{table}
\end{document}
\subfloat
命令
\DeclareCaptionLabelFormat{mysublabel}{\small\sffamily\bothIfSecond{\spacedlowsmallcaps{#1}}{~}\spacedlowsmallcaps{(#2)}}
\captionsetup[subfloat]{%
labelformat=mysublabel,%
labelsep=space,%
listofformat=subparens,%
font={small,sf},%
}
答案1
您可以聲明自己的標籤格式。該caption
軟體包提供了\DeclareCaptionLabelFormat
這一點。它需要兩個參數:名稱和代碼。在程式碼參數中,您可以使用#1
標題名稱(如“圖”或“表”)和#2
數字。為了獲得正確的格式,即使沒有提供其中之一,caption
包也定義瞭\bothIfFirst
如果\bothIfSecond
給出了相應的參數則排版它們的參數,如果沒有給出則排版它們的參數。如果subcaption
使用該包,這可能很重要。詳情請參閱包文件。
\documentclass{article}
\usepackage{microtype}
\usepackage{caption}
\usepackage{textcase}
\microtypesetup{expansion=false}%
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}%
\renewcommand{\sfdefault}{iwona}
\DeclareCaptionLabelFormat{mycaption}{%
\bothIfFirst{\spacedlowsmallcaps{#1}}{~}\spacedlowsmallcaps{#2}}
\captionsetup{%
format=hang,%
% labelfont={small,sf},% not necessary since `font' applies to both label and text
labelformat=mycaption,
font={small,sf},%
width={.8\textwidth}%
}
\captionsetup[table]{skip=\medskipamount}
\begin{document}
\begin{table}
\caption{Test}
\end{table}
\end{document}