- 1
Does anyone know how to write LaTex files in Python?
I was writing a LaTex file in Python (for school). But when I opened the LaTex file, it had some weird symbols ( ĂĆ I think) instead of Ä that I wanted. I know its porbably a problem in encoding, but Python was written in utf-8, the file in python was open in utf-8 and LaTex was set to utf8. Does anynone have any idea what could be wrong?
2 Answers
+ 4
Sounds like an encoding issue... Perhaps your editor is set to open in another encoding?
Falling back to \v{c} etc is perhaps an option if you only need a few escaped characters or if you want to have real backwards compatibility with ancient systems...
+ 1
Yes. I tried yesterday to write the file without set encoding and it worked
I tried this and it didnt work:
with open(file, 'w', encoding='utf-8')
But this worked:
with open(file, 'w')