Created
January 17, 2014 05:49
-
-
Save katryo/8468975 to your computer and use it in GitHub Desktop.
Convert quotations for tex.
This file contains 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
if __name__ == '__main__': | |
left_double_quotation = '“' | |
right_double_quotation = '”' | |
single_quotation = '’' | |
result = str() | |
with open('word_to_tex.txt', 'r') as f: | |
for row in f: | |
row = row.replace(left_double_quotation, '``') | |
row = row.replace(right_double_quotation, "''") | |
row = row.replace(single_quotation, "'") | |
result += row | |
with open('eguide.tex', 'w') as f: | |
f.write(result) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment