hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
310 stars 60 forks source link

ref and cite in doconce notebooks #101

Closed lrhgit closed 6 years ago

lrhgit commented 7 years ago

I have a problem with the rendering of citations (cite) and references to equations in python notebooks generated by doconce, e.g. https://github.com/lrhgit/uqsa_tutorials/blob/master/sensitivity_introduction.ipynb

The links in the references are pointing to the correct location, it is just the rendering that seems to be wrong. Examples: 1) The first citation in the Introduction section 2) The first equation ref in the section 'A simple linear model'. Here the link does not have the equation number.

Do I have to provide some options to 'doconce format ipynb my_file.do.txt' or is this a bug?

KGHustad commented 7 years ago

I think this may be a limitation in the Jupyter notebook format. It is possible that we may be able to create a workaround, but for now you will either have to use (non-interactive) HTML or avoid numeric references.

Btw, do note that notebook rendering on github.com is less thorough, so all equations are labeled with (1). If you instead use nbviewer, the rendering is much better and equations are labeled with increasing numbers.

https://nbviewer.jupyter.org/github/lrhgit/uqsa_tutorials/blob/master/sensitivity_introduction.ipynb

lrhgit commented 6 years ago

With the new nbextension we are almost there (jupyter nbextension enable equation-numbering/main)

The only thing remaining is that the cross-refs should be (\ref{eq_lbl}) rather than the current (ref(eq_lbl)). I hope this may be an easy fix in the "doconce format ipynb" parsing?

I needed I may provide a clean doconce-source, makefiles, resulting notebook and corrected notebook?

KGHustad commented 6 years ago

I don't think we need to use that extension since we already detect equations and assign them tags (1, 2, etc.) like LaTeX would. (Also, the notebook might not render correctly if the extension is not installed, so it's preferable not to depend on extensions.)

References to equations are just links, which jump to the correct position in the notebook when clicked. It seems that these links are still shown with the label instead of the equation number. I will fix this shortly.

KGHustad commented 6 years ago

If you're still seeing incorrect equation references, feel free to reopen this issue @lrhgit

lrhgit commented 6 years ago

Supert og takk for hjelpa. Har du pusha til conda? Eg har ikkje brukt github-versjonen i det siste.

lr

From: Kristian Gregorius Hustad notifications@github.com Reply-To: hplgit/doconce reply@reply.github.com Date: Wednesday, 6 June 2018 at 16:50 To: hplgit/doconce doconce@noreply.github.com Cc: Leif Rune Hellevik leif.r.hellevik@ntnu.no, Mention mention@noreply.github.com Subject: Re: [hplgit/doconce] ref and cite in doconce notebooks (#101)

If you're still seeing incorrect equation references, feel free to reopen this issue @lrhgithttps://github.com/lrhgit

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/hplgit/doconce/issues/101#issuecomment-395096577, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGVgUhQAu0rEkBCmZPlh4xD8ZO03QLhTks5t5-wygaJpZM4Lzo9W.