Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[latex_formula_renderer] #276

Closed
bk322 opened this issue May 20, 2018 · 11 comments
Closed

[latex_formula_renderer] #276

bk322 opened this issue May 20, 2018 · 11 comments
Assignees

Comments

@bk322
Copy link

bk322 commented May 20, 2018

Does it support formula numbering and referencing numbered formula? For example sphinx supports :label: eqX and :eq:eqX http://www.sphinx-doc.org/en/master/ext/math.html#role-eq

@felixfontein
Copy link
Contributor

No, it doesn't. Formula numbering is something the plugins using this plugin (it only provides infrastructure for other plugins, nothing you can directly use as an end-user!) must do themselves.
What I could do is add support to include a number/label in the rendered output. But the numbering must be done by the calling plugin.

@felixfontein
Copy link
Contributor

@bk322: Does this answer your question? Do you need more information? Or are interested in having number/label support in the plugin?

@bk322
Copy link
Author

bk322 commented Jun 11, 2018

@felixfontein yes, it answers my question. I'm interested in having number/label support for equations on the ReST level. You say it should not be implemented on the level of this plugin. I believe plugins which support the numbering does not exist yet. If you know some -- I'd be grateful for links.

@ralsina
Copy link
Member

ralsina commented Jun 12, 2018

@bk322 I could add those roles as part of our sphinx compatibility plugins.

@felixfontein
Copy link
Contributor

@ralsina: Numbering the formulas requires state between different invocations of the same role in the same document. On the other hand, labeling is harder: this probably has to be a post-processing step after parsing the document (and before rendering the document to HTML), since label references can also appear before the label is defined, and has to be updated with the correct number.
I don't know enough about the ReST handling to comment on how hard this is and what else is required...

@ralsina
Copy link
Member

ralsina commented Jun 13, 2018

@felixfontein

  • State between invocations of the same role in the same document is not a problem
  • Label references are not a problem, worst case you end with a reference that points to something that doesn't exist.

I am going to take a shot during lunch right now.

@ralsina
Copy link
Member

ralsina commented Jun 13, 2018

Done in 84ecbad

@ralsina
Copy link
Member

ralsina commented Jun 13, 2018

Of course I have no idea what Sphinx actually does with that syntax but what my version does is:

  • If you use a label option in a math block, the 1st equation in that block will have that id.
  • If you use the eq role then it will create a link to that equation

@ralsina
Copy link
Member

ralsina commented Jun 13, 2018

Closing since it seems nobody needs to do anything else?

@ralsina ralsina closed this as completed Jun 13, 2018
@felixfontein
Copy link
Contributor

@ralsina In Sphinx, the result is supposed to look like in these screenshots: sphinx-doc/sphinx#2122 (comment) How does it look like in your code? I don't see where/how the number is generated or inserted.

@ralsina
Copy link
Member

ralsina commented Jun 14, 2018

@felixfontein number is not visible, it just adds an anchor with whatever is put in :label: and :eq: creates a link to that.

I don't really care about these things being visually identical to sphinx, mostly about them doing sensible things and accepting the same input.

Adding a displayed numbered label is trivial if it's really important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants