选择 \listoffigures 生成的图形列表的子集?

选择 \listoffigures 生成的图形列表的子集?

我想生成一组手动选择的图形的目录样式列表 - 即捕获的列表的子集\listoffigures

虽然我显然可以打开.lof文件本身,但我想保留列表中的动态引用(以与 相同的结果样式\ref{})。该.lof文件对图表的页码进行了硬编码。

(该问题的实际用例:我正在为印刷店汇编彩色图表清单,因此我手动编辑该清单以仅选择彩色图表。但我需要确保页面引用保持准确,否则他们会打印错误的彩色页面。)

答案1

\colorcaption以下是通过为每个彩色图形提供一个选项:

在此处输入图片描述

\documentclass{article}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
% See https://tex.stackexchange.com/q/113147/5764
\catcode`\#=12
\newcommand{\colorcaption}{%
  \patchcmd{\@caption}{\par}{%
    \par\addcontentsline{lcf}{#1}%
      {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}}{}{}\caption}%
\catcode`\#=6
\let\@oldstarttoc\@starttoc
\newcommand{\listofcolorfigures}{{%
  \renewcommand{\listfigurename}{List of Coloured Figures}%
  \renewcommand{\@starttoc}[1]{\@oldstarttoc{lcf}}\listoffigures}}
\makeatother
\begin{document}
\tableofcontents
\listoffigures
\listofcolorfigures
\section{A section}
\begin{figure}\caption{A figure}\end{figure}
\begin{figure}\colorcaption{A colour figure}\end{figure}
\begin{figure}\caption{Another figure}\end{figure}
\end{document}

这个想法是创建一个\colorcaption宏(用于彩色图形),其作用与 相同\caption,但还会将内容行插入到新的 ToC 文件中(扩展名为.lcf- 用于彩色图形l列表)。 配套宏的作用与 相同,只是它调用以生成彩色图形列表。cf\listofcolorfigures\listoffigures\@starttoc{lcf}

修补宏内的参数需要一些帮助,如所提供的修补宏内的参数

相关内容