5 fname = 'build/latex/tesis.tex'
7 bib_re = re.compile(r'(\\begin{thebibliography}{[^}]+})'
9 r'(\\end{thebibliography})',
12 text = file(fname).read()
14 head, body, foot = bib_re.findall(text)[0]
20 .replace('\\bibitem', '\n\\bibitem')
25 text = bib_re.sub('\n'.join((head, body, foot)).replace('\\', '\\\\'), text)
28 file(fname, 'w').write(text)