2021-03-28

Use Word2019 to visually edit LaTex mathematical formulas in Markdown documents

In the process of Markdown blog writing, sometimes mathematical formulas are used. Using LaTex grammar to edit mathematical formulas is undoubtedly the best choice. However, in the face of cumbersome LaTeX grammar rules and long strings of LaTeX codes, people always feel that their heads are big and daunting; you must know that manually inputting formulas in LaTeX codes is very error-prone. It is also very troublesome to modify. So, is there a WYSIWYG visualization way to quickly and accurately enter LaTeX formulas in Markdown documents? The answer is yes.

-> The confusing grammar rules of LaTeX formulas:

https://zhuanlan.zhihu.com/p/110756681

https://zhuanlan.zhihu.com/p/50667788

What is LaTeX?

LaTeX (LATEX, transliteration "LaTehe") is a typesetting system based on TEX . It was developed by American computer scientist Leslie Lamport in the early 1980s. Using this format, even Users without knowledge of typesetting and programming can give full play to the powerful functions provided by TeX , and can generate many book-quality printed materials within days or even hours. This is especially true for generating complex tables and mathematical formulas . Therefore, it is very suitable for generating high-quality technical and mathematical documents. This system is also suitable for generating all other kinds of documents, from simple letters to complete books. [1]

Baidu Encyclopedia

Word2019 supports its own mathematical formula editor, and it provides the function of converting formulas into LaTex codes. This article is to use Word2019 to visually input mathematical formulas in the Word2019 formula editor, then convert them into LaTex codes, copy them into Markdown documents, and realize WYSIWYG visualized input of LaTeX formulas in Markdown documents to avoid frequent Reading and memorizing LaTex grammar greatly improves the input efficiency and accuracy of mathematical formulas.

Essential software

Word2019 (other versions that support their own formula editor are also available)

Typora (Markdown document editor)

Example

Take the formula image-20210328000126763.png as an example to introduce the way of WYSIWYG visualization to enter mathematical formulas in Markdown documents.

1. First, press the shortcut key alt+ in the blank space in the Word2019 document (.docx file) to =enter the formula input state and start editing the formula.

image-20210328000418624.png

2. Then, click the expand button image-20210328000912364.png at the bottom right corner of the formula, and click 线性(L).

image-20210328000556737.png

The formula in Word2019 will be directly converted into the following LaTeX code:

x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}

image-20210328000726339.png

3. Select the LaTeX code that has been converted in Word2019 and copy it.

4. Use Typora to open the md document, click 段落> 公式块, and paste the LaTeX code into the formula block area.

image-20210328001614094.png

So far, the formula input in the Markdown document is complete.

Other examples

Example 1

Formula (displayed in Word2019):

image-20210328002609345.png

Latex code:

M_{clutch}=\frac{\mu\pi^2\left(n_1-n_2\right)}{60}(\sum_{i=1}^{N_1}\frac{R_{2i}^4-R_{2i}^4\ }{L_i}+\sum_{i=1}^{N_1}\frac{8\ast r_{1j}^2r_{2j}^2Hj\ }{r_{1j}^2-r_{2j}^2})

Formula (Markdown display):

image-20210328003603484.png

M c l u t c h = μ π 2 ( n 1 − n 2 ) 60 ( ∑ i = 1 N 1 R 2 i 4 − R 2 i 4   L i + ∑ i = 1 N 1 8 ∗ r 1 j 2 r 2 j 2 H j   r 1 j 2 − r 2 j 2 ) M_{clutch}=\frac{\mu\pi^2\left(n_1-n_2\right)}{60}(\sum_{i=1}^{N_1}\frac{R_{2i}^4-R_{2i}^4\ }{L_i}+\sum_{i=1}^{N_1}\frac{8\ast r_{1j}^2r_{2j}^2Hj\ }{r_{1j}^2-r_{2j}^2}) Mclutch=60μ π2(n1n2)(i=1N1LiR2 i4R2 i4 +i=1N1r1j2r2 j28r1j2r2 j2Hj )

Example 2

Formula (displayed in Word2019):

image-20210328002942336.png

Latex code:

y=ax^2+bx+c

Formula (Markdown display):

image-20210328003424674.png
y = a x 2 + b x + c y=ax^2+bx+c and=ax2+bx+c

Formula (displayed in Word2019):

image-20210328003141801.png

Latex code:

{\dot{Q}}_{sr}={\dot{Q}}_{dr}={\dot{Q}}_{hr}

Formula (Markdown display):

image-20210328003336870.png
Q ˙ s r = Q ˙ d r = Q ˙ h r {\dot{Q}}_{sr}={\dot{Q}}_{dr}={\dot{Q}}_{hr} Q˙sr=Q˙dr=Q˙hr

Homepage: https://www.zhihu.com/people/caviar126

Guess you like

Origin blog.csdn.net/caviar126/article/details/115275083