Discussion:
aux2bib or similar to extract cited references for journal submission
(too old to reply)
Michael Friendly
2011-10-06 20:20:33 UTC
Permalink
Raw Message
[Env: Ubuntu linux, texlive distro]

I've been using a perl script, aux2bib, for the common task of preparing
an article for journal submission by reading a .aux
file, extracting all \citation s, and writing a new .bib file containing
only those items cited.

My version is an old one, bearing the header below. It has the bug
noted that commands defined in @PREAMBLE are not copied to the output
file, so I always have to do this manually. Is there some updated
version of this, or some other tool that accomplishes the same task
and does pay attention to @PREAMBLE ?

Google turned up the Ubuntu package bibtex2html (1.94-5), which seems
to have an aux2bib script, but I can't make it work:

euclid: /tmp # /usr/bin/aux2bib ellipses.aux
This is bib2bib version 1.94, compiled on Sat Feb 27 13:51:16 UTC 2010
Copyright (c) 1997-2001 Jean-Christophe Filliâtre and Claude Marché
This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)

Reading from standard input...

-- it just sits there waiting for something ....

################### my aux2bib #############
#!/usr/local/bin/perl -s
#
# take a latex AUX file and change the bibstyle to subset or
subset-nocomment
# depending on if the -c flag was given (-c means use comments), then rename
# the modified file to references.aux, run bibtex on it, rename the file
# references.bbl to references.bib and delete references.{aux,blg}. This
# results in a BibTeX file which can be shipped with the latex source of the
# paper. The \bibliography{} command in the latex file will need to be
changed
# to use the newly generated bibliography.
#
# assumes subset.bst and subset-nocomment.bst are in the input path
#
# V. Khera 07-AUG-1992
# ***@cs.duke.edu
#
# BUG: Preamble lines are not included in the new bib file
jon
2011-10-06 21:01:59 UTC
Permalink
Raw Message
Post by Michael Friendly
[Env: Ubuntu linux, texlive distro]
I've been using a perl script, aux2bib, for the common task of preparing
an article for journal submission by reading a .aux
file, extracting all \citation s, and writing a new .bib file containing
only those items cited.
My version is an old one, bearing the header below.  It has the bug
file, so I always have to do this manually.  Is there some updated
version of this, or some other tool that accomplishes the same task
what about bibtool?

cheers,
jon.
Michael Friendly
2011-10-11 14:58:02 UTC
Permalink
Raw Message
Post by jon
Post by Michael Friendly
[Env: Ubuntu linux, texlive distro]
I've been using a perl script, aux2bib, for the common task of preparing
an article for journal submission by reading a .aux
file, extracting all \citation s, and writing a new .bib file containing
only those items cited.
My version is an old one, bearing the header below. It has the bug
file, so I always have to do this manually. Is there some updated
version of this, or some other tool that accomplishes the same task
what about bibtool?
cheers,
jon.
Good suggestion. I found I could do what I want precisely using bibtool
with the following resource file, aux2bib.rsc


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Extract .bib entries from a .aux file, expanding @strings, including
@preamble
%
% Use as: bibtool -r aux2bib -x myfile.aux -o myfile.bib
%
resource {braces}
expand.macros = on
preserve.key.case = on
print.indent = 3
print.use.tab = on % default
print.comma.at.end = on
crossref.limit = 32
delete.field = abstract
w***@gmail.com
2017-05-02 20:07:35 UTC
Permalink
Raw Message
Post by Michael Friendly
[Env: Ubuntu linux, texlive distro]
I've been using a perl script, aux2bib, for the common task of preparing
an article for journal submission by reading a .aux
file, extracting all \citation s, and writing a new .bib file containing
only those items cited.
My version is an old one, bearing the header below. It has the bug
file, so I always have to do this manually. Is there some updated
version of this, or some other tool that accomplishes the same task
Google turned up the Ubuntu package bibtex2html (1.94-5), which seems
euclid: /tmp # /usr/bin/aux2bib ellipses.aux
This is bib2bib version 1.94, compiled on Sat Feb 27 13:51:16 UTC 2010
Copyright (c) 1997-2001 Jean-Christophe Filli�tre and Claude March�
This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)
Reading from standard input...
-- it just sits there waiting for something ....
aux2bib takes an auxfile as argument, but it also needs the bib file to compile the entries. The behavior you described usually appears when the bib files are missing.
Loading...