Skip to content

Conversation

korsbo
Copy link
Owner

@korsbo korsbo commented Nov 1, 2019

This is a work in progress.

It adds a post-processing hook as a keyword argument that allows you to pass arbitrary functions which can modify the result just before it is outputted. It's a bit of a sledgehammer, but it has proven useful when I use Latexify for stuff that is automatically deployed to the web. In some cases, I have had to add additional escape characters or change the newline specification and this post-processing hook allows me to do that.

function post_processing(str)
    str = replace(str, raw"\\"=>raw"\newline")
    return str
end

latexify(something; post_processing = post_processing)

@korsbo korsbo changed the title Add post-processing hook. WIP: Add post-processing hook. Nov 1, 2019
@codecov
Copy link

codecov bot commented Nov 1, 2019

Codecov Report

Merging #83 into master will decrease coverage by 0.81%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
- Coverage   80.57%   79.76%   -0.82%     
==========================================
  Files          22       22              
  Lines         520      514       -6     
==========================================
- Hits          419      410       -9     
- Misses        101      104       +3
Impacted Files Coverage Δ
src/latexarray.jl 95.23% <100%> (-0.42%) ⬇️
src/latextabular.jl 82.6% <100%> (-1.4%) ⬇️
src/latexequation.jl 100% <100%> (ø) ⬆️
src/latexinline.jl 75% <100%> (-5%) ⬇️
src/latexalign.jl 52.63% <100%> (-6.46%) ⬇️
src/plugins/DiffEqBiological.jl 76.19% <100%> (-0.74%) ⬇️
src/latexify_function.jl 75% <66.66%> (-1.67%) ⬇️
src/latexraw.jl 75.86% <0%> (-3.45%) ⬇️

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 554f02e...2517aa6. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 79.303% when pulling 21a0fb3 on post_processing into 554f02e on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 79.303% when pulling 21a0fb3 on post_processing into 554f02e on master.

@korsbo korsbo marked this pull request as draft February 9, 2021 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants