Pandoc导出到docx中多字符变量名称中的空格 [英] Spaces in multi characters variable name in pandoc export to docx

查看:85
本文介绍了Pandoc导出到docx中多字符变量名称中的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Haskell程序,以将一些数学公式导出到 docx ,并且我注意到带有多个字符的变量名在每个字母之间都写有空白,我不理解为什么?

I'm writing a Haskell program to export some mathematics formula to docx and I have noted that variable names with multiple character are written with a blank white space between each letter and I don't understand why ?

我的基本代码是:

import Text.Pandoc
import Data.Map (fromList)
import qualified Data.ByteString.Lazy as B

main = do
  document <- writeDocx WriterOptions{ writerStandalone=False
                                     , writerReferenceDocx=Nothing
                                     , writerUserDataDir=Nothing
                                     , writerHighlight= False
                                     }  pandoc
  B.writeFile "document.docx" document

pandoc = Pandoc ( Meta {unMeta = fromList []})
                           [ Para  [Str "A small Math example"]
                           , Plain [Math InlineMath "A_e = var + 5"]
                           , HorizontalRule
                           ]

结果是:

我想得到:

我试图将定义方程式的字符串修改为

I tried to modify the string defining my equation to

Math InlineMath "A_e = {var} + 5"

但是它什么都没改变

我也尝试过:

Math InlineMath "A_e = \\{var\\} + 5"

但是它给出了:

您知道如何删除这些无聊的空白吗?

推荐答案

实际上是 texmath -> omml转换的格式(OMML是docx使用的xml格式).因此,您应该在此处发布错误.

It's actually texmath that takes care of the latex->omml conversion (OMML is the xml format that docx uses). So you should post a bug there.

这篇关于Pandoc导出到docx中多字符变量名称中的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆