Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/pandoc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function pandoc2pdf(formatted::AbstractString, doc::WeaveDoc, outname::AbstractS

@info("Done executing code. Running xelatex")
try
cmd = `pandoc -f markdown+raw_tex -s --pdf-engine=xelatex --highlight-style=tango
engine_cmd = get_pandoc_version() > "2.0.0.0" ? "--pdf-engine" : "--latex-engine"
cmd = `pandoc -f markdown+raw_tex -s $engine_cmd=xelatex --highlight-style=tango
$filt $citeproc $pandoc_options
--include-in-header=$header_template
-V fontsize=12pt -o $outname`
Expand Down Expand Up @@ -124,3 +125,12 @@ function run_latex(doc::WeaveDoc, outname, latex_cmd = "xelatex")
return false
end
end

"""
`get_pandoc_version()`

Returns a string containing pandoc's version number
"""
function get_pandoc_version()
match(r"pandoc (?<version>[\d.]+)\n", read(`pandoc --version`, String))["version"]
end