Created
September 22, 2014 07:43
-
-
Save ThomasA/7833b52350c2f8d21d6e to your computer and use it in GitHub Desktop.
I wrote this Python script as a "bridge" to generate a fake `.aux` file for use with xcite and Biblatex. It is a very crude attempt, but it worked for the case I needed it for. Run it as `python gen_dummy_bib.py document.bbl document_fake.aux`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
replace_count = 1 | |
infile = open(str(sys.argv[1]), 'r') | |
outfile = open(str(sys.argv[2]), 'w') | |
for line in infile: | |
if '\\entry' in line: | |
outfile.write(re.findall('\\\\entry\{[^{]+', line)[0].replace('entry', 'bibcite') + '{' + str(replace_count) + '}\n') | |
replace_count += 1 | |
infile.close() | |
outfile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment