bibtool icon indicating copy to clipboard operation
bibtool copied to clipboard

extraction using "-x" and aux-file stuck

Open tutebatti opened this issue 4 years ago • 6 comments

Hello, using -x (or extract.file in a rsc-file), nothing happens. Verbose output via -v option shows as last line:

BibTool: Reading <stdin>

Am I missing something?

Thanks a lot!

tutebatti avatar Jan 12 '21 15:01 tutebatti

It appears that you have not specified any input file. In this case BibTool reads from the standard input stream...

ge-ne avatar Jan 12 '21 19:01 ge-ne

I provided an aux-file as written in the documentation: bibtool -x bib.aux -o extract.bib Alternatively, in a rsc-file: extract.file = {bib.aux} I understood that no additional bib-file as input is needed.

tutebatti avatar Jan 12 '21 20:01 tutebatti

Right. The input file(s) need to be given in the aux file. It must contain one or more \bibdata lines. In this case those files are read. Otherwise BibTool falls back to reading from stdin.

The \bibdata is written to the aux file by the LaTeX \bibliography macro

I am pretty sure that your aux file does not contain such lines.

ge-ne avatar Jan 12 '21 21:01 ge-ne

I suspect that this is a BiBTeX versus biber issue. I experienced the same problem, and indeed my .aux file does not contain any instances of \bibdata.

The good news is that the .bbl file that is generated by biber may be sufficient for most of the purposes one might want to generate a .bib file from an aux file. It will contain all the bibliographic data needed for all of the cited works.

jpgoldberg avatar Oct 03 '21 21:10 jpgoldberg

@jpgoldberg Thank you. Could you explain how exactly this helps in using the -x option of bibtool?

tutebatti avatar Mar 02 '22 18:03 tutebatti

biber itself can be used to do what you want. The command would be:

biber texfile --output-format bibtex

This assumes the LaTeX file is texfile.tex

This is tested for biber version 2.16

CodePurble avatar Oct 26 '22 05:10 CodePurble