feat: change to xelatex
This commit is contained in:
parent
10d20a8786
commit
fae2ba9c54
5 changed files with 16 additions and 9 deletions
|
|
@ -16,9 +16,9 @@ import {
|
|||
} from "./graphicsmagick";
|
||||
|
||||
import {
|
||||
convert as convertPdflatex,
|
||||
properties as propertiesPdflatex,
|
||||
} from "./pdflatex";
|
||||
convert as convertxelatex,
|
||||
properties as propertiesxelatex,
|
||||
} from "./xelatex";
|
||||
|
||||
import {
|
||||
convert as convertLibjxl,
|
||||
|
|
@ -63,9 +63,9 @@ const properties: {
|
|||
properties: propertiesImage,
|
||||
converter: convertImage,
|
||||
},
|
||||
pdflatex: {
|
||||
properties: propertiesPdflatex,
|
||||
converter: convertPdflatex,
|
||||
xelatex: {
|
||||
properties: propertiesxelatex,
|
||||
converter: convertxelatex,
|
||||
},
|
||||
pandoc: {
|
||||
properties: propertiesPandoc,
|
||||
|
|
|
|||
|
|
@ -127,9 +127,15 @@ export function convert(
|
|||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
): Promise<string> {
|
||||
// set xelatex here
|
||||
const xelatex = ["pdf", "latex"];
|
||||
let option = "";
|
||||
if (xelatex.includes(convertTo)) {
|
||||
option = "--pdf-engine=xelatex";
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(
|
||||
`pandoc "${filePath}" -f ${fileType} -t ${convertTo} -o "${targetPath}"`,
|
||||
`pandoc ${option} "${filePath}" -f ${fileType} -t ${convertTo} -o "${targetPath}"`,
|
||||
(error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(`error: ${error}`);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export function convert(
|
|||
.join("/")
|
||||
.replace("./", "");
|
||||
exec(
|
||||
`pdflatex -interaction=nonstopmode -output-directory="${outputPath}" "${filePath}"`,
|
||||
`latexmk -xelatex -interaction=nonstopmode -output-directory="${outputPath}" "${filePath}"`,
|
||||
(error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(`error: ${error}`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue