Comments (18)
Is it possible that MathJax needs updating? If so where can I do that?
from jupyter-book.
I agree that MathJax is still a little bit buggy. Ideally I'd like to just replicate whatever MathJax logic is used in the Notebook / JupyterLab interfaces.
Perhaps @minrk or @ian-r-rose or @Carreau knows something about MathJax in the notebook?
I'm configuring and loading my MathJax here:
https://github.com/choldgraf/textbooks-with-jupyter/blob/master/_includes/mathjax.html
but it still only works sometimes (e.g., on the notebooks demo page)
from jupyter-book.
I'm not sure what could be causing the rendering issues here.
This is where MathJax is configured in JupyterLab.
from jupyter-book.
The last equation at the end is because the ... |s| ...
. It interprets the full paragraph as a table, and end up being the follwing html:
$</td>
--
| <td>s</td>
| <td>\le 1$ so that it converges.</td>
Thus mathjax does not find the math correctly. Try to deactivate the Markdown table extension ?
from jupyter-book.
Same for 14.4, it thinks |...|
is a table which screw up the HTML and thus mathjax.
from jupyter-book.
hmmmm....so I guess the question is: is it better to support more complete mathjax equations but mess up markdown tables, or vice versa...
from jupyter-book.
Well notebook does not support markdown table. So if you are doing table they won't render in notebook. You can still make raw html table...
So deactivating the table extension will still allow you to do table (but in raw html), and not screw up math.
The only drawback will be no table export in PDF.
Is markdown table even used in this book ?
from jupyter-book.
not in this book, but the point is be a generic "create any textbook with your jupyter notebooks" repository, so I don't want to preclude people from this functionality if I don't have to.
However, I think a solution is to disable markdown tables only for the pages that were converted from notebooks, that way the behavior is the same on both platforms.
from jupyter-book.
actually, I'm not sure if it's possible to disable table auto-generation in jekyll? seems like this is something built-in to kramdown...
from jupyter-book.
You may be able to tell Jekyll to use redcarpet instead of Kramdown.
from jupyter-book.
do you have any opinions on using one vs. the other? I'm a bit hesitant since I don't know what kinds of downstream effects that would have...
from jupyter-book.
do you have any opinions on using one vs. the other? I'm a bit hesitant since I don't know what kinds of downstream effects that would have...
I don't remember which is which. I had issue with both.
from jupyter-book.
haha yep that sounds like markdown to me ;-)
from jupyter-book.
@dcroce it looks like all of the issues you describe are because of markdown auto-formatting of in-line equations. Could you try:
- Make sure every block equation has
$$
around it. - Make sure every inline equation has
|
characters escaped with\
. So$P(|\bar{X}_n - \mu| \ge \epsilon)
becomes$P(\|\bar{X}_n - \mu\| \ge \epsilon)
?
from jupyter-book.
Alright I will see if that makes the difference.
from jupyter-book.
In addition to |, _ and * also needs to be escaped. That was able to fix all the errors I had, although it makes the textbook look different from the ipynbs. Thanks for the help!
from jupyter-book.
@dcroce could you go into more detail on what you mean by "different from the ipynbs"? :-)
from jupyter-book.
When opening the ipython notebook, the math shows up slightly different. For example the \ to escape the * will show up in the ipython notebook but on the textbook turns out as desired. There are other minor differences too. See 9.3 of the textbook and compare to the notebook for a specific example (New url is http://prob140.org/textbook/chapters/README)
from jupyter-book.
Related Issues (20)
- Bump Sphinx dependency to allow v. 6 and 7 HOT 1
- IPython.display with LaTeX does not render in book
- struggling with the {exercise} MyST directove HOT 2
- dirhtml-builder uses html-builder canonical link HOT 1
- Variable substitution does not work HOT 2
- Adding parse.myst_enable_extensions to _config.yml breaks callouts HOT 2
- figure image formats HOT 1
- Unnecessary "the" and broken URL in /start HOT 1
- Process to consolidate all chapters into 1 single PDF book HOT 2
- Issue on page /content/citations.html
- Sphinx config `navigation with keys` removes links to Github HOT 1
- Cannot generate tab-sets, tab items or anything from myst from within python code cell HOT 1
- Error: Couldn't find a Table of Contents file. HOT 5
- reference to the notebook interface in the doc is for nbclassic
- Move to application distribution model HOT 13
- MyST Evaluation fails: no running kernel found HOT 6
- Problem with Utterances HOT 1
- Change from unmaintained pyppeteer package to alternative for building PDF documents from book HOT 1
- Update boilerplate code to use main branch by default instead of master HOT 1
- Allow the same document in multiple chapters/sections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyter-book.