我想知道是否有一种简单的方法来提取一个乳胶文件的标题以及它们来自的数字。例如,如果我在我的乳胶文件中定义了 3 个图形,我需要创建一个带有这些图形标题的文档,例如,
Fig. 1. Caption of Fig. 1
Fig. 2. Another caption
Fig. 3. Yet another caption
有没有办法使用乳胶做到这一点?还是我应该用其他程序来做?我有几个数字,所以我不想去一个一个地提取标题,因为我必须手动编号。
解决方案。 我解决了这个问题。我使用另一个文件来包含数字列表并分别处理它们。我包含的文件包含修改后的数字列表,如下所示
{\renewcommand*\numberline[1]{Fig.\,#1:\space}
\makeatletter
\renewcommand*\l@figure[2]{\noindent#1\par}
\makeatother
\listoffigures}
\include
然后,我用命令将它包含在原始文件中。然后它创建图形文件列表file.lof
,我使用该文件编译一个最小文件以分别生成图形列表。
\documentclass{article}
\usepackage{subfigure} % This avoids problems with subfigures captions
\usepackage{amsmath,amssymb} % I used math in my captions
\nofiles % This makes the aux and lof file not to be deleted
\begin{document}
\include{list} % Includes the same file as before
\end{document}
我使用了一个不同的类,而不是文章,因此,我需要在辅助文件中复制一些重新定义。将 重命名file.lof
为这个新文件,以便乳胶找到它并完成工作。我把所有这些都放在一个脚本中,现在它会自动运行。嗯。