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)
- 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
- Plotly interactive plots not showing in Jupyter book HOT 2
- Plotly interactive plots not showing in Jupyter book HOT 4
- abtemIssue on page /intro.html HOT 1
- Problem with myst titles in jupyter notebook HOT 2
- When I compile Jupyter notebook with Sphinx I get a double colon `::` in the doc HOT 3
- Notebook %psource magic command not displaying HOT 1
- Adding github buttons on top navbar
- Adding `preamble` doesn't work because single-quote strings are not raw HOT 5
- Unable to change pygments_style in _config.yml HOT 2
- IPython.display.JSON object not rendered correctly HOT 2
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.