Giter Site home page Giter Site logo

Comments (18)

dcroce avatar dcroce commented on June 30, 2024

Is it possible that MathJax needs updating? If so where can I do that?

from jupyter-book.

choldgraf avatar choldgraf commented on June 30, 2024

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.

ian-r-rose avatar ian-r-rose commented on June 30, 2024

I'm not sure what could be causing the rendering issues here.
This is where MathJax is configured in JupyterLab.

from jupyter-book.

Carreau avatar Carreau commented on June 30, 2024

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.

Carreau avatar Carreau commented on June 30, 2024

Same for 14.4, it thinks |...| is a table which screw up the HTML and thus mathjax.

from jupyter-book.

choldgraf avatar choldgraf commented on June 30, 2024

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.

Carreau avatar Carreau commented on June 30, 2024

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.

choldgraf avatar choldgraf commented on June 30, 2024

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.

choldgraf avatar choldgraf commented on June 30, 2024

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.

Carreau avatar Carreau commented on June 30, 2024

You may be able to tell Jekyll to use redcarpet instead of Kramdown.

from jupyter-book.

choldgraf avatar choldgraf commented on June 30, 2024

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.

Carreau avatar Carreau commented on June 30, 2024

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.

choldgraf avatar choldgraf commented on June 30, 2024

haha yep that sounds like markdown to me ;-)

from jupyter-book.

choldgraf avatar choldgraf commented on June 30, 2024

@dcroce it looks like all of the issues you describe are because of markdown auto-formatting of in-line equations. Could you try:

  1. Make sure every block equation has $$ around it.
  2. 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.

dcroce avatar dcroce commented on June 30, 2024

Alright I will see if that makes the difference.

from jupyter-book.

dcroce avatar dcroce commented on June 30, 2024

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.

choldgraf avatar choldgraf commented on June 30, 2024

@dcroce could you go into more detail on what you mean by "different from the ipynbs"? :-)

from jupyter-book.

dcroce avatar dcroce commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.