Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Incorporating LaTeX into Word documents as images

  1. Jul 22, 2009 #1
    I'm sorry if this is covered in a tutorial somewhere on here, but I couldn't find it.

    What I want to be able and do, is write in LaTeX code, and then export the product as an image.

    I've tried to do it on my own, but I just got bogged down by all sorts of sophisticated programs.
    I've installed the MikTeX package and Vim (Cream), but I'm afraid I just can't find my way around them.

    A link to a program that can help me out would be greatly appreciated, or if someone could point me to a tutorial that will help me do what I want with what I already have, that'd be great as well.

    With thanks in advance, Anatoli
  2. jcsd
  3. Jul 22, 2009 #2


    User Avatar
    Science Advisor

    The standard Latex output is a postscript (.ps) file. If you're on a linux machine, probably the easiest way would be to convert the ps to pdf via
    Code (Text):

    ps2pdf file.ps
    Which should give you a file.pdf file. From there, you can open the pdf and use the snapshot tool to copy a selection to the clipboard. Paste in Paint and save as whatever you wish.

    Alternatively, if you're on Windows, you can download/install Ghostscript which is a ps file viewer which can let you output to other formats. Unfortunately I'm not aware of any "stock" Windows apps that will let you manipulate a .ps file as it. You'll need to convert it first. Ghostscript should be pretty painless for you though.

    Good luck,
  4. Jul 22, 2009 #3
    Great, thanks a lot for the prompt response. :)
    In case I have any follow up questions, I'd just like to add that I'm running Windows. Shouldn't have thought that would be obvious.
  5. Jul 22, 2009 #4
    If you have a graphical LaTeX editor installed in windows, you may be able to convert it to an OEM object. I also believe the latest version of commercial program MathType, which integrates with Word, can have LaTeX pasted into it or written directly into the program.

    I would download a trial version of http://www.dessci.com/en/products/mathtype/" [Broken]and see if it fits your needs.
    Last edited by a moderator: May 4, 2017
  6. Jul 22, 2009 #5
    That sounds good, especially since I can't seem to find a working mirror of GS.

    I don't care about the integration into word as much. Print screen and paint would probably do just as well, as long as I can get some sort of graphical output. Could you point me in the direction of one such "graphical LaTeX editor?"

    But I'd prefer a more permanent solution over a trial version of MathType, especially since I want to use it throughout the school year, and not just for whatever the trial period is.
  7. Jul 22, 2009 #6
    Based on your requirements, I would probably consider investigating MathType. It seems to fit your requirements best. It is a mathematical equation editor (basically an "advanced" version of what is included in WordPerfect and what was included in Office 2003 and earlier). According to the documentation, it can accept most popular equation formats such as LaTeX, MathML, Mathematica, et cetera. It creates an OEM object, which you can insert into almost any windows programs.

    This has a couple advantages. If you make a mistake, the OEM object allows you to edit the equation directly by double-clicking on it. It also allows you to smoothly scale the equations up or down in size without worrying about jagged edges caused by pixilation in bitmaps.

    It is a commercial program, and the academic version runs somewhere around $50, but I do not know of any non-commercial program that has the same capabilities.
  8. Jul 22, 2009 #7
    I see, then I'm afraid that's quite a bit out of my price range, especially considering how I won't be using it all that often for it to be worth 50$.

    If I understood you correctly, all I need is a .ps editor so I can write my LaTeX code in that, and then GhostScript can translate that into an image PDF? I really appreciate the help and patience, by the way. :)
  9. Jul 22, 2009 #8
    I am assuming you're using Windows to compile LaTeX? I use MikTeX and it comes with the pdflatex driver, which compiles directly to .pdf files. I belive all other packages have this as well, but I can't speak for certain. I assume you can embed .PDF within Word?

    Another thing that might be handy is to look into the preview package for LaTeX. It lets you specify the document size to encompass only a particular specified environment. With this, you can output an individual equation as a .PDF with the margins set nice and tight to the object. This would make it easier to import into Word, or so I would imagine.

    Also, there are free tools out there, like PDFill, which converts from .PDF to image files. I know Word easily handles images.

    Good luck!
  10. Jul 22, 2009 #9


    User Avatar
    Homework Helper

    If all you want is to convert a latex equation into an image file, you might also consider using online tools for that. You can google it; one example is at:


    But I was curious about your Miktex setup. Are you saying that you cannot get any output out of it at all? If so, could you describe the steps you take?
  11. Jul 22, 2009 #10


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    If all you need are equations as images, then alphysicist's link latex2png is great.
    http://www.codecogs.com/components/equationeditor/equationeditor.php [Broken]
    http://sixthform.info/steve/wordpress/?p=59 (more)

    Concerning MathType... even though it is a trial... it apparently will become better than the stock Equation Editor that comes with Microsoft Office (but is often not installed).

    For something fancier that integrates with Word or Powerpoint (but still inexpensive)...
    http://www.technion.ac.il/~zvikabh/software/iguanatex/ [Broken]
    (which rely on something like MikTeX)

    If you can't get MikTeX working via the console or via a fancier text editor, you might wish to look into http://www.texniccenter.org/
    Last edited by a moderator: May 4, 2017
  12. Jul 22, 2009 #11
    Just in case you didn't know, and you want write your own equations in MS Word, MS Word has a equation editor.
  13. Jul 23, 2009 #12
    That looks perfect! Thanks a lot. :) I think I'll just give up on MikTeX and whatever else I may have installed.
  14. Jul 23, 2009 #13


    User Avatar
    Homework Helper

    That website does seem like that a good option for including latex equations into Word, but I also think that Miktex is worth getting up and running. (I use it about every day though, so I'm biased toward it.)

    It sounds like you were not getting any output at all, so here is a minimal process to get some pdf output. (By the way, I had asked what process you were using to get an idea of what you had already done; please don't be offended if I'm telling you stuff you already know--if that's the case maybe it will help someone else.)

    1. Open notepad and type or paste in the following:

    Code (Text):



    Wow, I can't thing of anything to write here for some text.

    \bar f=\frac{1}{b-a}\int\limits_a^b f(x)\ dx

    Save it in some directory and call it "tester.tex". (Be sure it's not saved as "tester.tex.txt"; when you go to save it, change the option "save as type text documents" to "save as type all files")

    2. Open a command prompt window and navigate to the directory you saved tester.tex in, and then enter the command

    Code (Text):

    pdflatex tester.tex
    If everything works, you should then have a file "tester.pdf" in the same directory.

    Assuming miktex installed correctly, then if the above doesn't work, I think there are 2 main causes:

    1. If the response in the command prompt window is something like

    'pdflatex' is not recognized as an internal or external command, etc.

    then you don't have the latex directory added to your path.

    2. If pdftex starts to run, but then it says:

    ! I can't find file 'tester.tex'.

    then I would you are either in the wrong directory (not in the one with your file), or you have turned off visible file extensions and your file is actually called "tester.tex.txt" but windows is not showing the ".txt" part.

    Anyways, if you are interested, just try the above and see what happens.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Incorporating LaTeX Word Date
LaTex and MathJax Feb 27, 2018
Putting Excel graph into LaTeX Feb 10, 2018
LaTeX \vec command Jan 31, 2018
LaTeX How to type something in ##\LaTeX## in the title itself? Jan 13, 2018
How to Write Canceled Numbers in Word 2010? Sep 9, 2015