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
相关推荐
小羊没烦恼!1 小时前
微服务化的基石——持续集成
java·大数据·word·powerpoint·.net
Am-Chestnuts9 小时前
DeepSeek表格复制到Word变竖线错列?用DS随心转对比几种整理方法
人工智能·word·ds随心转
2501_930707783 天前
使用C#代码为新创建的 Word 文档创建目录
c#·word
SunnyDays10113 天前
Java 拆分 Word 文档教程:按页、分页符和分节符拆分
java·word·分页·拆分
chillylight4 天前
LaTeX 公式转 PNG / SVG:几种实用方案和使用场景对比
latex
copilot中国版4 天前
Word Copilot|一键提取文档关键信息,告别逐字阅读
word·copilot
天人合一peng6 天前
西北工业大学校外访问系统
word
古少侠6 天前
deepseek转word工具怎么选?DS随心转与4种方案对比实测
人工智能·word·powerpoint
小羊没烦恼!7 天前
Memory 记忆设计讨论:Agent Memory 的安全边界:权限、删除、版本与回执
java·大数据·word·powerpoint·.net
拆房老料7 天前
BaseMetas FileView 1.3.0 发布:大文件更稳,PDF 预览更完整
pdf·word·开源软件·ppt