-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow configuring the separator used in numbering equations #12523
Conversation
I'm hesistant about adding new configuration values. What is the value proposition here, is it a broader request? A |
Understandable given the large number of existing configuration options. However, there are only 3 options for math (and We maintain very technical code documentation that is thousands of pages long and contains over 4000 equations across 16 chapters. Our convention (for decades) is to use Chapter.Section-Equation. Although this is something that can readily be done in LaTeX, Sphinx is limited in equation number formatting in HTML (other than the This feature would bring parity with LaTeX generation. Thanks. |
sphinx/config.py
Outdated
@@ -258,6 +258,7 @@ class Config: | |||
'math_number_all': _Opt(False, 'env', ()), | |||
'math_eqref_format': _Opt(None, 'env', frozenset((str,))), | |||
'math_numfig': _Opt(True, 'env', ()), | |||
'math_numsep': _Opt(None, 'env', frozenset((str,))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably makes sense to unconditionally use math_numsep
, and have a sensible default. If a user sets math_numsep
to None
or ''
, perhaps issue a warning/error, or silently use '.'
.
'math_numsep': _Opt(None, 'env', frozenset((str,))), | |
'math_numsep': _Opt('.', 'env', frozenset((str,))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented the requested default separator, added to the CHANGES, and updated the documentation.
Please can you also add an entry to CHANGES and documentation in A |
Thanks Thomas! A |
Subject: Sphinx configuration:
math_numsep
Feature or Bugfix
Purpose
Detail
math_numfig
andnumfig_secnum_depth > 0
, section number are included in the equation number. For example, Eq. 1.2.3 is the third equation in section 1.2.math_numsep
allows users to select a different separator between the section number and the equation number.math_numsep='-'
will result in numbering such as Eq. 1.2-3.Relates