diff --git a/CHANGELOG.md b/CHANGELOG.md index ebb3576..efcb3a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.1 +## Breaking changes + +## Feature additions +* Add support for multiple BibTeX inputs + # v1.0 ## Breaking changes * LaTeX source files are now provided using the `-f/--files` option rather than diff --git a/TODO.md b/TODO.md index 42d7c18..19127d1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,4 @@ - [ ] Remove dependency on `ext.sh` -- [ ] Support multiple reference BibTeX files +- [x] Support multiple reference BibTeX files - [ ] Support a directory of reference BibTeX files - [x] Option to perform a dry-run (no file output, only print info to stdout) diff --git a/bibx b/bibx index db8fc16..115dd42 100755 --- a/bibx +++ b/bibx @@ -69,8 +69,8 @@ def get_parser(): "-b", "--bib", help="BibTeX file(s) to look for entries in", - # action="extend", - # nargs="+", + action="extend", + nargs="+", ) return parser @@ -110,14 +110,16 @@ def main(): while entry := en.readline(): e_set = e_set.union(entry) - parser = BibTexParser() - parser.ignore_nonstandard_types = False - with open(args.bib) as bibtex_file: - bib_database = bibtexparser.load(bibtex_file, parser) + e_dict = {} + for file in args.bib: + with open(file) as bibtex_file: + parser = BibTexParser() + parser.ignore_nonstandard_types = False + bib_database = bibtexparser.load(bibtex_file, parser) + curr_dict = bib_database.entries_dict + e_dict.update(curr_dict) - e_dict = bib_database.entries_dict out_db = BibDatabase() - found = 0 for entry in e_set: if entry in e_dict.keys(): diff --git a/debug.sh b/debug.sh new file mode 100755 index 0000000..9461da1 --- /dev/null +++ b/debug.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python -m pdb ./bibx -b test/p*.bib -f test/*.tex -d diff --git a/test/p1.bib b/test/p1.bib new file mode 100644 index 0000000..22b8749 --- /dev/null +++ b/test/p1.bib @@ -0,0 +1,20 @@ +@inproceedings{avi_dist_dwt_fpga_2015, + author = {Avinash, C.S. and Alex, John Sahaya Rani}, + booktitle = {2015 International Conference on Smart Technologies and Management for Computing, Communication, Controls, Energy and Materials (ICSTM)}, + doi = {10.1109/ICSTM.2015.7225436}, + number = {}, + pages = {326-330}, + title = {FPGA implementation of Discrete Wavelet Transform using Distributed Arithmetic Architecture}, + volume = {}, + year = {2015}, +} + +@inproceedings{mahajan2010efficient, + author = {Mahajan, Anurag and Mohanty, Basant K}, + booktitle = {2010 IEEE Asia Pacific Conference on Circuits and Systems}, + organization = {IEEE}, + pages = {1195--1198}, + title = {Efficient VLSI architecture for implementation of 1-D discrete wavelet transform based on distributed arithmetic}, + year = {2010}, +} + diff --git a/test/p2.bib b/test/p2.bib new file mode 100644 index 0000000..f3d9f2d --- /dev/null +++ b/test/p2.bib @@ -0,0 +1,18 @@ +@inproceedings{zhou_da_fir_fpga, + author = {Yajun Zhou and Pingzheng Shi}, + booktitle = {2011 International Conference on Multimedia Technology}, + doi = {10.1109/ICMT.2011.6003032}, + pages = {294-297}, + title = {Distributed Arithmetic for FIR Filter implementation on FPGA}, + year = {2011}, +} + +@article{shan1948, + author="Shannon, C.E.", + journal="The Bell Systems Technical Journal", + title="A Mathematical Theory of Communication", + year="1948", + volume="27", + pages="379-423, 623-656" +} +