我想重新定义 \caption 命令以使其具有参数:一个“主要”标题,然后是描述。
这就是我要的 :
\begin{figure}
\caption{\textbf{Caption title} \newline \small{I would like this sentence to be under the title and smaller.}}
\end{figure}
图 1-标题
我希望这句话放在标题下并且更小一些。
但我想改变所有标题的格式。我查看了包标题:
\documentclass[10pt]{article}
\usepackage[french,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin=10pt,font=small,labelfont=bf,
labelsep=endash]{caption}
\newlength\myindention
\DeclareCaptionFormat{myformat}%
{#1#2\\\hspace*{\myindention}#3}
\setlength\myindention{1cm}
\captionsetup{format=myformat}
\begin{document}
\begin{figure}
\caption{Caption title. I would like this sentence to be under the title and smaller.}
\end{figure}
\end{document}
图1
Caption title. I would like this sentence to be under the title and smaller.
但上面只有标题(这是我所预料到的,因为我没有给出任何提示 - 但我不知道如何改变它)。
我尝试在格式化命令中添加参数:
\DeclareCaptionFormat{myformat}%
{#1#2#3 \newline \small{#4}}
...
\caption{Caption title.}{I would like this sentence to be under the title and smaller}
但我得到:“ \caption 定义中的参数编号非法”
有什么帮助吗?