默认类别中的图形/表格列表book
如下:
默认外观:
List of Figures 1.1 Snapshots .................. 2 1.2 Snapshots .................. 4 1.3 Snapshots .................. 6 2.1 Snapshots .................. 12 2.2 Snapshots .................. 23 2.3 Snapshots .................. 32
我想要调整的是:
List of Figures Figure 1.1 Snapshots .................. 2 Figure 1.2 Snapshots .................. 4 Figure 1.3 A very long caption: blabla blabla blabla .............. 6 % skip = 1em Figure 2.1 Snapshots .................. 12 Figure 2.2 Snapshots .................. 23 Figure 2.3 Snapshots .................. 32
- 按章节对图表进行分组,略微跳过
1 em
- 在每个条目前添加
Figure
或。Table
那么如何实现这一点呢?
更新 1:
使用 Werner 的代码,和Figure
被Table
附加到 LOT、LOF 条目的开头,但是标题没有对齐,如何解决这个小问题?
相似的:
答案1
默认
book
做在每章之间的 LoF 和 LoT 中插入一个间隙。请参阅章节制作宏book.cls
:\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne \if@mainmatter \refstepcounter{chapter}% \typeout{\@chapapp\space\thechapter.}% \addcontentsline{toc}{chapter}% {\protect\numberline{\thechapter}#1}% \else \addcontentsline{toc}{chapter}{#1}% \fi \else \addcontentsline{toc}{chapter}{#1}% \fi \chaptermark{#1}% \addtocontents{lof}{\protect\addvspace{10\p@}}% Insert gap in LoF \addtocontents{lot}{\protect\addvspace{10\p@}}% Insert gap in LoT \if@twocolumn \@topnewpage[\@makechapterhead{#2}]% \else \@makechapterhead{#2}% \@afterheading \fi}
如果您希望将其更改为
1em
,则可以使用etoolbox
进行修补\@chapter
,或者,不使用软件包,复制 的定义\@chapter
并将\addvspace
长度替换为1em
。以下是etoolbox
修补程序:\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox \makeatletter % \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>} \patchcmd{\@chapter}{10\p@}{1em}{}{}% for List of Figures \patchcmd{\@chapter}{10\p@}{1em}{}{}% for List of Tables \makeatother
在 LoF 和 LoT 条目前分别添加
Figure
和Table
,可以参见以下类似讨论在算法列表中的每个条目前添加“算法”一词:\documentclass[oneside]{book} \newcommand{\myfig}{\begin{figure}\caption{A figure caption}\end{figure}} \newcommand{\mytab}{\begin{table}\caption{A table caption}\end{table}} \let\oldlistoffigures\listoffigures \let\oldlistoftables\listoftables \renewcommand{\listoffigures}{% \begingroup% \let\oldnumberline\numberline% \renewcommand{\numberline}{\figurename~\oldnumberline}% \oldlistoffigures% \endgroup}% \renewcommand{\listoftables}{% \begingroup% \let\oldnumberline\numberline% \renewcommand{\numberline}{\tablename~\oldnumberline}% \oldlistoftables% \endgroup}% \begin{document} \listoffigures \listoftables \chapter{A chapter}\myfig\mytab\myfig\mytab\myfig\mytab \chapter{A chapter}\myfig\mytab\myfig\mytab\myfig\mytab \chapter{A chapter}\myfig\mytab\myfig\mytab\myfig\mytab \chapter{A chapter}\myfig\mytab\myfig\mytab\myfig\mytab \chapter{A chapter}\myfig\mytab\myfig\mytab\myfig\mytab \end{document}