Pandoc-generated docx skips italic variables in equations

I have the following Markdown segment with built-in LaTeX equations:

# Fisher linear discriminant

\newcommand{\cov}{\mathrm{cov}}
\newcommand{\A}{\mathrm{A}}
\renewcommand{\B}{\mathrm{B}}
\renewcommand{\T}{^\top}

The first method to find an optimal linear discriminant was proposed by Fisher
(1936), using the ratio of the between-class variance to the within-class variance
of the projected data, $d(\vec x)$, as a criterion. Expressed in terms of the
sample properties, the $p$-dimensional centroids $\bar {\vec x}_\A$ and
$\bar {\vec x}_\B$ and the $p \times p$ covariance matrices
$S_A = \cov_i ( \vec x_{\A i} )$ and $S_B = \cov_i ( \vec x_{\B i} )$, the
optimal direction is given by 
$$
\vec w = \left ( \frac{ S_A + S_B }{2} \right ) ^{-1}
~ ( \bar {\vec x}_\B - \bar {\vec x}_\A ).
$$

When I convert it from pandoc to LaTeX and compile it with xelatex, I get the expected text with beautifully displayed math. When I convert it from pandoc to MS Word using

pandoc test.text -o test.docx

and open it in MS Office Word 2007, I get the following:

word screenshot

Only those parts of the equations that are symbols or vertical text are rendered correctly, and the variable names in italics are replaced by a question mark in the field.

How can I do this job?

0
source share
3 answers

Word 2007 , , , " ", .

, .

, , XML, ,

  • Math Cambria Math
  • run (w: rPr) XML, Cambria Math (w: r) oMath , oMath, . oMath, , XML . , ( , , ...)
  • XML , . , , .

Word 2010 , , , Word 2007. , w: r , , . , / , - XML, , , .zip(, fontTable.xml styles.xml). XML XML, , , - , .

, , rPr , Word 2007, , pandoc Word 2010, 2007. ( ).

,

<m:r>
  <m:t>(</m:t>
</m:r>

<m:r>
  <w:rPr>
    <w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math" />
  </w:rPr>
  <m:t>(</m:t>
</m:r>
+1

, Windows Lucida Grande, Math Font Cambria Math .

  • test.docx test.zip
  • vim test.zip test/word/settings.xml
  • Lucida Grande Cambria Math
  • zip docx. - this docx.

docx pandoc - reference-docx.

+1

, :

  • .
  • .
  • .
+1

Source: https://habr.com/ru/post/1542657/


All Articles