JunoLab / Weave.jl

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

Process unicode non-math text in jmd #213

Open Oblynx opened 5 years ago

Oblynx commented 5 years ago

I'm writing a .jmd in Greek in Unicode and want to produce only tex output, as piece of a larger latex report. I do this with doctype= "md2tex". However, in the tex output all the unicode characters are assumed to be math symbols and are enclosed in \ensuremath.

The relevant LOC is this: https://github.com/mpastell/Weave.jl/blob/c9a814759dba764931582f7dc91e0d92633a7e4d/src/format.jl#L285

In my case, it seems I can get away with simply commenting out this line. But I guess there should be a more general solution, maybe with a parameter asking if we want unicode in the tex output or not. Maybe the reason for this behavior was to make the tex2pdf parser work; didn't test that :)

sebastianpech commented 4 years ago

I have this problem as well. Decided on fixing it directly in Highlights.jl with an improved version of the escape function, that is aware of which symbol needs to go into a math env. and which doesn't. See: #236 and JuliaDocs/Highlights.jl#30