Add config option to change MathJax renderer#1472
Add config option to change MathJax renderer#1472yihui merged 5 commits intorstudio:mainfrom bwu62:patch-1
Conversation
Not 100% sure, but based on a small amount of testing, I think this may render more neatly without sacrificing on portability or speed.
I noticed this when typesetting the formula for the sample standard deviation
`$$s=\sqrt{\frac1{n-1}\sum_{i=1}^n(x_i-\bar{x})^2}$$`
The default MathJax renderer of "Common HTML" "fakes" the square root top bar by using a border, which causes annoying misalignment with the radical symbol beside it. It also overall looks a bit more raggedy and not as pretty.
This small config change switches the default renderer to HTML+CSS (thanks @dennissxz for [the tip](jupyter-book/jupyter-book#1174 (comment))).
Seems to be a marginal improvement.
|
Thanks for suggesting this change; Changing default is always tricky, because it never comes without impact. It "fixes" the square root syntax you see, but does it break something else maybe ? Hard to test all possibly outcome. I don't know why exactly but we use So we should either make this easily customisable maybe, rather than changing default for everyone, which will change the equation looks for all bookdown book building out there. @yihui what do you think ? |
|
@cderv Thanks for the reply. I think that makes sense, having this as a nondefault option in the YAML is probably a better idea. Maybe we can also add an option for using SVG as the renderer? I'll work on this a bit later and propose another change if nobody beats me to it. |
yihui
left a comment
There was a problem hiding this comment.
I have no idea about the consequences of changing the default config here, so I don't have an opinion. I'm okay with either this PR or a new PR that makes it possible to customize the config or the whole mathjax URL. Thanks!
|
Added new
I'm sure other config options are possible but these are just the ones I've uncovered. Let me know if these look good to you guys or feel free to suggest further changes :) |
…r prettier output (see rstudio/bookdown#1472)
yihui
left a comment
There was a problem hiding this comment.
Sounds good to me. Could you add a news item to NEWS.md? Then we'll merge this PR. Thanks!
Added new math-jax config option to NEWS.md
|
Thanks @yihui for the approval. I've updated the NEWS.md. Let me know if there's anything else you need :) |
Not 100% sure, but based on a small amount of testing, I think this may render more neatly without sacrificing on portability or speed.
I noticed this when typesetting the formula for the sample standard deviation
$$s=\sqrt{\frac1{n-1}\sum_{i=1}^n(x_i-\bar{x})^2}$$The default MathJax renderer of "Common HTML" "fakes" the square root top bar by using a border, which causes annoying misalignment with the radical symbol beside it. It also overall looks a bit more raggedy and not as pretty.
This small config change switches the default renderer to HTML+CSS (thanks @dennissxz for the tip).
Seems to be a marginal improvement.