Control is hopeless分享 http://blog.sciencenet.cn/u/controlhopeless I just wonder how things are put together and then what happens

博文

转换LaTex的公式到Word

已有 4366 次阅读 2023-1-3 18:39 |个人分类:教学新得|系统分类:科研笔记

在网上看到这样一个办法:


https://www.sauravag.com/2016/11/the-best-way-to-convert-latex-math-equations-into-word-equations/ 


1)将latex的公式表示嵌入到如下一个html文件,我用的编辑器是TextWrangler


<!DOCTYPE html>

<html>

<head>

    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

    <title>tex texample</title>

</head>

<body>

\[

\begin{array}{l|ccccc}  

s^n & a_n & a_{n-2} & a_{n-4} & a_{n-6} & \cdots\\ 

s^{n-1} & a_{n-1} & a_{n-3} & a_{n-5} & \cdots & \cdots\\ 

s^{n-2} & x_1 & x_{2} & x_{3} & \cdots & \cdots\\

\vdots & \vdots & \vdots & \vdots & \vdots & \ddots\\ 

\end{array}

\]

</body>

</html>


以 latex 下的公式表示,必须要以数学模式开头\[,也可以是$$。


2)然后用Chrome打开它,Safari也可以,结果显示如下


Screen Shot 2023-01-03 at 6.55.49 PM.png


3)然后鼠标右键对着上述公式,点击MathML code,出现一个窗口 MathJax Equation Source,将其内容copy下来


Screen Shot 2023-01-03 at 5.41.50 PM.pngScreen Shot 2023-01-03 at 5.42.52 PM.png


4)打开word一文件,我用的是2011版,然后Insert一个公式,接着选择word的编辑窗口,选粘贴方式为“无格式文本”,会出现最底下的Word公式


Screen Shot 2023-01-03 at 5.54.09 PM.pngScreen Shot 2023-01-03 at 5.54.28 PM.pngScreen Shot 2023-01-03 at 5.54.40 PM.png


如果用鼠标右键,需要输入一个多余的字符例如"a",然后选择粘贴,否则不出现“只保留文本”粘贴方式的选项,再删去引入的那个多余字符a。


Screen Shot 2023-01-03 at 6.39.05 PM.png

遗憾这里面的“竖线”在目前的版本下,word里面并不出现。



https://wap.sciencenet.cn/blog-669170-1370379.html

上一篇:Hopfield应该得诺贝尔物理学奖
下一篇:古今多少事
收藏 IP: 106.39.151.*| 热度|

6 尤明庆 谢钢 王安良 杨正瓴 宁利中 李毅伟

该博文允许注册用户评论 请点击登录 评论 (1 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-28 01:59

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部