Difference between revisions of "Aux2bib"

From CUC3
Jump to navigation Jump to search
import>Csw34
 
import>Dw34
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
'''aux2bib''' is part of the bibtools package, which you can obtain [http://www.ctan.org/tex-archive/help/Catalogue/entries/bibtools.html here]. As you might be able to guess from the name, it takes a .aux file from a latex compilation and creates a new bib file called references.bib which contains only the entries required by the corresponding .tex file.
+
'''aux2bib''' is part of the bibtools package, which you can obtain [http://www.ctan.org/tex-archive/help/Catalogue/entries/bibtools.html here]. As you might be able to guess from the name, it takes a .aux file from a latex compilation and creates a new bib file called references.bib which contains only the entries required by the corresponding .tex file. In this case, I'm going to consider a tex files called FILE.tex located at ~/test/FILE.tex
   
Once you extract the perl scripts - you're pretty much good to go. All you need to do is make them executable using
+
Once you extract the perl scripts you need to make them executable using
 
<pre>
 
<pre>
 
chmod +x aux2bib
 
chmod +x aux2bib
 
</pre>
 
</pre>
  +
You also need to copy the style files the script uses to the directory containing your tex file. While in the bibtools directory,
 
  +
<pre>
  +
cp subset* ~/test
  +
</pre>
 
There is one possible issue that you could run into when your document uses multiple bib files. If you have the same reference in more than one of those bib files, bibtex will throw a warning. This isn't a problem for the latex compilation as it just continues, but the aux2bib script requires bibtex to exit flawlessly. A good way to check this is just to run bibtex yourself before aux2bib, i.e. for FILE.tex
 
There is one possible issue that you could run into when your document uses multiple bib files. If you have the same reference in more than one of those bib files, bibtex will throw a warning. This isn't a problem for the latex compilation as it just continues, but the aux2bib script requires bibtex to exit flawlessly. A good way to check this is just to run bibtex yourself before aux2bib, i.e. for FILE.tex
 
<pre>
 
<pre>
bibtex FILE
+
bibtex FILE.tex
 
</pre>
 
</pre>
 
should exit without ANY problems. If you do have multiple references, you can just delete one of the duplicates and all will be well.
 
should exit without ANY problems. If you do have multiple references, you can just delete one of the duplicates and all will be well.
   
 
After you've made references.bib, make sure you change its name to something more suitable and also change the bibliography environment in your .tex file to point at it!
 
After you've made references.bib, make sure you change its name to something more suitable and also change the bibliography environment in your .tex file to point at it!
  +
  +
'''NOTE: You may have problems running the script because of a 'bad interpreter'. This just means it can't find perl so just use'''
  +
<pre>
  +
perl aux2bib FILE.aux
  +
</pre>

Latest revision as of 07:18, 28 August 2008

aux2bib is part of the bibtools package, which you can obtain here. As you might be able to guess from the name, it takes a .aux file from a latex compilation and creates a new bib file called references.bib which contains only the entries required by the corresponding .tex file. In this case, I'm going to consider a tex files called FILE.tex located at ~/test/FILE.tex

Once you extract the perl scripts you need to make them executable using

chmod +x aux2bib

You also need to copy the style files the script uses to the directory containing your tex file. While in the bibtools directory,

cp subset* ~/test

There is one possible issue that you could run into when your document uses multiple bib files. If you have the same reference in more than one of those bib files, bibtex will throw a warning. This isn't a problem for the latex compilation as it just continues, but the aux2bib script requires bibtex to exit flawlessly. A good way to check this is just to run bibtex yourself before aux2bib, i.e. for FILE.tex

bibtex FILE.tex

should exit without ANY problems. If you do have multiple references, you can just delete one of the duplicates and all will be well.

After you've made references.bib, make sure you change its name to something more suitable and also change the bibliography environment in your .tex file to point at it!

NOTE: You may have problems running the script because of a 'bad interpreter'. This just means it can't find perl so just use

perl aux2bib FILE.aux