キャプションラベルの \spacedlowsmallcaps

キャプションラベルの \spacedlowsmallcaps

サンセリフ体と小さい文字に加えて、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。名前とコードの 2 つの引数を取ります。コード引数内では、#1キャプション名 (「図」や「表」など) と#2番号に使用できます。これらのうちの 1 つが指定されていない場合でも正しい書式設定が得られるように、パッケージは、それぞれの引数が指定されている場合は両方の引数をタイプセットし、指定されていない場合は非タイプセットするcaptionと も定義します。パッケージを使用する場合、これは重要になる場合があります。詳細については、\bothIfFirst\bothIfSecondsubcaptionパッケージドキュメント

\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}

関連情報