Visitar URL original
cannot recognize equation numbers in Word · Issue #138 · jgm/texmath · GitHub
Skip to content

cannot recognize equation numbers in Word #138

Open

Description

@redstoneleo

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

Activity

  1. jgm commented on May 13, 2019

    @jgm
    Owner
  2. redstoneleo commented on May 13, 2019

    @redstoneleo
    Author

    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 .

  3. jgm commented on May 13, 2019

    @jgm
    Owner

    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.

  4. jgm commented on May 13, 2019

    @jgm
    Owner

    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?

  5. redstoneleo commented on May 14, 2019

    @redstoneleo
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions