Skip to content

jackdondy/bib_modifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BibTeX Modifier

Project Functionality

This project modifies .bib files with the following key functionalities:

  1. Remove unused entries and sort: Remove unused entries and sort the remaining ones according to the citation order in a given .aux file.
  2. Journal name conversion: Replace journal names with their string definitions based on IEEEfull.bib; for journals not included in IEEEfull.bib, apply word abbreviations using the ITWA file.
  3. Title protection: Add extra braces around citation titles to prevent BibTeX from automatically converting text to lowercase.
  4. Date update: Extract publication dates from local PDF files using the Everything search tool and automatically update the year and month fields of citations.

Example

 @inproceedings{gopalakrishnan2019robust,
-  title={Robust wireless fingerprinting via complex-valued neural networks},
+  title={{Robust wireless fingerprinting via complex-valued neural networks}},
   author={Gopalakrishnan, Soorya and Cekic, Metehan and Madhow, Upamanyu},
-  booktitle={2019 IEEE Global Communications Conference (GLOBECOM)},
+  booktitle={{Proc. IEEE Global Commun. Conf. (GLOBECOM)}},
   pages={1--6},
   year={2019},
   organization={IEEE}
 }

 @article{pham2016channel,
-  title={Channel estimation and data detection for insufficient cyclic prefix MIMO-OFDM},
+  title={{Channel estimation and data detection for insufficient cyclic prefix MIMO-OFDM}},
   author={Pham, Tri and Le-Ngoc, Tho and Woodward, Graeme K and Martin, Philippa A},
-  journal={IEEE Transactions on Vehicular Technology},
+  journal=IEEE_J_VT,
   volume={66},
   number={6},
   pages={4756--4768},
   year={2016},
   publisher={IEEE}
 }

Installation Guide

Step 1: Create a Conda Environment

We recommend using Conda to manage dependencies. Follow these steps to create and activate the environment:

# Create the environment
conda create -n bib_modifier python=3.12 conda-forge::pypdf2
conda activate bib_modifier
git clone https://github.com/jackdondy/bib_modifier.git

Step 2: Install Everything Command-Line Interface (Optional)

The script optionally uses the Everything search tool to find PDF files.

  1. Download, install Everything, and make sure it is running.
  2. Download the Everything CLI, ensure the CLI executable (es.exe) is accessible in your system's PATH or specify its path in the script.

Usage Instructions

Step 1: Prepare Input Files

You need the following files:

  1. IEEEfull.bib: A file containing IEEE journal abbreviation mappings.

  2. .aux file: Generated by your LaTeX project.

  3. Original BibTeX file: The reference file you want to update.

Step 2: Run the Script

Execute the script in your terminal:

python main_with_date_check.py
image

Note: The blue labels in the GUI are clickable and will automatically redirect to the corresponding URLs.

Specify file paths using the Browse button: Skip Date Check is the output path of the BibTeX file generated by this program. Set Skip Date Check to False if you want to search local PDF files to update the year and month fields of citations. Set ES Cmd Path to None to let the program use the system default Everything CLI path. You can test the default Everything CLI by typing es in the Windows command line.

After clicking the Save Config button, the program will generate a config.json file in the current folder, which will be automatically loaded on the next run.

Step 3.5: Date Update

If Skip Date Check is False, the Everything search tool will be invoked to locate PDF files. When processing PDF files, if any PDF file matching the citation name is found on the system, the program will output the following prompt in the command line:

-----------------press Enter for first result / input index to select a file / a new path / month and year like '2000 jun' / 'S' to skip / 'SS' to skip all / 'DD' to auto run all:

if found any .pdf files in your system that match the citation name, or

-----------------Input new path / month and year like '2000 jun' / 'S' to skip / 'SS' to skip all / 'DD' to auto run all:

if nothing was found. Follow the instructions to input. DD means the program auto deal with all citations, it will skip a citation if found nothing and use the first match if found any files. The program use PyPDF2.PdfReader to read the .pdf files and search for any strings like

VOL. 11, NO. 5, 1 MARCH 2024
VOL. 16, NO. 2, FEBRUARY 2017
date of current version 16 September 2022
date of current version July 16, 2021

Note that only the first page of .pdf will be searched.

Step 4: Output

The script will generate an updated BibTeX file at the specified path (new_bib_path).

Others

Welcome to contribute to this project, or report any issues and bugs.

About

a tool to modify .bib files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages