-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feature request: Improve equation number style in docx output #29
Comments
Thanks for this input, @shixuguo. For some time now I have wanted to improve the docx output for pandoc-eqnos and friends. I know that there is a lot of interest. However, I don't use docx myself, and am not nearly knowledgeable enough about OOXML or OMML. If you know about these things and can provide some testing support, then we can look into such an enhancement. What do you think? Your trial table code didn't work because the equation attributes need to be immediately adjacent to the equation itself. |
I also have little knowledge about OMML, but in China a lot of journals only accept docx. So I think it's a very helpful enhancement. I know in current design, equation attributes need to be immediately adjacent to the equation itself. |
I agree that this should be addressed. If you can help with testing that would be great. I will first need to review similar (incomplete) work done in pandoc-fignos and will get back to you. |
A quick note about this:
The attributes need to be immediately next to the equation. However, this does not mean that the equation number needs to go immediately next to the equation. Pandoc-eqnos writes custom TeX and html to position the equation number, for example. We need to do something similar for docx. This will involve figuring out what OOXML to write. |
I have created a wiki page to help organize a solution to this problem: https://github.com/tomduck/pandoc-eqnos/wiki/Development#docx-output |
This might be slightly off-topic since it's not about the style per se, but more about how the equations are internally defined. I can open another issue if you'd prefer. I'm enclosing a simple docx that contains one equation and one reference. The style might not be the best and I believe others use different formats. What is important here is that the bookmark has auto-numbering and it's listed as an "equation" and not a simple "bookmark". As a result, adding more equation to the document and updating using F9 will update all the equation numbers. (This applies to figures and tables as well, as referenced by the issues mentioned above). Looking at the xml, the part where the bookmark is defined is: <w:bookmarkStart w:name="_Ref18177439" w:id="1"/>
-<w:r>
<w:t xml:space="preserve">Equation </w:t>
</w:r>
-<w:r w:rsidR="00684D32">
<w:fldChar w:fldCharType="begin"/>
</w:r>
-<w:r w:rsidR="00684D32">
<w:instrText xml:space="preserve"> SEQ Equation \* ARABIC </w:instrText>
</w:r>
-<w:r w:rsidR="00684D32">
<w:fldChar w:fldCharType="separate"/>
</w:r>
-<w:r w:rsidR="00092964">
-<w:rPr>
<w:noProof/>
</w:rPr>
<w:t>1</w:t>
</w:r>
-<w:r w:rsidR="00684D32">
-<w:rPr>
<w:noProof/>
</w:rPr>
<w:fldChar w:fldCharType="end"/>
</w:r>
<w:bookmarkEnd w:id="1"/> The citation is : -<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
-<w:r>
<w:instrText xml:space="preserve"> REF _Ref18177439 \h </w:instrText>
</w:r>
-<w:r>
<w:fldChar w:fldCharType="separate"/>
</w:r>
-<w:r>
<w:t xml:space="preserve">Equation </w:t>
</w:r>
-<w:r>
-<w:rPr>
<w:noProof/>
</w:rPr>
<w:t>1</w:t>
</w:r>
-<w:r>
<w:fldChar w:fldCharType="end"/>
</w:r>
-<w:r>
<w:t xml:space="preserve"> </w:t>
</w:r>
<w:bookmarkStart w:name="_GoBack" w:id="0"/>
<w:bookmarkEnd w:id="0"/> I hope that can help. Thank you so much for your work! |
Thanks for this, @ebranlard. I am nearing completion of my work on version 2.0 of each filter. I expect to work on docx support this fall. It has been a long time in coming, mostly because it is difficult to determine what should actually be done (I am not a docx user). So, the info you have provided me will be most helpful. Cheers, |
It would look better using <m:eqArr> to numbering the equation. Here are sample files to show the difference in displaying the equation number. The equation part in the origin file is:
And, the equation part using the <m:eqArr> modifier goes like:
I am trying to create a custom filter based on the <m:eqArr> modifier. However, as a newbie to Python, it is a bit difficult for me... |
based on pandoc-eqnos, I can do some simple numbered work in converting markdown to docx.
however, the style in docx seems wrong.
in current style, the equation and number looks like below
where the equation and number are both in OMML, and there are two space between equation and number.
More common style for numbered equation is as below:
equation and number are in a three-column table.
equation is centered and number is right-aligned .
and the number should be plain text not in OMML.
I have tried code below:
and pandoc-eqnos failed.
The text was updated successfully, but these errors were encountered: