This tool processes .bib files by wrapping capital letters in specified words or phrases with curly braces {} to ensure that the capital letters in these words are not automatically downcased when generating references in LaTeX.
- Automatically wraps capitalized letters in specified words or phrases with
{}to preserve capitalization in LaTeX. - Supports both all-uppercase and title-case words.
- Allows customization through a separate file containing the words or phrases that need capitalization preservation.
- Processes only the
titlefields of the.bibentries. - The modified content is written to a new
.bibfile with_modifiedappended to its filename.
- Python 3.x
You can quickly run the script with:
python converter.pyThis will process the default .bib file (test.bib) and the default formatted words file (formatted_words.txt), then generate a new .bib file (test_modified.bib).
-b,--bib: Path to the input.bibfile. Default istest.bib.-w,--words: Path to the file containing formatted words or phrases. Default isformatted_words.txt.
python converter.py -b your_bib_file.bib -w formatted_words.txtThe formatted_words.txt file contains words or phrases for capitalization preservation. You can customize it to suit your own needs. The version included in the repository is just an example/template and can be modified as needed.