Skip to content

[downloadnb-comparison] different numbering system for math tags and their citations in contexts #66

Closed
QuantEcon/sphinx-tojupyter
#30

Description

@shlff

Hi @mmcky , I noticed that in all MYST notebooks/website lectures:

  • math tags and their citations in context use two different kinds of numbering systems.

For example, please find a screenshot for lecture 03_sir_model (left: RST, right: MYST):

Screen Shot 2021-01-27 at 10 11 10 pm

Activity

  1. mmcky commented on Feb 2, 2021

    @mmcky
    Contributor

    Does the new numbering system match the html version?

  2. shlff commented on Feb 2, 2021

    @shlff
    MemberAuthor

    Thanks @mmcky . In the MYST-version notebooks (please see the right side of the screenshot above),

    • the numbering system for citations in the contexts matches the MYST-version html files (e.g., the (3.2) as I circled),
    • the numbering system for math expressions does not match the MYST-version html files (e.g., the (2) as I circled).
  3. mmcky commented on Feb 8, 2021

    @mmcky
    Contributor

    ohh - thanks @shlff I see the real issue here now.

    I suspect that sphinx-tojupyter is using its own numbering when writing \tag{} as we did in jupinx rather than using the internal sphinx values.

  4. self-assigned this
    on Feb 8, 2021
  5. mmcky commented on Feb 25, 2021

    @mmcky
    Contributor

    @AakashGfude just trying to replicate the tag numbering that must be done by sphinx-multitoc-numbering.

    Can you point me to where these values for refid are constructed. Are they part of a transform and you generate these nested numbers?

    > /Users/matthewmckay/repos-collab/sphinx-tojupyter/sphinx_tojupyter/writers/translate_all.py(321)visit_math_block()                                   
    -> referenceBuilder = " \\tag{" + str(node["number"]) + "}\n"
    (Pdb) node.pformat()
    '<math_block docname="numpy" ids="equation-np-polynom" label="np_polynom" nowrap="False" number="1" xml:space="preserve">\n    p(x) = a_0 + a_1 x + a_2 x^2 + \\cdots a_N x^N = \\sum_{n=0}^N a_n x^n\n'
    (Pdb) c
    > /Users/matthewmckay/repos-collab/sphinx-tojupyter/sphinx_tojupyter/writers/translate_all.py(612)depart_reference()
    -> refid = node["refid"]
    (Pdb) node.pformat()
    '<reference internal="True" refid="equation-np-polynom">\n    (9.1)\n'
  6. mmcky commented on Feb 25, 2021

    @mmcky
    Contributor

    Just wondering where I might be able to get the chapter or value 9 in the above example from in the sphinx configuration

  7. mmcky commented on Feb 26, 2021

    @mmcky
    Contributor

    @shlff this build in PR #43 should be using the latest sphinx-tojupyter.

    https://6038cc9d13761dc1d83bf515--nostalgic-wright-5fa355.netlify.app/intro.html

    Can you check this issue and close it if resolved?

  8. reopened this on Feb 26, 2021
  9. shlff commented on Mar 10, 2021

    @shlff
    MemberAuthor

    Great thanks for your hard-working @mmcky and @AakashGfude .

    I can confirm that this issue has been solved and will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions