mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-03 03:24:35 +12:00
Fixes Pandoc PDF output error with unicode characters #117
This commit is contained in:
parent
230b034232
commit
dfed1e7ec9
|
@ -19,7 +19,7 @@ class PDF(abstractOutput):
|
||||||
name = "PDF"
|
name = "PDF"
|
||||||
description = qApp.translate("Export", "Needs latex to be installed.")
|
description = qApp.translate("Export", "Needs latex to be installed.")
|
||||||
InvalidBecause = qApp.translate("Export", """a valid latex installation. See pandoc recommendations on:
|
InvalidBecause = qApp.translate("Export", """a valid latex installation. See pandoc recommendations on:
|
||||||
<a href="http://pandoc.org/installing.html">http://pandoc.org/installing.html</a>""")
|
<a href="http://pandoc.org/installing.html">http://pandoc.org/installing.html</a>. If you want unicode support, you need xelatex.""")
|
||||||
icon = "application-pdf"
|
icon = "application-pdf"
|
||||||
|
|
||||||
exportVarName = "lastPandocPDF"
|
exportVarName = "lastPandocPDF"
|
||||||
|
@ -31,13 +31,15 @@ class PDF(abstractOutput):
|
||||||
}
|
}
|
||||||
|
|
||||||
def isValid(self):
|
def isValid(self):
|
||||||
path = shutil.which("pdflatex")
|
path = shutil.which("pdflatex") or shutil.which("xelatex")
|
||||||
return path is not None
|
return path is not None
|
||||||
|
|
||||||
def output(self, settingsWidget, outputfile=None):
|
def output(self, settingsWidget, outputfile=None):
|
||||||
args = settingsWidget.runnableSettings()
|
args = settingsWidget.runnableSettings()
|
||||||
args.remove("--to=pdf")
|
args.remove("--to=pdf")
|
||||||
args.append("--to=latex")
|
args.append("--to=latex")
|
||||||
|
if shutil.which("xelatex"):
|
||||||
|
args.append("--latex-engine=xelatex")
|
||||||
src = self.src(settingsWidget)
|
src = self.src(settingsWidget)
|
||||||
return self.exporter.convert(src, args, outputfile)
|
return self.exporter.convert(src, args, outputfile)
|
||||||
|
|
||||||
|
@ -50,4 +52,4 @@ class PDF(abstractOutput):
|
||||||
settingsWidget.writeSettings()
|
settingsWidget.writeSettings()
|
||||||
content = self.output(settingsWidget, outputfile=filename)
|
content = self.output(settingsWidget, outputfile=filename)
|
||||||
|
|
||||||
previewWidget.loadPDF(filename)
|
previewWidget.loadPDF(filename)
|
||||||
|
|
Loading…
Reference in a new issue