mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-20 04:42:26 +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"
|
||||
description = qApp.translate("Export", "Needs latex to be installed.")
|
||||
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"
|
||||
|
||||
exportVarName = "lastPandocPDF"
|
||||
|
@ -31,13 +31,15 @@ class PDF(abstractOutput):
|
|||
}
|
||||
|
||||
def isValid(self):
|
||||
path = shutil.which("pdflatex")
|
||||
path = shutil.which("pdflatex") or shutil.which("xelatex")
|
||||
return path is not None
|
||||
|
||||
def output(self, settingsWidget, outputfile=None):
|
||||
args = settingsWidget.runnableSettings()
|
||||
args.remove("--to=pdf")
|
||||
args.append("--to=latex")
|
||||
if shutil.which("xelatex"):
|
||||
args.append("--latex-engine=xelatex")
|
||||
src = self.src(settingsWidget)
|
||||
return self.exporter.convert(src, args, outputfile)
|
||||
|
||||
|
@ -50,4 +52,4 @@ class PDF(abstractOutput):
|
|||
settingsWidget.writeSettings()
|
||||
content = self.output(settingsWidget, outputfile=filename)
|
||||
|
||||
previewWidget.loadPDF(filename)
|
||||
previewWidget.loadPDF(filename)
|
||||
|
|
Loading…
Reference in a new issue