I don't have the option of compiling using LaTeX engine in TeXworks, which I installed from MiKTeX. Take a look at the options I have:
How do I compile that TeX document using LaTeX?
TeXworks doesn't support the DVI output format but the PDF output format in preview only, so you need to use pdfLaTeX here (or use something different which will produce PDF at the end).
If you want to work with DVI output format I would suggest picking a different LaTeX editor/shell.
LaTeX is the set of commands we use to create documents. For example
latex is a program. When you type
latex example.tex into the command line, it will create a .dvi file from your .tex file. The same happens when you press a button named latex in an editor like TeXWorks, and the editor does the command line stuff for you.
If you want PDF output you have several choices. One of them is:
You only need this if you used PSTricks or related packages in your code. Most people therefore use another program called
pdflatex. The only difference is that you get immediate PDF output instead of DVI. All the LaTeX document commands stay the same.
So you don't have to compile your .tex file with
latex. You can simply use
pdflatex, and everything will work the same, but you will get PDF output.
latex can only handle EPS graphics, while
pdflatex can handle JPG, PNG and PDF, but not EPS.
latex.exe is nowadays just a link to
pdflatex.exe. You can generate a DVI by using
\pdfoutput=0 in the first line of the document and compiling it with
To get from DVI to PDF you can use