using Weave
open("finalreport.jmd", "w") do io
truncate(io, 0);
for line in eachline("./data/0.jmd")
write(io, line, "\n")
end
for line in eachline("./data/sec4.jmd")
write(io, line, "\n")
end
end
weave("finalreport.jmd"; doctype = "md2pdf", template = "main.tpl", latex_cmd = ["xelatex"])
The last line of code produced the error:
MethodError: no method matching latexinline(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Symbol)
Closest candidates are:
latexinline(::IO, !Matched::Markdown.LaTeX) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Markdown\src\IPython\IPython.jl:31
latexinline(::IO, !Matched::Markdown.Code) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Markdown\src\render\latex.jl:42
latexinline(::IO, !Matched::Array{T,1} where T) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Markdown\src\render\latex.jl:109
...
latex(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Markdown.Paragraph) at latex.jl:50
latex(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Array{Any,1}) at latex.jl:23
latex(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Markdown.MD) at latex.jl:19
sprint(::Function, ::Markdown.MD; context::Nothing, sizehint::Int64) at io.jl:105
sprint at io.jl:101 [inlined]
latex at latex.jl:170 [inlined]
clear_buffer_and_format!(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::typeof(Markdown.latex)) at common.jl:141
render_chunk(::Weave.WeaveLaTeX2PDF, ::Weave.DocChunk) at texformats.jl:28
_broadcast_getindex_evalf at broadcast.jl:648 [inlined]
_broadcast_getindex at broadcast.jl:621 [inlined]
getindex at broadcast.jl:575 [inlined]
macro expansion at broadcast.jl:932 [inlined]
macro expansion at simdloop.jl:77 [inlined]
copyto! at broadcast.jl:931 [inlined]
copyto! at broadcast.jl:886 [inlined]
copy at broadcast.jl:862 [inlined]
materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(Weave.render_chunk),Tuple{Base.RefValue{Weave.WeaveLaTeX2PDF},Array{Weave.WeaveChunk,1}}}) at broadcast.jl:837
render_doc(::Weave.WeaveDoc) at rendering.jl:22
weave(::String; doctype::String, informat::Nothing, out_path::Symbol, args::Dict{Any,Any}, mod::Nothing, fig_path::Nothing, fig_ext::Nothing, cache_path::String, cache::Symbol, template::String, css::Nothing, highlight_theme::Nothing, pandoc_options::Array{String,1}, latex_cmd::Array{String,1}, keep_unicode::Bool) at Weave.jl:223
(::Weave.var"#weave##kw")(::NamedTuple{(:doctype, :template, :latex_cmd),Tuple{String,String,Array{String,1}}}, ::typeof(weave), ::String) at Weave.jl:143
top-level scope at build_latex.jl:31
versions
using InteractiveUtils; versioninfo():
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = "C:\Users\liuwa\AppData\Local\atom\app-1.52.0\atom.exe" -a
JULIA_NUM_THREADS = 4
> `using Pkg; Pkg.status()`:
<!-- please paste the the output of `using Pkg; Pkg.status()` in the backticks below -->
```julia
Status `C:\Users\liuwa\.julia\environments\v1.5\Project.toml`
[c52e3926] Atom v0.12.25
[a93c6f00] DataFrames v0.21.8
[0c46a032] DifferentialEquations v6.15.0
[587475ba] Flux v0.11.1
[916415d5] Images v0.23.1
[a93385a2] JuliaDB v0.13.0
[e5e0dc1b] Juno v0.8.4
[a15396b6] OnlineStats v1.5.7
[429524aa] Optim v0.20.1
[91a5bcdd] Plots v0.28.4
[c3e4b0f8] Pluto v0.12.7
[44d3d7a6] Weave v0.10.6
function print_latex_table(table, caption, label, width)
println("\\begin{table}[htbp]
\\small
\\centering
\\caption{$caption}
\\begin{tabularx}$width
\\toprule ")
for i = 1:size(table, 1)
for j = 1:size(table, 2)
if i !== 1 && i !== size(table, 1)
if j !== size(table, 2)
print("$(table[i, j]) & ")
else
println("$(table[i, j]) \\\\")
end
elseif i ===size(table, 1)
if j !== size(table, 2)
print("$(table[i, j]) & ")
else
println("$(table[i, j]) \\\\ \\midrule")
end
else
if j !== size(table, 2)
print("\\bfseries{$(table[i, j])} & ")
else
println("\\bfseries{$(table[i, j])} \\\\ \\bottomrule")
end
end
end
end
println("\\end{tabularx}
\\label{$label}
\\end{table}")
end
function print_latex_table_v1(table, caption, label)
println("\\begin{table}[htbp]
\\small
\\centering
\\caption{$caption}
\\begin{tabularx}{\\textwidth}{*{$(size(table, 2))}{>{\\centering\\arraybackslash}X}}
\\hline ")
for i = 1:size(table, 1)
for j = 1:size(table, 2)
if i !== 1 && i !== size(table, 1)
if j !== size(table, 2)
print("$(table[i, j]) & ")
else
println("$(table[i, j]) \\\\")
end
elseif i ===size(table, 1)
if j !== size(table, 2)
print("$(table[i, j]) & ")
else
println("$(table[i, j]) \\\\ \\hline")
end
else
if j !== size(table, 2)
print("\\bfseries{$(table[i, j])} & ")
else
println("\\bfseries{$(table[i, j])} \\\\ \\hline")
end
end
end
end
println("\\end{tabularx}
\\label{$label}
\\end{table}")
end
function print_latex_figure(figure, caption, label, width)
println("\\begin{figure}[htbp]
\\centering
\\includegraphics[width=$width]{$figure}
\\caption{$caption}
\\label{$label}
\\end{figure}")
end
description
The last line of code produced the error:
versions
main.tpl
0.jmd
minimum reproducible steps