拆分图表列表

拆分图表列表

我在论文开头积累了大量且相当笨重的图表列表,我想将该列表分成两部分。我想在前言中包含一个“主要”图表列表,在附录的开头包含另一个列表。第二个列表应该只包括附录中的任何图表。

我找到了一些例子,详细说明如何隐藏附录中的数字,但没有描述如何在以后的工作中列出它们。

有任何想法吗?

谢谢!

答案1

这可以很容易地在titletoc包及其部分列表的功能;\startlist,,\printlist\stoplist想法是有两个部分列表;第一个列表在附录之前停止,此时第二个列表开始;一个小例子:

\documentclass{book}
\usepackage{graphicx}
\usepackage{titletoc}

\newcommand\myfigure{% just to quickly generate captioned images in the document
  \begin{figure}
  \centering
  \includegraphics[height=2cm]{example-image-a}
  \caption{test figure~\thefigure}
  \end{figure}%
}

\begin{document}

\startlist[main]{lof}% starts main list of figures
\printlist[main]{lof}{}{\chapter*{List of Figures in Main Part}}% prints main list of figures

\mainmatter
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure

\appendix
\clearpage
\stoplist[main]{lof}% stops main list of figures

\startlist[appendix]{lof}% starts list of figures in appendices
\printlist[appendix]{lof}{}{\chapter*{List of Figures in 
Appendices}}% prints list of figures in appendices

\chapter{Test appendix one}
\myfigure
\myfigure
\myfigure

\chapter{Test appendix two}
\myfigure
\myfigure
\myfigure

\end{document}

主列表的图片:

在此处输入图片描述

附录中图像列表的图像:

在此处输入图片描述

无需额外的软件包,只需多做一点工作即可完成;现在的想法是\ext@figure仅在附录的开头进行更改(控制写入图形标题信息的辅助文件的扩展名),并通过以类似于标准的方式定义的新命令来获得新的图形列表\listoffigures;当新的章节开始时\@chapter,需要10pt在新列表中使用默认间距():

\documentclass{book}
\usepackage{xpatch}
\usepackage{graphicx}

\makeatletter
\newcommand\listofappfigures{%
  \renewcommand\ext@figure{lfa}%
   \renewcommand\listfigurename{List of Figures in Appendices}%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lfa}%
    \if@restonecol\twocolumn\fi
    }
\xpatchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{\addtocontents{lot}{\protect\addvspace{10\p@}}\addtocontents{lfa}{\protect\addvspace{10\p@}}}{}{}
\makeatother

\newcommand\myfigure{%
  \begin{figure}
  \centering
  \includegraphics[height=2cm]{example-image-a}
  \caption{test figure~\thefigure}
  \end{figure}%
}

\begin{document}

\listoffigures

\mainmatter
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\chapter{Test chapter one}
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure
\myfigure

\appendix

\listofappfigures

\chapter{Test appendix one}
\myfigure
\myfigure
\myfigure

\chapter{Test appendix two}
\myfigure
\myfigure
\myfigure

\end{document}

相关内容