MyST-NB
MyST-NB copied to clipboard
🐛 FIX: Update priority for LaTeX output for html and latex builders
This PR increases the priority for text/latex representations for html and latex builders.
For html -- mathjax renders the text/latex representation more cleanly than typical images provided by some underlying packages (i.e. for png images) so promoted to be below image/svg+xml but above other image types.
For latex -- native latex syntax should be used in preference.
- [x] check if this PR fixes https://github.com/QuantEcon/lecture-python.myst/issues/95
- [x] fix fixtures (the
unknown mimtypefixture is removed as that test is current commented out in test_render_outputs.py)
I don't think latex should be above svg
Codecov Report
Merging #305 (37d949b) into master (2baade0) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #305 +/- ##
=======================================
Coverage 87.35% 87.35%
=======================================
Files 12 12
Lines 1368 1368
=======================================
Hits 1195 1195
Misses 173 173
| Flag | Coverage Δ | |
|---|---|---|
| pytests | 87.35% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| myst_nb/render_outputs.py | 86.79% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 2baade0...37d949b. Read the comment docs.
I don't think latex should be above svg
hey @chrisjsewell can you explain why? (i.e. page load times?) mathjax seems to do a nicer job of displaying the math. I am certainly open to demoting below svg but just want to understand why you think that is a better default priority.
For latex I think it certainly should be the highest output priority for native rendering.
Because svg is natively supported by HTML, latex is not
Because svg is natively supported by HTML, latex is not
roger that.
@chrisjsewell I see epub is listed as a builder in the builder option list.
Do you know if epub has a mechanism to support text/latex like mathjax for html?
Hmm -- I think epub uses mathml for math but also supports svg natively so another good reason to promote image/svg+xml. I guess the question is what happens if latex is passed before png.
Open to suggestions but perhaps we should:
- [ ] create a
defaultpriority forhtmlbased builders - [ ] create a
defaultpriority forepubbuilder (separate likeLaTeX)