fixed python3 bug

Need to escape all the \ in latex code in pdf_titles.py for python3.
Should still work in python2