4

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:

enter image description here

How do I compile that TeX document using LaTeX?

Werner
  • 603,163
  • My above comment was using .bat. Other approach of automation via .dvi is using Latexmk – texenthusiast Jan 04 '13 at 05:35
  • 1
    @piratepartypumpkin Reading the comments on the answers, I suspect you are slightly confused about things. 'LaTeX' is a general name a system used to typeset documents, and defines the input syntax used. pdflatex is a command which uses LaTeX to produces PDF files directly: the more traditional use of the latex command to make .dvi files requires subsequent steps to make PDF files. For most new users, pdflatex is much more convenient than 'traditional' latex, and indeed many experienced LaTeX users have moved to pdfLaTeX-only workflows. – Joseph Wright Jan 04 '13 at 07:07
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – Martin Schröder Jan 15 '13 at 09:30

4 Answers4

3

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.

  • Thanks. Is there any easy way to compile it with latex? I tried looking around for tutorials and I couldn't find anything really. – piratepartypumpkin Jan 04 '13 at 05:12
  • @piratepartypumpkin Open the command line, navigate to the directory of your file, type latex myfile.tex + Enter. But are you sure you really want a .dvi file as output? That's what the latex engine produces. Nowadays, pdflatex myfile.tex can probably be considered standard. – doncherry Jan 04 '13 at 05:37
  • @piratepartypumpkin It's possible to create a 'LaTeX + dvips + ps2pdfentry in TeXworks to runlatexand convert the.dvi` to a PDF, but as donchrrey says, directly creating the PDF is easier. – Joseph Wright Jan 04 '13 at 06:56
1

I am converting my comments into Answer

TeXworks documentation wiki gives you to configure LaTeX->dvi->ps2pdf route for PDF using .bat

Other approach of automation via .dvi is using Latexmk

LaTeX Wikibook always comes in handy

1

So.

LaTeX is the set of commands we use to create documents. For example \documentclass and \begin{tabular}, etc.

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:

latex example.tex

dvips example.dvi

ps2pdf example.ps

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.

Note: latex can only handle EPS graphics, while pdflatex can handle JPG, PNG and PDF, but not EPS.

marczellm
  • 11,809
0

Even 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 pdflatex.

To get from DVI to PDF you can use dvipdfm 'inputfile.dvi'

Uwe Ziegenhagen
  • 13,168
  • 5
  • 53
  • 93
  • How can I go from having a .tex to a .pdf, but compiling using latex. Because if you see my post here: http://tex.stackexchange.com/posts/89224/revisions It looks like I need to compile a pdf with latex. But I guess if Using latex only gets me dvi, I would have to somehow convert the dvi to pdf. – piratepartypumpkin Jan 04 '13 at 05:15
  • I don't get it. If you want a PDF why don't you use pdflatex? What is the original requirement you want to fulfill? Concerning the example the website says 'last edited in 2006'. Since then the LaTeX world has evolved I recommend you to have a close look on other options for such a letter. – Uwe Ziegenhagen Jan 04 '13 at 05:31
  • If you look at my link, the author says its a LATEX source, so I took his source and made a tex file from it, and it's not compiling properly, next thing I thought of is if it's compiling through pdflatex and not latex. I'm going to take a look at other websites. – piratepartypumpkin Jan 04 '13 at 05:40
  • 2
    @piratepartypumpkin I think you are confused about what LaTeX is. Perhaps it would be useful for you and those answering your question if you were explicit about what you want to achieve (include your code in the question if not too big, say what result you expect - dvi, pdf, etc) – Vivi Jan 04 '13 at 05:47
  • 2
    @piratepartypumpkin check my comments above. perhaps you might be misunderstanding with this answer for your earlier closed question. In the recent MikTeX and TexLive 2012 pdflatex engine has become standard route for PDF as it can handle .eps, .jpg,.png and .pdf. – texenthusiast Jan 04 '13 at 05:55
  • I'm trying to do this: http://tex.stackexchange.com/questions/89229/cant-remove-date-from-newlfm – piratepartypumpkin Jan 04 '13 at 06:01
  • 1
    @texenthusiast: No, pdftex cannot handle EPS, cf. Heiko Oberdiek’s answer in http://tex.stackexchange.com/a/72939/9237. You need a converter; in TeX Live this happens automatic AFAIK, in MiKTeX one must add this manually, see e.g. http://tex.stackexchange.com/a/52026/9237. – Speravir Jan 04 '13 at 16:25
  • @Speravir Yes not natively, but on the fly conversion of eps to pdf is done for Texlive 2012 on Windows and Linux. I use texlive on both platforms to take advantage of this. for Miktex it is manually done as you pointed out. – texenthusiast Jan 04 '13 at 18:02