word将mathtype公式批量转为latex公式

最近,由于工作学习需要,要将word里面的mathype公式转为latex公式。
查了查资料,有alt+\的操作,这样太慢了。通过下面链接的操作,结合起来可以解决问题。

某乎:https://www.zhihu.com/question/532353646

csdn:https://blog.csdn.net/m0_52232795/article/details/130617795

某乎比较详细,但是配合csdn这个更好理解。

csdn这个经过操作之后,会发现,找不到mtEqToLatex()

因此,需要自己新建一个宏,代码如下

复制代码
Sub mtEqToLatex()
    Dim fd As Field
    Dim fw As Range
    Dim i As Long
    
    t0 = Now
    Set fw = Selection.Range
    If fw.Start = fw.End Then Exit Sub
    Application.ScreenUpdating = False
    
    For Each fd In fw.Fields
        If fd.Code Like "*EMBED Equation.*" Then
            fd.Select
            MathTypeCommands.MTCommand_TeXToggle
            i = i + 1
        End If
    Next
    
    fw.Select
    Application.ScreenUpdating = True
    Set fw = Nothing
    Set fd = Nothing
    Debug.Print DateDiff("s", t0, Now)
    MsgBox Format(i, "完成 共处理了0个公式")
End Sub
相关推荐
kyzoon11 小时前
LaTeX Tikz 绘图输出至图片
latex·tikz
恶猫16 小时前
Win|WinEdt( LaTeX 编辑器),下载及安装教程
windows·编辑器·latex·winedt
木头软件16 小时前
批量将 Word 文档重命名为其标题
开发语言·c#·word
CodeCraft Studio2 天前
国产化Word处理组件Spire.DOC教程:使用Python将文件自动化批量附加到 Word文档
python·自动化·word·spire.doc·文档自动化·word文档中添加附件·文档批量处理
东方佑2 天前
使用Python实现Word文档与JSON格式双向转换:完整教程与代码解析
python·json·word
wtsolutions2 天前
Sheet-to-Doc: Automate Document Generation with Excel Data and Word Templates
word·excel·wtsolutions
jayson.h2 天前
word宏批量插入.csv格式的附件
windows·word
大卡拉米2 天前
前端组件库 PDF、word、Excel预览
前端·pdf·word
m5655bj3 天前
使用 C# 设置 Word 段落对齐样式
开发语言·c#·word
TextIn智能文档云平台3 天前
如何将公司内部知识库(Word/PDF)接入大模型?
pdf·word