How do I typeset equations in Word as pretty as LaTeX does?

6

2

This might be the N+1 th question about how to put vector graphics and/or equations in MS Word, but none of the solutions I found on the net satisfy me.

My ultimate goal is to be able to embed Latex equations into a MS Word 2013 document, because I'm stuck to a Word template I need to use, and because Word's equations look ugly. It's already lame to resort to "insert->image" every time I need an equation, but it seems that I don't have much choice. What I've tried:

  • Because I use Word 2013, I can't use TexPoint

  • MS Word equations look terrible compared to Latex.
    in Word: Word equation

    in Latex: Latex equation

  • Converting my pdf into .ps or .eps directly (either via pdf2ps, via Illustrator, or Acrobat), results in a completely messed up result, once in Word:
    without embedding fonts: EPS no fonts

    with font embedding: EPS with fonts 1
    (note that this is not ok, the integral lines are distorted, the 1 is ugly...)

    with font embedding, but just another equation: enter image description here
    (note that all the latex fonts used are in my Windows\Fonts directory anyway)

  • Converting the equations into vector graphics (i.e., in Illustrator, Types->Create Outlines) , there should be no font problem, but the result still looks bad once in Word (in Illustrator and other programs, it always look good) :
    EPS Vector 1 EPS Vector 2

  • Same as above, but converting to wmf, it's almost ok, but some characters are still distorted: Vector WMF

  • Same as above, but converting to emf, it's even better, but still, the B of the second equation is also destroyed:

Vector EMF 1 Vector EMF 2
when I export into PDF, it's degraded a bit, albeit near ok. Exported to PDF 1

I know that once exported to PDF, the rendering of Word vector graphics are supposed to look better, but they really do not in general.

Of course, I do not want a solution which rasterizes the images: that's not the point of vector graphics, the solution is bad and should not be used, and it can significantly increase the output size: Here, Eq 1 is rasterized, inserted in Word and exported in a PDF using Word's pdf exporter (with all high quality options, and it looks similar with other pdf exporter such as Nitro or Adobe pdf): Raster
It obviously looks... rasterized and blurry. The file size has increased to 200 KB (no, I do not have a single equation, and Nitro once managed to output a 300 MB pdf with all my rasterized equations which still looked blurry).

I'm ready to give up and use the best of the solutions above (Vectorized and exported in EMF), but I'd like to know if a better option exists at all.

If you have an option which just allows for using Word's equation editor, and change the font to use Latex's symbols, I'd also be extremely happy.

[[EDIT: Jukka K. Korpela's answer is almost what I am looking for. Unfortunately, when I use this solution and export to PDF using Word, I get:
XITS PDF
If I further constrain the PDF to be PDF/A compliant (which I'd ideally need), the result is even worse: XITS PDF/A
where I have put some context around the equation: the line of text above the equation is half cleared. If I print to PDF instead, the rendering is ok, but I loose all the links in my document, so that's not an option. ]]

WhitAngl

Posted 2015-01-25T14:39:54.767

Reputation: 581

What exactly is “terrible” in Word rendering of the equation? If you want a larger integral sign, just change the equation to display mode. – Jukka K. Korpela – 2015-01-25T16:42:39.917

I mean aesthetically ugly (everything: the integral sign, the font for letters, the spacing, the parentheses of varying size, the thickness of letters... just compare to the latex version), which is why nobody usually write math in Word : it does not look professional. Where can I find the "display mode" ? I see and tried "Professional", "Linear" and "Normal", and Professional is the best I could get from Word (which is the screenshot above). [edit: I think I found, but it was already in display mode, although it's not really different from inline)] – WhitAngl – 2015-01-25T17:09:28.633

If you have an equation set to “inline mode”, the dropdown shows an option “Change to Display”. But I now see that this wasn’t the problem here. – Jukka K. Korpela – 2015-01-25T17:30:45.343

Answers

4

Using the tools in tab DESIGN in EQUATION TOOLS, you can produce a large integral symbol, as shown below. It is very different from the rendering you get if you just enter the INTEGRAL character “∫”.

You can change the font of equations by selecting text in them and using the font menu in the HOME tab. However, Word lets you use only a limited set of fonts. It seems that the font names must end with the word “Math”. (If you set font to something else, it just does not take effect; the text stays in the font used before the attempt to change it.) In the image below, the first version uses Cambria Math, the default, while the second version has its font set to XITS Math, which somewhat resembles the font you are using in LaTeX.

enter image description here

The default font used in equations can be set in the equation mode preferences. To enter them, click on the small icon in the lower right corner of to “Tools” block in EQUATION TOOLS, tab DESIGN. The setting affects only new equations

Jukka K. Korpela

Posted 2015-01-25T14:39:54.767

Reputation: 4 475

(note that I really used the equation tool in Word to do this equation, and used the \int solution) – WhitAngl – 2015-01-25T18:34:38.913

thanks, the XITS font seems to work nicely! I had tried changing the font, but only had Cambria math supported. – WhitAngl – 2015-01-25T18:49:55.610

Re your first comment: right, sorry for the confusion. The \int command just inserts the INTEGRAL character. The graphic UI tools are needed to produce a conventional large integral symbol. – Jukka K. Korpela – 2015-01-25T19:03:39.310

arg... this solution seems to have a problem. When I export to pdf using Word's exporter, it completely messes with characters. When I use print->adobe pdf, it exports the equations well, but I loose all the clickable links in the document....) – WhitAngl – 2015-01-25T21:21:29.403

I de-validated and then re-validated : it seems that your solution works if I use the Latin Modern Font ( http://www.gust.org.pl/projects/e-foundry/lm-math/download/index_html ) and give up PDF/A compliance. It doesn't work well with XITS

– WhitAngl – 2015-01-25T22:04:20.013

mm... actually no, even with Latin Modern, and no PDF/A compliance, there is a lot of problems (some parentheses disappear in the output PDF). Also, giving up PDF/A compliance is kind of a problem : I really need the document to be readable by agencies, that won't try hard to open it with another reader if it fails with their own. I'm upvoting your answer, still, since it's a nice step toward the solution. – WhitAngl – 2015-01-26T13:03:42.720

I validated again. I think it is now a PDF exporting issue that would deserve another question rather than a font issue. I've tried multiple exporters (word's native exporter, pdfcreator, nitro, adobe, novapdf, pdf995, the googledoc trick, online converters...), but none work well (either mess up the rendering, or fail to add links). The closest to work is Novapdf, but which only puts a link if it doesn't span 2 lines, and also adds a "demo-version" logo to each page. I'll find a workaround. – WhitAngl – 2015-01-26T17:54:47.047