- Make the bib file portable. You can clone this repository when writing a conference abstract and thesis/dissertation.
- different styles in accordance with journal specifications
If you just want to use the bib file (e.g. writing a conference abstract),
- Clone this repository next to your .tex file, or simply copy the content of 'Refs.bib' to a file
- If not included, include the siunitx package for a proper and consistent rendering of the numbers and units. Add
\usepackage{siunitx}in the preamble of your tex file. 3. Specify in the .tex file:
\bibliographystyle{unsrt} % sort the references as they appear in the text
\bibliography{./references/Refs}You can format your own bib file with the format.py script.
It depends on bibtexparser module. We recommend to use it in a virtual Python environment:
python -m venv .venvand activate the virtual environment by sourcing the script <venv>/Scripts/Activate.ps1.
If you use pip, install the dependencies as:
python -m pip install --upgrade pip
pip install -r requirements.txtThen run the format script:
python format.pyThis tool features:
- Consistently sorts the keys 'title', 'author', 'journal', ... for all entries
- Sort the entries in alphabetical order
- Align indentation
- Recognize accented letters and convert to the LaTeX-conform syntax
If the conversion fails with a UnicodeDecodeError, make sure that the Python default encoding is set to UTF-8. The setting can be displayed by the following script:
import os
import sys
import locale
print(os.environ.get("PYTHONIOENCODING"))
print(sys.getdefaultencoding())
print(sys.getfilesystemencoding())
print(sys.stdout.encoding)
print(locale.getpreferredencoding())- If an auther's first name is abbreviated as
M.L., this will not be recognized as a name with two first name initials. Use the regex
(?<=\.)\w(?=\.)
in VS Code to find such cases and amend it to M. L..
- Abbreviation of journal names Journal --> J. Japanese --> Jpn.