mirror of https://github.com/mpastell/Weave.jl
Add citeproc filter to pandoc, fixes #50
parent
38d3b04363
commit
1a54d6a557
|
@ -16,7 +16,6 @@ function pandoc2html(formatted::AbstractString, doc::WeaveDoc, outname::Abstract
|
|||
|
||||
#Header is inserted from displayed plots
|
||||
header_script = doc.header_script
|
||||
#info(doc.header_script)
|
||||
|
||||
if header_script ≠ ""
|
||||
self_contained = []
|
||||
|
@ -24,6 +23,14 @@ function pandoc2html(formatted::AbstractString, doc::WeaveDoc, outname::Abstract
|
|||
self_contained = "--self-contained"
|
||||
end
|
||||
|
||||
if haskey(doc.header, "bibliography")
|
||||
filt = "--filter"
|
||||
citeproc = "pandoc-citeproc"
|
||||
else
|
||||
filt = []
|
||||
citeproc = []
|
||||
end
|
||||
|
||||
#Change path for pandoc
|
||||
old_wd = pwd()
|
||||
cd(doc.cwd)
|
||||
|
@ -32,6 +39,7 @@ function pandoc2html(formatted::AbstractString, doc::WeaveDoc, outname::Abstract
|
|||
|
||||
try
|
||||
pandoc_out, pandoc_in, proc = readandwrite(`pandoc -R -s --mathjax="" --highlight-style=tango
|
||||
$filt $citeproc
|
||||
--template $html_template -H $css_template $self_contained
|
||||
-V wversion=$wversion -V wtime=$wtime -V wsource=$wsource
|
||||
-V headerscript=$header_script
|
||||
|
@ -66,9 +74,18 @@ function pandoc2pdf(formatted::AbstractString, doc::WeaveDoc, outname::AbstractS
|
|||
cd(doc.cwd)
|
||||
html =""
|
||||
|
||||
if haskey(doc.header, "bibliography")
|
||||
filt = "--filter"
|
||||
citeproc = "pandoc-citeproc"
|
||||
else
|
||||
filt = []
|
||||
citeproc = []
|
||||
end
|
||||
|
||||
info("Done executing code. Running xelatex")
|
||||
try
|
||||
pandoc_out, pandoc_in, proc = readandwrite(`pandoc -R -s --latex-engine=xelatex --highlight-style=tango
|
||||
$filt $citeproc
|
||||
--include-in-header=$header_template
|
||||
-V fontsize=12pt -o $outname`)
|
||||
println(pandoc_in, formatted)
|
||||
|
|
Loading…
Reference in New Issue