From 037df8d57bede65b84cfc9b4c5846806fbf3ba2e Mon Sep 17 00:00:00 2001 From: TheFermion Date: Fri, 17 Nov 2023 17:19:13 +0530 Subject: [PATCH] Improved the LaTeX and PDF arguments (#135) * Change LaTeX export extension from .latex to .tex * fix: latex and pdf arguments Fixed the following arguments: 1. Removed the redundant `--embed-resources` and `--standalone` arguments for PDF export 2. Added `--extract-media="${outputDir}"` for the LaTeX export for proper extraction of images. --- src/export_templates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/export_templates.ts b/src/export_templates.ts index be44fa2..9b5a6f5 100644 --- a/src/export_templates.ts +++ b/src/export_templates.ts @@ -58,7 +58,7 @@ export default { name: 'PDF', type: 'pandoc', arguments: - '-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } --embed-resources --standalone -s -o "${outputPath}" -t pdf', + '-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -s -o "${outputPath}" -t pdf', customArguments: '--pdf-engine=pdflatex', optionsMeta: { 'textemplate': 'preset:textemplate', // reference from `PresetOptionsMeta` in `src/settings.ts` @@ -93,7 +93,7 @@ export default { name: 'Latex', type: 'pandoc', arguments: - '-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -s -o "${outputPath}" -t latex', + '-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } --extract-media="${outputDir}" -s -o "${outputPath}" -t latex', optionsMeta: { 'textemplate': 'preset:textemplate', // reference from `PresetOptionsMeta` in `src/settings.ts` },