eric7/QScintilla/Exporters/ExporterTEX.py

branch
eric7
changeset 8454
c679a3a80b7f
parent 8358
144a6b854f70
child 8522
4f263b89a293
diff -r 85d3ebd39e0b -r c679a3a80b7f eric7/QScintilla/Exporters/ExporterTEX.py
--- a/eric7/QScintilla/Exporters/ExporterTEX.py	Fri Jul 02 17:43:19 2021 +0200
+++ b/eric7/QScintilla/Exporters/ExporterTEX.py	Mon Jul 05 19:30:32 2021 +0200
@@ -223,7 +223,7 @@
                 )
                 f.write(
                     "Source File: {0}\n\n\\noindent\n\\tiny{{\n"
-                    .format(title))
+                    .format(title.replace('_','\\_')))
                 
                 styleCurrent = self.editor.styleAt(0)
                 f.write("\\eric{0}{{"
@@ -252,10 +252,10 @@
                     elif ch == b'\\':
                         f.write("{\\textbackslash}")
                     elif ch in [b'>', b'<', b'@']:
-                        f.write("${0}$".format(ch[0]))
+                        f.write("${0}$".format(ch.decode()))
                     elif ch in [b'{', b'}', b'^', b'_', b'&', b'$', b'#',
                                 b'%', b'~']:
-                        f.write("\\{0}".format(ch[0]))
+                        f.write("\\{0}".format(ch.decode()))
                     elif ch in [b'\r', b'\n']:
                         lineIdx = -1    # because incremented below
                         if (

eric ide

mercurial