Make a Captions Page
I want to know if there is an easy way to extract the captions of one latex file with the numbers of the figures they are from. For example if I hav开发者_如何学编程e 3 figures in defined in my latex file, I need to create a document with the captions of those figures, e.g.,
Fig. 1. Caption of Fig. 1
Fig. 2. Another caption
Fig. 3. Yet another caption
Is there any way of doing this using latex? or should I do it with other program? I have several figures, so I don't want to go and extract the captions one by one, because I have to number them manually.
Solution. I solve the problem with a work around. I use another file to include the list of figures and process them separately. The file that I included contains a modified list of figures as follows
{\renewcommand*\numberline[1]{Fig.\,#1:\space}
\makeatletter
\renewcommand*\l@figure[2]{\noindent#1\par}
\makeatother
\listoffigures}
Then, I include it in the original file with \include
command. Then it creates the list of figures file as file.lof
, I used that file to compile a minimal file to produce the list of figures separately.
\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}
I was using a different class, other than article, therefore, I need to copy some redefinitions in the auxiliar file. Rename the file.lof
to this new file, so latex find it and it will do the work. I put all this in a script and now it works automatically.
Hth.
The \listoffigures
control sequence may help you.
精彩评论