Skip to content

Instantly share code, notes, and snippets.

View geektoni's full-sized avatar

Giovanni De Toni geektoni

View GitHub Profile
@lucainnocenti
lucainnocenti / bibitem-sorter.py
Last active December 13, 2023 06:17
Python script to sort the bibitem entries according to the citation order in the text. Useful when one has for some reason to not use bibtex and .bib files. Usage is as `python bibitem-sorter.py file.tex sorted_file.tex`
import argparse
import os
import sys
import re
def printBold(msg):
HEADER = '\033[95m'
BOLD = '\033[1m'
print(HEADER + BOLD + msg + '\x1b[0m')