Comments (22)
I haven't yet tried it, but I can create a minimal example and give it a go :)
from jupyter-book.
I found my solution here -
for capital greek letters atom-community/markdown-preview-plus#336
for absolute sign yzhang-gh/vscode-markdown#318
@choldgraf Thanks for point out that it could be an issue with uncommon notation in markdown.
from jupyter-book.
I am interested in using jupyter-book to release interactive versions of my scientific papers, and without equation numbering I don't see how I would be able to do this.
from jupyter-book.
from jupyter-book.
Being able to referenced numbered equations, sub-sections of a book chapter, other chapters, or figures is a pretty important selling point for tool for book authors. It is very hard to write things when you have to keep going back to change the references (especially in the Jupyter cell based interface). I noticed that the Jupyter contributed extension "Table of Contents" appears to create dynamically updated section numbers in the authoring environment. Similarly, I wonder if there could be a "jupyter-book authoring tools" extension to jupyter that would handle these references and resolving the correct numbers, etc... all directly within in the jupyter interface. This would help authors a lot and would hybridize a wysiwg type authoring interface with one that is like latex.
from jupyter-book.
Hey @NatalieThurlby I think that this is actually going to be easier to fix in a new backend for Jupyter Book that we are working on - you can check it out here: beta.jupyterbook.org and the repository where we're working on it is here: https://github.com/ExecutableBookProject/cli I think that equation numbering should now work already! (https://beta.jupyterbook.org/use/math.html)
from jupyter-book.
yep - that does sound like the reason you're running into this issue. Jekyll is actually not doing any markdown parsing - that is all being done by nbconvert -> html, and jekyll just stitches the pages together (the reason we did this was to ensure that markdown -> html would behave the same as it does with jupyter notebooks).
from jupyter-book.
also, just to clarify what I mentioned above, most likely the current version of jupyter book will become a "legacy" version that doesn't get a ton of support. New features, bugfixes, etc will come to the new beta version that uses Sphinx. Just wanna give you a heads up about that
from jupyter-book.
good question! I believe we could pretty-easily get the MathJax configuration to number equations:
http://docs.mathjax.org/en/latest/tex.html#automatic-equation-numbering
That'd require us making it possible for people to specify their own mathjax configuration in the config.yml
file. I can see that taking two forms:
- We let people somehow override the default mathjax configuration entirely.
- We expose specific parameters that people can set themselves (e.g.
number_equations: true
)
what do you think?
re: your second point, that'd require us adding some new behavior to the markdown generation process, I believe!
from jupyter-book.
I am wondering if we can do something similar to the markdown extensions used by bookdown: https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#equations. Then all of the internal referencing is hooked up.
It looks like they have similar support for Figures with captions: https://bookdown.org/yihui/bookdown/figures.html
I haven't yet looked into how they are doing this under the hood - but worth checking out
from jupyter-book.
Hmmm - I think bookdown uses RMarkdown for its markup...we could use pandoc and achieve something similar (see #94 for example), but I'm not sure that we'd have the development bandwidth to implement our own custom markdown syntax. What do you think?
re: captions I think the same applies here. You could use pandoc to include things like captions etc. That said, what's the way that a person would express the caption contents etc when using a jupyter notebook. Cell metadata maybe?
from jupyter-book.
Yeah, I agree that we don't want to develop and maintain our own language. Restructured text + sphinx has this capability (e.g. Page on Maxwell's equations). Do you think that supporting rst content has significant overhead?
from jupyter-book.
nice! in that case, it's just a question of whether nbconvert can handle the conversion process. Have you tried using rST in a notebook w/ jupyter-book now? Does it not work?
from jupyter-book.
I am interested in utilizing equation numbering as well. Please let us know your findings as they become available, @lheagy.
from jupyter-book.
Am I facing a related problem -
I just uploaded a jupyter-book, and the math is not rendering properly. Additionally, note the weird table appearing at the bottom of the page
https://dhruvbalwada.github.io/SFM_notes/files/inertial_ranges_Kolmogrov.html
, which is not part of my md files, as far as I can tell. It is coming from using something like
from jupyter-book.
@dhruvbalwada hmm - that actually looks different, I bet there is some uncommon notation in there (not uncommon in mathematics, but probably uncommon in people using markdown with mathjax).
Could you try updating to the master branch and trying it again, by any chance? On master we're now converting the notebooks directly into HTML instead of converting them to Jekyll Markdown and then to HTML, which means that we should (theoretically) get the exact same experience as one would get using nbconvert.
from jupyter-book.
@choldgraf - I am not sure I understand your suggestion to update to the master branch. I only have one branch, which is the master branch. So all changes are made directly to it. Should I delete the _sites folder before uploading? I have been using the docker method to see the changes locally before updating, which creates the _sites folder.
The repo is here - https://github.com/dhruvbalwada/SFM_notes
P.S. - I am not a pro githubber.
from jupyter-book.
that's great to hear :-) Markdown + mathjax are notoriously finnicky especially for equation-heavy content like yours (which looks cool!)
from jupyter-book.
I think this is an awesome idea - would love to see some tooling in Jupyter Lab to improve authoring
from jupyter-book.
I'm thinking of trying to add the option figure captions as this would be useful for me. I'm trying to get a feel for where I might need to jump in to do this. Is the page_html() function used to convert markdown files as well as jupyter notebooks? If not, where are the .md files converted to html? Thank you!
EDIT: I've had a little bit more of a look now and it seems like it gets converted by jekyll. I'd really like it if it could work the same way as pandoc, ![Where this tag is the caption](url/of/image)
, but I'll see how much trouble that is...
from jupyter-book.
Hi @choldgraf Thanks, that looks interesting! I feel like I'm quite close to getting my solution to work, though. I am trying to use jekyll pandoc as the markdown converter for the jupyter book instead of kramdown.
I've tested jekyll-pandoc on a regular (non Jupyter Book) jekyll site and it's working as expected (it converts ![this bit](img.png)
to something including`
However, when I build + serve the jupyter book (jupyter-book build .
, make serve
), I can see that it's instead <img ... alt="this bit">
. I am trying to figure out what's happening by looking at build.py and page.py - is it that regular markdown files (such as features/markdown.md in the demo/minimal book), are exported to html by nbconvert rather than Jekyll?
As an experiment, if I run jekyll build
in the demo book directory, I get <figcaption>
in the _site directory, but if I run jupyter-book build, I get alt=
in the _build directory.
from jupyter-book.
Closing as this should be superceded by beta.jupyterbook.org
from jupyter-book.
Related Issues (20)
- Horizontal scrolling missing for itables within ipywidget tabs HOT 1
- Imprecise description of round on page /pages/data_types/coercion.html HOT 1
- Default Jupyter Book build web accessibility issues HOT 1
- code-cell using new/strange font -- how to revert to a fixed-width font? HOT 2
- Add feature in `_config.yml` to change sidebar logo URL HOT 1
- Error No such file or directory: '//anaconda3/bin/python' HOT 2
- sphinx==7.3 breaks builds HOT 2
- Issue on page /intro.html HOT 1
- Display math in admonition HOT 1
- AttributeError: 'EntryPoints' object has no attribute 'get' HOT 3
- Underscore in title doesn't get properly escaped for pdflatex build target, causing formatting errors HOT 1
- Issue on page /week2/DL_adaptLR.html HOT 1
- Issue on page /week2/DL_adaptLR.html HOT 1
- Can't build book on mac when folder name is not project name. HOT 1
- Dark mode doesn't properly style collapsed code blocks
- Fix analytics config remapping
- Upload to PyPI failed for 1.0.1 HOT 10
- Theme error HOT 1
- Jupylerbook HOT 1
- top left hamburger button not working HOT 6
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.