【发布时间】:2013-12-03 17:35:16
【问题描述】:
我有以下带有嵌入式 LaTeX 方程的 Markdown 片段:
# Fisher's 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 ).
$$
当我用 pandoc 将它转换为 LaTeX 并用 xelatex 编译它时,我得到了预期的文本,并带有很好的数学渲染。当我使用 pandoc 将其转换为 MS Word 时使用
pandoc test.text -o test.docx
并在 MS Office Word 2007 中打开它,我得到以下信息:
只有那些是符号或直立文本的方程部分才能正确呈现,而斜体的变量名会被方框中的问号替换。
我怎样才能做到这一点?
【问题讨论】:
-
您的输入适用于我在 Mac OS X 上使用 pandoc 1.12.2。您可以发布您获得的 word 文件的链接吗?这是我的:fileswap.com/dl/wajeArZq4c
-
@mb21 感谢您的回复!如果我在 Word 中打开,您的 docx 看起来与我的相同。所以这可能是我复制/安装 Word 的问题,而不是文件的问题。顺便提一句。我找到了一个解决方法:我可以将 Word 中的公式显示切换为“线性”,然后再切换回“专业”,所有符号都会出现。 – 这是我的:dl.dropboxusercontent.com/u/14431931/test.docx
-
哦,这就是你的文档在我的 Mac 上的 Word 副本上的样子:share.pho.to/4J6al 我想这可能有助于使用最新版本的 pandoc...
-
@mb21 啊,不,那只是刚刚犯了一个错误;我省略了最后一个“$$”。我已更新文件,请重试。
-
啊,现在看起来和我的一样。当所选字体没有该字符时,通常会出现这些问号。你有没有安装字体
Cambria Math?