Extract bibliography entries from a reference BibTeX file using citations from LaTeX sources, to create project-specific BibTeX files.
For now, in order to work properly, both
bibx
andext.sh
NEED to be in the same directory. This is expected to change in a future release.
- Python >= 3.5
python-bibtexparser
Once you have installed the dependencies, clone this repository
git clone https://github.com/CodePurble/bibextract.git
Run install.sh
. By default, the files will be installed to /usr/local
.
sudo ./install.sh
A custom install prefix can be also be given
./install.sh my/custom/prefix
NOTE: To uninstall, use the provided
uninstall.sh
script. If you used a custom prefix while installing, make sure to use the SAME PREFIX when runninguninstall.sh
(e.g../uninstall.sh my/custom/prefix
)
First, navigate to where you initially cloned this repo and pull down the latest changes:
cd path/to/repo
git pull origin master
Then, rerun install.sh
. If you used a custom prefix the first time you
installed, use the same here as well for correctly updating the scripts.
Check the help-text:
bibx -h
Also read the manpage:
man bibx
Assume that there are two LaTeX files: a.tex
and b.tex
, the reference
BibTeX file is g.bib
and we want the output file to be refs.bib
. The
command to achieve this would be:
bibx -b g.bib -o refs.bib -f a.tex b.tex
# A variation
bibx -b g.bib -o refs.bib -f *.tex
If you find a bug or are facing some problem, please open an issue.
Contributions are welcome: features, documentation, whatever! Fork this repo and create a new branch for your changes, please do not commit directly to the master branch. Then create a pull-request.
Take a look at the TODO or issues for some inspiration!
If you are updating the manpage, you will need
pandoc
to generate it from
bibx.1.md
. Use the following command to generate the manpage:
pandoc --standalone --to man bibx.1.md -o bibx.1
If contributing to the code, please run the following test after your edits:
./bibx -b test/global.bib -o test/ext.bib -f test/*.tex
diff test/ext.bib test/ext-golden.bib
The diff
command must return NOTHING. This means that the output is as
expected for the given inputs.
Free use of this software is granted under the terms of the GPLv3 License.