diff --git a/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py b/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py index ec90387..4e8d9ba 100644 --- a/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py +++ b/calibre-plugin/src/calibre_plugins/latexformulas_input/__init__.py @@ -96,9 +96,17 @@ def convert(self, stream, options, file_ext, log, accelerators): # call latex2mobi with markup output only from subprocess import check_output, STDOUT, CalledProcessError + args = [self.java_exec, '-jar', os.path.join(self.plugin_dir, JAR_FILENAME), '-i', stream.name, + '-n', '-o', dest_dir] + + from calibre_plugins.latexformulas_input.config import prefs + + if prefs['pandoc_exec'] != None and prefs['pandoc_exec'] != '': + args.append('-p') + args.append(prefs['pandoc_exec']) + try: - log.debug(check_output([self.java_exec, '-jar', os.path.join(self.plugin_dir, JAR_FILENAME), '-i', stream.name, - '-n', '-o', dest_dir], stderr=STDOUT)) # TODO pandoc exec argument if configured + log.debug(check_output(args, stderr=STDOUT)) except CalledProcessError as e: log.debug(e.returncode) log.debug(e.cmd) diff --git a/latex2mobi-converter/src/main/java/at/ac/tuwien/ims/latex2mobiformulaconv/app/Main.java b/latex2mobi-converter/src/main/java/at/ac/tuwien/ims/latex2mobiformulaconv/app/Main.java index 06cdc25..0c8536d 100644 --- a/latex2mobi-converter/src/main/java/at/ac/tuwien/ims/latex2mobiformulaconv/app/Main.java +++ b/latex2mobi-converter/src/main/java/at/ac/tuwien/ims/latex2mobiformulaconv/app/Main.java @@ -1,14 +1,9 @@ package at.ac.tuwien.ims.latex2mobiformulaconv.app; import at.ac.tuwien.ims.latex2mobiformulaconv.converter.Converter; -import at.ac.tuwien.ims.latex2mobiformulaconv.converter.html2mobi.AmazonHtmlToMobiConverter; import at.ac.tuwien.ims.latex2mobiformulaconv.converter.html2mobi.HtmlToMobiConverter; import at.ac.tuwien.ims.latex2mobiformulaconv.converter.latex2html.LatexToHtmlConverter; -import at.ac.tuwien.ims.latex2mobiformulaconv.converter.latex2html.PandocLatexToHtmlConverter; -import at.ac.tuwien.ims.latex2mobiformulaconv.converter.mathml2html.DOMFormulaConverter; -import at.ac.tuwien.ims.latex2mobiformulaconv.converter.mathml2html.FormulaConverter; import at.ac.tuwien.ims.latex2mobiformulaconv.utils.WorkingDirectoryResolver; - import org.apache.commons.cli.*; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration;