組合使用標題和 capt-of 套件時發生意外的縮排取消

組合使用標題和 capt-of 套件時發生意外的縮排取消

「captionof」之後的段落沒有正確縮排。要嘛註解掉\usepackage{caption},要嘛\captionof{figure}{figure}收回縮排。

但我需要 capt-of 包和標題包來將“labelsep”重新定義為冒號以外的空格。有沒有其他方法可以做到這一點。

這是一個例子:

\documentclass{article}

\usepackage{capt-of}
\usepackage{caption}

\begin{document}
before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption before caption 

\captionof{figure}{figure}

after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption 

after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption after caption 
\end{document}

答案1

這個問題在這裡已經有答案了:\captionof 與段落縮排混淆但我想添加一些解釋。

文件\captionof包中的(caption第 18 頁)說“……所以你應該同時使用兩者, \captionof並且\captionof*只能在盒子或環境中使用。”因此,將命令單獨放在一組中{\captionof{figure}{figure}}應該是一種合法的方式。

您也不需要,\usepackage{capt-of}因為caption包中還提供了\captionof

相關內容