2010-11-19 24 views
0

我想知道是否有簡單的方法來提取一個乳膠文件的標題與他們是從數字的數字。 例如,如果我有3個數字在我的乳膠文件中定義的,我需要創建一個文件與這些數字的標題,例如,製作字幕頁

Fig. 1. Caption of Fig. 1 
Fig. 2. Another caption 
Fig. 3. Yet another caption 

是否有這樣做使用乳膠的方法嗎?或者我應該與其他程序一起做? 我有幾個數字,所以我不想一個接一個地提取字幕,因爲我必須手動編號。

解決方案。 我解決了這個問題。我使用另一個文件來包含數字列表並分別處理它們。我包括在該文件中包含的數字修改的列表如下

{\renewcommand*\numberline[1]{Fig.\,#1:\space} 
\makeatletter 
\renewcommand*\[email protected][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} 

我正在使用不同於文章的類,因此我需要在auxiliar文件中複製一些重新定義。將file.lof重命名爲這個新文件,這樣乳膠就可以找到它,它將完成這項工作。我把所有這些放在一個腳本中,現在它自動運行。 Hth。

+1

[TeX.StackExchange.com](http://tex.stackexchange.com/) – 2010-11-19 12:44:26

回答

1

\listoffigures控制順序可能對您有所幫助。

+0

我需要類似的東西。我需要沒有頁碼和其他文件的列表。可能嗎? – adn 2010-11-19 08:50:54

+0

@adn:然後我建議使用perl腳本 – erenon 2010-11-19 10:03:05

+1

看看生成的.lof文件。從那裏提取信息很容易。 (您也可以重新定義在那裏使用的命令和\ input {yourfile.lof}) – 2010-11-19 17:52:51