JunoLab / Weave.jl

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

Change tex escaping to tex comments #416

Closed nateybear closed 3 years ago

nateybear commented 3 years ago

Please see the minted documentation re. escadeinside (page 24):

Escaping does not work inside strings and comments (for comments, there is texcomments).

If escapeinside doesn't work in strings or comments, then must it not be valid Julia code? It seems weird that one would expect a LaTeX block that they escaped to also execute as Julia. We can handle unicode input just fine without having to type \alpha. We can set results = "tex" and programmatically build LaTeX output.

I'd argue the most important use case for escaping LaTeX inside of Julia code is in the comments. Why not take an opinionated stance? I personally see this as quite useful.

Until then, I can't use the head revision of Weave.jl because the pipe operator is escaped. This fixes it for me, and I think makes the whole thing a bit cleaner :)

codecov-io commented 3 years ago

Codecov Report

Merging #416 (849cc20) into master (10de105) will increase coverage by 0.12%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #416      +/-   ##
==========================================
+ Coverage   73.90%   74.03%   +0.12%     
==========================================
  Files          26       26              
  Lines        1353     1352       -1     
==========================================
+ Hits         1000     1001       +1     
+ Misses        353      351       -2     
Flag Coverage Δ
unittests 74.03% <ø> (+0.12%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/rendering/texformats.jl 84.90% <ø> (+0.94%) :arrow_up:
src/rendering/common.jl 89.15% <0.00%> (+1.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 10de105...849cc20. Read the comment docs.

nateybear commented 3 years ago

Should note that I've discussed this change with @JonasIsensee.

The failing test looks orthogonal to my change--it's a checksum failure on the julia-actions/setup-julia@v1 step. I'm new to GitHub CI, can we re-run the failing test?

aviatesk commented 3 years ago

I re-ran the tests. Will merge this once CI turns green.

aviatesk commented 3 years ago

Thanks @nateybear !