mirkobunse / critdd

Critical difference diagrams with Python and Tikz
https://mirkobunse.github.io/critdd
Other
21 stars 3 forks source link

Make escaping of underscores optional #6

Closed MatthiasJakobs closed 6 months ago

MatthiasJakobs commented 7 months ago

I had the usecase where some latex formulas were not rendered correctly due to escaping the underscore character. As a workaround, I propose to make the escaping optional, with it being turned on by default.

mirkobunse commented 7 months ago

Thanks for this PR!

The problem occurs whenever you add formulas to treatment names right, e.g. treatment $x_k$, right?

I'm wondering if a better solution was to change the regex such that it only escapes underscores outside of formulas, without any need for the user to choose whether underscores are escaped. What do you think?

MatthiasJakobs commented 6 months ago

Yes, I've encountered the problem when I wanted to have treatment names such as Method$_{p=0.5}$, Method$_{p=0.6}$ etc. I think your proposed solution should get rid of that problem (and for most cases in which you would want to escape underscores, for that matter).

mirkobunse commented 6 months ago

Thanks for your feedback! This feature is now merged into the main branch with PR #7