scholdoc
scholdoc copied to clipboard
Internal reference to an equation does not work in docx
A minimal example:
~~~math #firstequation
\frac{\partial C}{\partial t} = \nabla \cdot \left( \nu \nabla C \right ),
~~~
See equation (#firstequation).
converted to docx with
scholdoc test_minimal.md -o test_minimal.docx
does not produce the equation number nor the internal reference to equation (1) in the docx file. Converting to tex works fine.
Yes, it's currently like this because I'm still heavily researching how to implement some of the Scholdoc features in the DOCX writer. Note that this is mentioned in the last line of the Scholdoc homepage.
For numbered math, the biggest issue currently is how to completely support something like the LaTeX align
environment, where we can preserve alignment within a multiline expression while still also having all the numbering also lined up independently. Typically the way to get all equation numbers to line up on the page is to use tab stops or fixed-width table cells to anchor their positions. However, we do not have these mechanisms if we want alignment within a multiline expression (e.g., at the =
signs) while still wanting to number each line independently. As far as I can tell, the most feasible way would require us to determine manually the vertical position of the numbering. However, this would require knowing a-priori the exact height of each line in the expression, which is something I don't know how to do yet.
If you're familiar with OOML and want to help, I can post some of the current notes I have on this topic. I'll use this issue as a tracker for this feature.
I see, thanks for the clarification.
I agree that supporting LaTeX align
-like environment in docx is required. I'm not very familiar with OOML, but I can take a look if you point me to the issue.
That said, would it be possible to implement an early version of equation numbering without the multiline support? I seems like that would be sufficient for many forms of academic writing and render scholdoc usable for such tasks, while the generic implementation is being developed.
I seems like that would be sufficient for many forms of academic writing and render scholdoc usable for such tasks, while the generic implementation is being developed.
Yes, I've been planning to do this for a while now as part of an overhaul of the DOCX writer, but I just don't have the time to do it yet, and I've been busy trying to graduate. I'm not all that familiar with OOML as well, but I have collected some resources and help on this matter. I'll just need a day or two of uninterrupted time to get into the headspace of untangling OOML, and then I'll tackle both math and float output support when I'm there.