JunoLab / Weave.jl

Scientific reports/literate programming for Julia
http://weavejl.mpastell.com
MIT License
830 stars 96 forks source link

Some unicode symbols in Julia code cause failed process #250

Open jessebett opened 5 years ago

jessebett commented 5 years ago

Having a code block with unicode symbols like or cause the latex compilation to break for both XeLaTeX and LuaLatex.

I tried following various stackoverflow about adding packages for unicode math or unicodex encodings into the latex template with no success.

How can I have the unicode symbols that are valid Julia code not break Weave?

┌ Warning: Error converting document to pdf. Try running latex manually
└ @ Weave ~/.julia/packages/Weave/UOxmI/src/pandoc.jl:121
ERROR: IOError: unlink: no such file or directory (ENOENT)
Stacktrace:
 [1] uv_error at ./libuv.jl:97 [inlined]
 [2] unlink(::String) at ./file.jl:781
 [3] #rm#9(::Bool, ::Bool, ::typeof(rm), ::String) at ./file.jl:261
 [4] rm at ./file.jl:253 [inlined]
 [5] run_latex(::Weave.WeaveDoc, ::String, ::String) at /Users/jesse/.julia/packages/Weave/UOxmI/src/pandoc.jl:123
 [6] #weave#16(::String, ::Symbol, ::Symbol, ::Dict{Any,Any}, ::Symbol, ::String, ::Nothing, ::String, ::Symbol, ::Bool, ::String, ::Nothing, ::Nothing, ::Array{String,1}, ::String, ::typeof(weave), ::String) at /Users/jesse/.julia/packages/Weave/UOxmI/src/Weave.jl:146
 [7] (::Weave.var"#kw##weave")(::NamedTuple{(:out_path, :doctype, :template, :latex_cmd),Tuple{Symbol,String,String,String}}, ::typeof(weave), ::String) at ./none:0
 [8] top-level scope at REPL[12]:1
caused by [exception 1]
failed process: Process(`lualatex -shell-escape writeup.tex -aux-directory ./jl_tQrZ2v -include-directory /Users/jesse/pensieve/csc2541-f19/A1/papers`, ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error at ./process.jl:525 [inlined]
 [2] read(::Cmd) at ./process.jl:412
 [3] read(::Cmd, ::Type{String}) at ./process.jl:421
 [4] run_latex(::Weave.WeaveDoc, ::String, ::String) at /Users/jesse/.julia/packages/Weave/UOxmI/src/pandoc.jl:114
 [5] #weave#16(::String, ::Symbol, ::Symbol, ::Dict{Any,Any}, ::Symbol, ::String, ::Nothing, ::String, ::Symbol, ::Bool, ::String, ::Nothing, ::Nothing, ::Array{String,1}, ::String, ::typeof(weave), ::String) at /Users/jesse/.julia/packages/Weave/UOxmI/src/Weave.jl:146
 [6] (::Weave.var"#kw##weave")(::NamedTuple{(:out_path, :doctype, :template, :latex_cmd),Tuple{Symbol,String,String,String}}, ::typeof(weave), ::String) at ./none:0
 [7] top-level scope at REPL[12]:1
korsbo commented 5 years ago

Latexify.jl has a function for converting unicode to latex commands. I'm not at all sure that this is relevant but I thought I'd mention it in case it helps.

jessebett commented 5 years ago

That's not going to help here because these are typsetting the code blocks which use (probably?) verbatim environments. So we're not trying to typeset julia code to math environment which is what Latexify is doing.