mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-06-28 15:05:52 +00:00
feat: change to xelatex
This commit is contained in:
@@ -34,6 +34,7 @@ LABEL repo="https://github.com/C4illin/ConvertX"
|
||||
RUN apk --no-cache add \
|
||||
pandoc \
|
||||
texlive \
|
||||
texlive-xetex \
|
||||
texmf-dist-latexextra \
|
||||
ffmpeg \
|
||||
graphicsmagick \
|
||||
|
||||
@@ -21,7 +21,7 @@ A self-hosted online file converter. Supports 831 different formats. Written wit
|
||||
|------------------------------------------------------------------------------|---------------|---------------|-------------|
|
||||
| [libjxl](https://github.com/libjxl/libjxl) | JPEG XL | 11 | 11 |
|
||||
| [Vips](https://github.com/libvips/libvips) | Images | 45 | 23 |
|
||||
| [PDFLaTeX](https://www.math.rug.nl/~trentelman/jacob/pdflatex/pdflatex.html) | Documents | 1 | 1 |
|
||||
| [XeLaTeX](https://tug.org/xetex/) | Documents | 1 | 1 |
|
||||
| [Pandoc](https://pandoc.org/) | Documents | 43 | 65 |
|
||||
| [GraphicsMagick](http://www.graphicsmagick.org/) | Images | 166 | 133 |
|
||||
| [FFmpeg](https://ffmpeg.org/) | Video | ~473 | ~280 |
|
||||
|
||||
@@ -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}`);
|
||||
Reference in New Issue
Block a user