Skip to content

Instantly share code, notes, and snippets.

View savkov's full-sized avatar

Sasho Savkov savkov

View GitHub Profile
@savkov
savkov / tex-conversions.py
Last active September 22, 2015 09:35 — forked from yourcelf/tex-conversions.py
Convert utf-8 encoded unicode characters to latex escape sequences. I use this for pre-processing bibtex exports from zotero. Usage: tex-conversions.py infile > outfile
# Obtained from http://code.activestate.com/recipes/252124-latex-codec/
latex_equivalents = {
0x0009: ' ',
0x000a: '\n',
0x0023: '{\#}',
0x0026: '{\&}',
0x00a0: '{~}',
0x00a1: '{!`}',
0x00a2: '{\\not{c}}',
0x00a3: '{\\pounds}',