7

I just installed TeXlipse, and want to make my .tex-file alongside my Java-code (in the same Java-project). Right now, I can compile, but only to .dvi, which I dislike because of the bad viewer.

Is it possible to change the default extension to .pdf, for every project? I already tried to disable the .dvi and .ps compilers by removing their program file path, but then I'm getting the error:

Error: Builder (#0) for dvi output format has an invalid configuration: <project-name>.
15

If I understood your question correctly, you probably have a Java project with a .tex file somewhere. Something like the following image:

Image 1

If we save our document, TeXlipse is configured to run the TeX builder for us. Saving the document with CTRL + S will give us the following files in my doc/ subfolder:

Image 2

The default setup is to rely on latex and .dvi. In order to change this behaviour, we need to go to Project > Properties:

Image 3

Just a note: if we check the builders, we will see that the project is set to run both Java and TeX builders for us.

Image 4

Look for the LaTeX Project Properties tab:

Image 5

The following screen will appear:

Image 6

Go to the output format and change the extension from .dvi to .pdf:

Image 7

The engine will automatically change to pdflatex. Click OK.

Image 8

Every time we edit our .tex document and save it, pdflatex will be executed instead of latex, and we will have the following files in my doc/ subfolder:

Image 9

We can also see the .pdf with the embedded viewer:

Image 10

Hope it helps. :)

  • Great answer, Paulo! Unfortunately I can’t upvote, because I cannot verify it (no Eclipse user). – Speravir Oct 10 '12 at 23:40
  • What?! No, “<3”? I am very, veerry, VERY sad!!!11 ;-) – Speravir Oct 11 '12 at 0:26
  • @Speravir: oops, my bad. <3 :) – Paulo Cereda Oct 11 '12 at 0:38
  • Wow, great answer! Big thanks, indeed works! – Pieter Oct 11 '12 at 17:37
  • And now, when Pieter as the OP said, it was helpful, I will upvote in a second. – Speravir Oct 11 '12 at 20:13
0

If, like me, you never use .dvi, then you can set the default behavior for all new projects to mimic that of the .pdf behavior by overwriting the latex.exe settings with the pdflatex settings. To do this, go to

Window>Preference>Texlipse>Builder Settings

Click on "Pdflatex program", then click edit and copy the contents of the "arguments" box. Close and open the options for "Latex program". Paste the arguments from the "Pdflatex program" options into the corresponding box and change the "program file" from DIR/latex.exe to DIR/pdflatex.exe

Note that Eclipse will now expect the output to be .dvi and so won't: a) launch the correct previewer using ctrl-4 b) remove the compiled pdf if you run the clean command.

I am "fine" with this hack and its consequences as I use pdf4eclipse with ctrl-alt-F for forward search, but would like there to be a central option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.