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

cannot recognize equation numbers in Word #138

Open
redstoneleo opened this issue May 13, 2019 · 5 comments
Open

cannot recognize equation numbers in Word #138

redstoneleo opened this issue May 13, 2019 · 5 comments

Comments

@redstoneleo
Copy link

redstoneleo commented May 13, 2019

cannot recognize equation numbers in Word

Tested with command:
E:\pandoc.exe -s 2.docx -t markdown-smart --wrap=none -o example35.md
File:2.docx

@jgm
Copy link
Owner

jgm commented May 13, 2019 via email

@redstoneleo
Copy link
Author

redstoneleo commented May 13, 2019

I don't understand why you said "it is out of scope for now".
I found a solution, and let's take 1+1=2 with equation number (8) as an example .
Currently, pandoc just converts it to

$$\begin{matrix}
1 + 1 = 2\#\left( 8 \right) \\
\end{matrix}$$

In order to get the right result , we just need to replace \#\left( 8 \right) \\ with \tag{8}. I am sorry I cannot contribute more .

@jgm
Copy link
Owner

jgm commented May 13, 2019

I said "out of scope" because pandoc currently doesn't have a way of handling equation numbers and cross-refs. But I agree, converting this to \tag{8} or just ignoring it completely would be better than the current output, and both are feasible.

@jgm
Copy link
Owner

jgm commented May 13, 2019

Here's the xml for "1=2" with eqn number 1.

      <m:oMathPara>
        <m:oMath>
          <m:eqArr>
            <m:eqArrPr>
              <m:maxDist m:val="1"/>
              <m:ctrlPr>
                <w:rPr>
                  <w:rFonts w:ascii="Cambria Math" w:eastAsia="微软雅黑" w:hAnsi="Cambria Math"/>
                  <w:i/>
                  <w:sz w:val="24"/>
                  <w:szCs w:val="24"/>
                </w:rPr>
              </m:ctrlPr>
            </m:eqArrPr>
            <m:e>
              <m:r>
                <w:rPr>
                  <w:rFonts w:ascii="Cambria Math" w:eastAsia="微软雅黑" w:hAnsi="Cambria Math"/>
                  <w:sz w:val="24"/>
                  <w:szCs w:val="24"/>
                </w:rPr>
                <m:t>1=2
                </m:t>
              </m:r>
              <m:r>
                <w:rPr>
                  <w:rFonts w:ascii="Cambria Math" w:eastAsia="微软雅黑" w:hAnsi="Cambria Math"/>
                  <w:sz w:val="24"/>
                  <w:szCs w:val="24"/>
                </w:rPr>
                <m:t>#
                </m:t>
              </m:r>
              <m:d>
                <m:dPr>
                  <m:ctrlPr>
                    <w:rPr>
                      <w:rFonts w:ascii="Cambria Math" w:eastAsia="微软雅黑" w:hAnsi="Cambria Math"/>
                      <w:i/>
                      <w:sz w:val="24"/>
                      <w:szCs w:val="24"/>
                    </w:rPr>
                  </m:ctrlPr>
                </m:dPr>
                <m:e>
                  <m:r>
                    <w:rPr>
                      <w:rFonts w:ascii="Cambria Math" w:eastAsia="微软雅黑" w:hAnsi="Cambria Math"/>
                      <w:sz w:val="24"/>
                      <w:szCs w:val="24"/>
                    </w:rPr>
                    <m:t>1
                    </m:t>
                  </m:r>
                </m:e>
              </m:d>
            </m:e>
          </m:eqArr>
        </m:oMath>
      </m:oMathPara>

Very strange! It appears that there's no dedicated XML for the equation number, but rather some kind of convention so that whatever occurs after a run with just # is an equation number? Do I understand this correctly?

@redstoneleo
Copy link
Author

If I was correct , you would find the equation number after the last <m:t> tag.

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

2 participants