I wonder if there is some free solutions for typing math formulas the LaTeX way in Microsoft Word document (Office 2007)?
510 Answers
If you are running Office 365 version 1707 or later, the Equation Editor allows you to convert LaTex into the native format. See the first part of this answer.
In older versions of Office, the Equation Editor can understand certain LaTeX components. However, it builds the equation as you go, and you cannot convert an entire LaTeX equation. See the second part of this answer if you are running:
- WinWord 2007, 2010, 2013, and 2016
- MacWord 2011 and 2016
On Office 365 version 1707 or later
Put the Equation Editor into LaTeX mode. In the Equation Editor Design ribbon, go to the Conversions group and click LaTeX.
Type the LaTeX.
Open the Convert dropdown menu and click Current - Professional.
The LaTeX will be processed into the Equation Editor's native format.
You can also convert back to LaTeX to edit the equation.
- Open the Convert dropdown menu, and then click Current - Linear.
- The equation is converted back to LaTeX format. Note: This is not your original LaTeX source, because it has been round-tripped through the Equation Editor's internal format.
- Open the Convert dropdown menu, and then click Current - Professional.
You have to use the dropdown menu because the Convert button doesn't toggle automatically between Linear and Professional. It keeps the last-used command.
There are some limitations. For example, the Office 365 Equation Editor does not understand the \begin and \end commands. See the Microsoft documentation for examples and possible workarounds:
On Office 2007-2016 (Mac Office 2011-2016)
Very few people realize that the built-in equation editor in Word 2007 actually understands LaTeX-style equation entry. Simply insert a new equation, and then type LaTeX into it. As you type, Word will build up a graphical representation of the equation.
Once it appears in the GUI, you can no longer edit it as LaTeX. Word does not have an embedded TeX processor -- it's just doing pattern matching to convert simple LaTeX syntax into the native equation format. You should therefore not expect to get perfect fidelity for super-complex LaTeX equations. However, it's enough for probably anyone but a mathematician, and it's a lot faster than clicking elements with the mouse.
The Word 2007 equation editor also has a linear equation entry format, which is fairly intuitive and does not require familiarity with LaTeX. For example, typing in (a+b)/(c+d) will result in a nicely-formatted fraction.
Notes:
Many scientific journals will not accept Word documents with the new equation format -- even if you save as .doc instead of .docx.
This doesn't turn Word into LaTeX. It just does the equations themselves, and nothing else. You don't even get equation numbering.
Write your Math formulas in LaTeX → Transform the LaTeX formulas in MathML Code → Copy/Paste the MathML Code in Word (after paste click CTRL and then T). Voila!
EXAMPLE:
Lets take for example this Formula:
This is the LaTeX source Code from the above Formula:
0 \leq \lim_{n\to \infty}\frac{n!}{(2n)!} \leq \lim_{n\to \infty} \frac{n!}{(n!)^2} = \lim_{k \to \infty, k = n!}\frac{k}{k^2} = \lim_{k \to \infty}\frac{1}{k} = 0.Now open a Editor and put the above source code between the signs $$ $$ like this:
<!DOCTYPE html>
<html>
<head> <script type="text/javascript" src=""></script> <title>tex texample</title>
</head>
<body> $$ 0 \leq \lim_{n\to \infty}\frac{n!}{(2n)!} \leq \lim_{n\to \infty} \frac{n!}{(n!)^2} = \lim_{k \to \infty, k = n!}\frac{k}{k^2} = \lim_{k \to \infty}\frac{1}{k} = 0.$$
</body>
</html>Save the file as .html file and open it with a browser like Chrome.
Right Click on the Formula and Choose Show MathML As → MathML Code.
<math xmlns="" display="block"> <mn>0</mn> <mo>≤<!-- ≤ --></mo> <munder> <mo form="prefix" movablelimits="true">lim</mo> <mrow> <mi>n</mi> <mo stretchy="false">→<!-- → --></mo> <mi mathvariant="normal">∞<!-- ∞ --></mi> </mrow> </munder> <mfrac> <mrow> <mi>n</mi> <mo>!</mo> </mrow> <mrow> <mo stretchy="false">(</mo> <mn>2</mn> <mi>n</mi> <mo stretchy="false">)</mo> <mo>!</mo> </mrow> </mfrac> <mo>≤<!-- ≤ --></mo> <munder> <mo form="prefix" movablelimits="true">lim</mo> <mrow> <mi>n</mi> <mo stretchy="false">→<!-- → --></mo> <mi mathvariant="normal">∞<!-- ∞ --></mi> </mrow> </munder> <mfrac> <mrow> <mi>n</mi> <mo>!</mo> </mrow> <mrow> <mo stretchy="false">(</mo> <mi>n</mi> <mo>!</mo> <msup> <mo stretchy="false">)</mo> <mn>2</mn> </msup> </mrow> </mfrac> <mo>=</mo> <munder> <mo form="prefix" movablelimits="true">lim</mo> <mrow> <mi>k</mi> <mo stretchy="false">→<!-- → --></mo> <mi mathvariant="normal">∞<!-- ∞ --></mi> <mo>,</mo> <mi>k</mi> <mo>=</mo> <mi>n</mi> <mo>!</mo> </mrow> </munder> <mfrac> <mi>k</mi> <msup> <mi>k</mi> <mn>2</mn> </msup> </mfrac> <mo>=</mo> <munder> <mo form="prefix" movablelimits="true">lim</mo> <mrow> <mi>k</mi> <mo stretchy="false">→<!-- → --></mo> <mi mathvariant="normal">∞<!-- ∞ --></mi> </mrow> </munder> <mfrac> <mn>1</mn> <mi>k</mi> </mfrac> <mo>=</mo> <mn>0.</mn>
</math>Now Copy/Paste the MathML Code in Word 2013 (or 2007) and click sequentially CTRL and then T (Paste Options: keep the text only) or go to the small Ctrl image at the end of the MathML Code you pasted and select the option manually.
This is how the formula looks at the end in Word 2013:
I've created LatexToWordEquation based on answers.
It is a Word AddIn.
The source code I've pushed to Github. Link here
If you prefer you can download the installer directly from here.
Note: This is an active download link that will immediately download the file when you click on it.
How to do it
@Devid's answer is excellent, but I had difficulty with the specific instructions. Here's what worked for me. Do Devid's steps through copying the MathML code.
Then, insert a blank equation. In Word 2013, switch to Print Layout view (View tab on the ribbon). On the Insert tab, choose Equation. You will see Type equation here selected.
On the Home tab, select the Paste dropdown, then Paste Special (or just hit CTRLALTV). Select Unformatted Unicode Text. The equation should then fill in mostly correctly, as in Devid's last picture.
One more thing - in the picture, the "lim" commands are italicized, where they were not in the original. To fix that, for each "lim," put the cursor just after the "m" and hit Space to cause Word to check "lim" against its table of functions and adjust the formatting. (Then delete the extra space that created.)
I prefer TeXsword over Latex in Word (TeXsword download). It has all the features of Latex in Word, plus gives handling of equation references. And it doesn't require the Internet connection, which I see as a feature not a limitation: MikeTeX isn't that big after all, and having the LaTeX locally allows you typing your document when traveling.
2You can use Latex in Word.
It provides macros for Microsoft Word that allow the use of LaTeX input to create equations images in both inline and display modes without having to install any software on the local computer. As far as I know, this is the only free alternative to the paid programs like Aurora and TexPoint.
For Office 2007, go to Latex in Word Project Page on Source Forge, and click on Word 2007 under Files.
1LaTeX in Word is a GPL-licensed tool that allows equations to be used in Microsoft Word documents. The client-side of the program is implemented as VBA macros in the document "LaTeXinWord_v_0_3_1.docm" along with instructions. Hence, this file contains the source code, implementation, and documentation.
I wrote a tools for Generating MathML, I improved the code form Devid, and add some functions for easy editing. Here is the Code:
<!DOCTYPE html> <html> <head> <script type="text/javascript" src=""></script> <title>tex texample</title> <script src="" type="text/javascript"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script>
<script> function SelectText(element) { var doc = document , text = doc.getElementById(element) , range, selection ; if (doc.body.createTextRange) { range = document.body.createTextRange(); range.moveToElementText(text); range.select(); } else if (window.getSelection) { selection = window.getSelection(); range = document.createRange(); range.selectNodeContents(text); selection.removeAllRanges(); selection.addRange(range); } } $(document).ready(function(){ $("#latexContent").val("$$ $$"); $('#latexContent').bind('input propertychange', function() { $("#myoutput").text($("#latexContent").val()); // MathJax.Hub.Queue(["TypeseTextt",MathJax.Hub,"myoutput"]); MathJax.Hub.Typeset("myoutput") }); $("#btnShowMathML").click(function(){ var con = $(".MJX_Assistive_MathML").html(); $("#myMathml").text(con); SelectText("myMathml"); }); $("#btnClear").click(function(){ $("#latexContent").val("$$ $$"); $("#myoutput").html("<p style='color: grey; font-style: italic;'> The LaTeX will display here ! </p>"); $("#myMathml").text(""); }); });
</script> </head> <body> <center> <p> Enter LaTeX here! </p> <textarea rows="5" cols="100"> </textarea> <button type="button">clear</button> <button type="button">Show The MathML</button> </br></br> <span> <p> The LaTeX will display here ! </p> </span> </br> <span> </span>
</center> </body> </html>When coping MathML to Word, make sure copy pure text, using key Ctrl+Alt+V (or first copy it to notepad then copy it to word).
The default server for LaTeX in Word appears to no longer be running. If you're forced to use Word (for instance, to collaborate with the less technically oriented) I'd use TeXsword as suggested by Adam already. You'll need to install a standalone MikTex distribution, but it is an easy install these days. It works with my Word 2016. It still doesn't look as good as a real bona fide LaTeX document, but it is easier to use and more malleable than the equation editor in Word.
3Microsoft Office ProPlus Version 1902 with activated LaTeX Format.
The following macro changes all LaTeX formulae delimited by pairs of $ within the current Selection of the Word document to Word formulae:
Sub LaTeX() If Selection.Start < Selection.End Then Set myRange = ActiveDocument.Range(Selection.Start, Selection.End) Do While myRange.Find.Execute(FindText:="$*$", Forward:=True, MatchWildcards:=True) = True ActiveDocument.OMaths.Add Range:=myRange ActiveDocument.OMaths.BuildUp Set myRange = ActiveDocument.Range(myRange.Start, Selection.End) Loop End If
End SubThis is a feasibility study and not intended for production. The macro can easily be fooled by stray $ signs in the text.
That is also the main reason for delimiting the action of the macro to the current selection.
Furthermore it does not handle display equation environments like equation or align.
Answer mentioned above is correct but there is a also shortcut builtin which is math auto correct. It is much like LaTeX. By default its inactive but you can activate it and is really helpful if you want to write big equations. For eg if you want to type H2 than you just have to type H_2 etc and many more options are available like for superscript character following caret (^) sign will be converted as superscript. Many such shortcuts are covered in this video or you can simply search for How to insert mathematical equation (like LaTeX) in Ms-Office: Tips and tricks on youtube.
This method will be especially helpful if you are a fast at typing. Moreover it will save your time which is lost while switching between keyboard and mouse and searching proper option in word.
1