![使用标题包时删除图形列表中的缩进](https://linux22.com/image/440418/%E4%BD%BF%E7%94%A8%E6%A0%87%E9%A2%98%E5%8C%85%E6%97%B6%E5%88%A0%E9%99%A4%E5%9B%BE%E5%BD%A2%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E7%BC%A9%E8%BF%9B.png)
我正在排版一本书,我不想在标题中添加数字,因此我使用了labelformat=empty
captions 包。同样,我想隐藏图片列表中的数字,因此我的序言如下所示:
\usepackage[listformat=empty,labelformat=empty,]{caption}
我们假设我的文本中有这张图片:
\begin{figure}[ht]
\centering
\includegraphics{example-image-a}
\caption[\textit{Title of the Work, which can also be a bit longer}, \textsc{Author of the work}, 2010, No Copyright]{Title of the work} \label{fig:some-label}
\end{figure}
当我打印时,\listoffigures
出现了缩进。有什么方法可以消除这个问题吗?
平均能量损失(这是一个编辑链接,请随意尝试一下):
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[belowskip=-11pt,listformat=empty,labelsep=none,labelformat=empty]{caption}
\begin{document}
\begin{figure}[ht]
\centering
\includegraphics{example-image-a}
\caption[\textit{Title of the Work, which can also be a bit longer}, \textsc{Author of the work}, 2010, No Copyright]{Title of the work} \label{fig:some-label}
\end{figure}
\listoffigures
\end{document}
答案1
基于https://tex.stackexchange.com/a/186844/56823,解决方案如下:
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[belowskip=-11pt,listformat=empty,labelformat=empty]{caption}
\makeatletter
\renewcommand*\l@figure{\@dottedtocline{1}{0em}{0em}}
\makeatother
\begin{document}
\begin{figure}[ht]
\centering
\includegraphics{example-image-a}
\caption[\textit{Title of the Work, which can also be a bit longer}, \textsc{Author of the work}, 2010, No Copyright]{Title of the work} \label{fig:some-label}
\end{figure}
\listoffigures
\end{document}