LaTeX: Add math_numsep support to latex builder - #12652
Conversation
jfbu
left a comment
There was a problem hiding this comment.
I checked separate chunks now I need to revisit the whole LaTeX file to make sure this does not break some at-this-time not seen constraints.
There was a problem hiding this comment.
LGTM with nits.
With
latex_theme = 'howto'
# latex_toplevel_sectioning = 'part'
numfig = True
math_numfig = True
numfig_secnum_depth = 1
math_numsep = "-"
there is a problem in the output with prefixed dots. This problem goes away if the suggested change above is merged. But even with the suggested change, then if we uncomment the latex_toplevel_sectioning line a new problem arises that the separator is used but there is nothing before it.
(I had a bit forgotten the numfig and numfig_secnum_depth things which are bit complex in sphinx.writers.latex.)
I see how to address the issue I raised via somewhat scary hack to get rid of an extra prefixed dot. (We would then use it also for chapter) Maybe you will come out with simpler way to address raised difficulty which would be better for long term maintenance.
I have pushed some own code which fixes the issues I had. Ideally some test should be modified so what we can check that for example using edit: both done in later commit. |
|
Ready to go. I don't think it is worthwile to add a (but maybe some CHANGES update when it gets merged after 8.0.0) Edit: On further thoughts I will add a latex doc as it seems necessary to explain what to do if string for html is not suitable for latex. |
|
@thfanning I have merged master, removed the disabling in preamble, and prepared CHANGES.rst for 8.1.0 release. Are you ok with current state of this PR? We could add a |
math_numsep support to latex builder.math_numsep support to latex builder.
math_numsep support to latex builder.math_numsep support to latex builder
|
Thanks for contribution! |
Subject:
math_numsepsupport in LaTeX builderFeature or Bugfix
Purpose
math_numsepsupport to latex builder.Detail
math_numsepdefines the text separator to use between section numbers and equation numbers.\renewcommand{\theequation}{\thesection-\arabic{equation}}, but this is not viable due to the complexity in Sphinx's numbering.Relates