Fixed LaTeX export for no wrapping setting

This commit is contained in:
Veronica K. B. Olsen
2019-10-28 10:15:05 +01:00
parent 11d2fe7491
commit 22d303c98e
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -36,6 +36,7 @@ class LaTeXFile(TextFile):
self.outFile = open(filePath,mode="wt+")
self.outFile.write("\\documentclass[12pt]{report}\n")
self.outFile.write("\\usepackage[utf8]{inputenc}\n")
self.outFile.write("\n")
self.outFile.write("\\begin{document}\n")
except Exception as e:
self.makeAlert(["Failed to open file.",str(e)], nwAlert.ERROR)
+3 -2
View File
@@ -110,12 +110,13 @@ class ToLaTeX(Tokenizer):
tText = tWrap.fill(tText)
# Then the text can receive final formatting before we append it to the results.
# We also store text lines in a buffer and merge them only when we find an empty line,
# We also store text lines in a buffer and merge them only when we find an empty line
# indicating a new paragraph.
if tType == self.T_EMPTY:
if len(thisPar) > 0:
self.theResult += begText
self.theResult += "%s\n" % tWrap.fill(" ".join(thisPar))
for tTemp in thisPar:
self.theResult += "%s\n" % tTemp
self.theResult += endText
thisPar = []