
このコードは問題ありません:
\usepackage{caption}
\captionsetup{
font=small,
labelfont=bf,
justification=justified,
format=plain}
しかし、私は次のようにフォントをカスタマイズしたいのです:
\usepackage{caption}
\captionsetup{
font={\fontsize{10pt}{11pt}\selectfont},
labelfont=bf,
justification=justified,
format=plain}
後者のコードはコンパイル エラーになります。助けてください。
動作しないコードを含む最小限の例を次に示します。
\documentclass{article}
\usepackage{caption}
\captionsetup{
font={\fontsize{10pt}{11pt}\selectfont},
labelfont=bf,
justification=justified,
format=plain}
\begin{document}
\begin{figure}
\caption{A figure caption}
\end{figure}
\end{document}
答え1
必要がある定義する新しいフォントスタイルは、caption
キー値入力の一部としてこれが必要です:
\documentclass{article}
\usepackage{caption}
\DeclareCaptionFont{myfont}{\fontsize{10pt}{11pt}\selectfont}
\captionsetup{
font=myfont,
labelfont=bf,
justification=justified,
format=plain
}
\begin{document}
\begin{figure}
\caption{This is a caption}
\end{figure}
\end{document}