added filter that allows svg img for pdf output

This commit is contained in:
Anson 2022-04-27 21:12:32 -07:00
parent 329e2b9fcc
commit aa1866c6c2
2 changed files with 14 additions and 0 deletions

11
filter.lua Normal file
View File

@ -0,0 +1,11 @@
function Image(el)
if FORMAT == "latex" then
-- convert svg to pdf
if string.sub(el.src, -4) == '.svg' then
local pdfName = string.gsub(el.src, "svg", "pdf")
pandoc.pipe('inkscape.exe', { el.src, '--export-filename', pdfName}, '')
el.src = pdfName
return el
end
end
end

View File

@ -16,6 +16,9 @@ bibliography: citations.bib
execute:
cache: true
filters:
- filter.lua
---
## Introduction