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

I don't understand latex programs for Windows

  1. Apr 27, 2009 #1
    Okay, guys. Here's what I want to do: convert a *.tex file to a *.dvi file, and then look at the pretty *.dvi file. That's it.

    But I want to do it in Windows.

    I've done this a gazillion times in linux, and it's easy as pie. Just "latex file.tex" in a terminal shell. But of course there's no terminal in windows.

    I've installed both miktex and texniccenter, and I can't make heads or tails of either one. This should be simple, and yet...

    Any help would be much appreciated. Thanks!
  2. jcsd
  3. Apr 28, 2009 #2


    User Avatar
    Homework Helper

    One option is to get an editor that can invoke LaTeX for you. I know a lot of people use WinEdt - it's shareware, but I'm sure there are free equivalents out there that you could find using e.g. Google. You'll also need a DVI viewer; I think Yap comes as part of MikTeX, or if not it should be available somewhere online.

    An alternative would be to run LaTeX on the command line - yes Windows has a terminal, the program is called cmd.exe. The Windows shell kind of sucks though (in my opinion), so if you want something better/more UNIX-like, consider Cygwin.

    Of course, there's always my preferred method: just stick to Linux ;-) (for LaTeX at least)
  4. Apr 28, 2009 #3
    Thank you, kind sir. WinEdt works to convert *.tex files to *.dvi, and the *.dvi file loads fine in Yap (which apparently is part of miktex).

    Is there any way to use miktex for conversion process, though? I really don't like having strange shareware on my PC, plus the user interface for WinEdt really stinks.
  5. Apr 28, 2009 #4


    User Avatar
    Homework Helper

    Well, the program that does the conversion itself is just plain old LaTeX, which is part of MikTeX. You don't need WinEdt to use it. As I said, Windows does have a terminal and in principle, I think you could run LaTeX from the terminal the same way you would on Linux/UNIX. (All WinEdt does is give you an easier way to run the same program)

    I did a bit of Google searching on your behalf (really, it wasn't hard) and came up with this:
  6. Apr 28, 2009 #5


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    You can use your favorite text editor,
    which hopefully has a feature that you can customize commands to allow you to
    "compile" your .tex source into a .dvi / .ps / .pdf file.
    (Essentially, it opens a shell and types in the MikTeX commands and parameters you specify.
    I believe MikTeX updates the PATH variable... so if you start the shell cmd.exe and navigate to
    the directory of your .tex source, you should be able to type "latex myfile" or "latex myfile.tex".)

    For instance, you can use notepad++ http://www.tlhiv.org/ma497/software/

    With MikTeX-YAP, you can customize it to allow you
    to click on some portion of the .dvi and have an editor pop up at that location in the .tex source,
    as well,
    appear on the .dvi page corresponding to your .tex source.
    Last edited by a moderator: Apr 24, 2017
  7. Apr 28, 2009 #6


    User Avatar
    Science Advisor

    (On Windows) I personally use LEd, combined with Miktex. LEd is a pretty damn cool program that can install packages on the fly which I really like. From there though, it can convert from tex>dvi, dvi>pdf, tex>pdf and built in batch scripts which can do it all for you.
  8. May 4, 2009 #7


    User Avatar
    Homework Helper

    I use MikTeX, and I invoke it with a batch file. So, I have an icon in the folder where is the tex file, and I simply double-click it to compile the document. (Actually, I usually just keep it hilighted and press enter to compile.) You can create the batch file with notepad; just save it with .bat extension. I use yap (comes with MikTeX) to view the dvi, ghostscript (free to download) to view the ps file, and acroread (also free to download) to view the pdf.

    The batch file just has a .bat extension, and it contains the line
    "latex filename.tex"
    where filename is the name of my tex file that I want to compile. I have to make sure that there is another line in the file, which I guess the command shell understand as ENTER, or else I have to press enter again after the shell comes up. I also have some lines in the batch file:
    "#dvips filename.dvi -o filename.ps"
    "#ps2pdf filename.ps"
    that I uncomment (remove the "#") when I want to produce the .pdf version. (Axodraw does not work on my machine with pdflatex, or even dvipdfm.) BTW, in order to edit the batch file, you will probably have to right-click and select edit, because it may simply execute by default.

    I think I had to set an environment variable or something to point to MikTeX. If your source doesn't compile, that is likely the problem. Let me know if you have a problem, and I might be able to help you to set the environment variable (if Windows XP).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook