制作字幕页
我想知道是否有一种简单的方法可以提取一个乳胶文件的标题及其来源的数字。 例如,如果我在乳胶文件中定义了 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
重命名为这个新文件,以便 Latex 找到它并完成工作。我把所有这些都放在一个脚本中,现在它会自动运行。 哈。
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 have 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
\listoffigures
控制序列可能会帮助您。The
\listoffigures
control sequence may help you.