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
相关推荐
SunnyDays10111 小时前
Java 拆分 Word 文档教程:按页、分页符和分节符拆分
java·word·分页·拆分
chillylight12 小时前
LaTeX 公式转 PNG / SVG:几种实用方案和使用场景对比
latex
copilot中国版1 天前
Word Copilot|一键提取文档关键信息,告别逐字阅读
word·copilot
天人合一peng3 天前
西北工业大学校外访问系统
word
古少侠3 天前
deepseek转word工具怎么选?DS随心转与4种方案对比实测
人工智能·word·powerpoint
小羊没烦恼!4 天前
Memory 记忆设计讨论:Agent Memory 的安全边界:权限、删除、版本与回执
java·大数据·word·powerpoint·.net
拆房老料4 天前
BaseMetas FileView 1.3.0 发布:大文件更稳,PDF 预览更完整
pdf·word·开源软件·ppt
weixin_416660074 天前
DeepSeek、豆包生成的表格怎么导出Excel,避免内容挤在一列?
word·豆包·deepseek
鲲穹AI种草6 天前
Word 文稿批量规范化处理,多款 Word 批量处理工具能力客观记录
word·批量处理·页面页脚
SunnyDays10117 天前
使用 Python 提取 Word 文档中的表格数据
python·word