I've just installed TeXworks on new computer (with ubuntu 10.4). It seems all required texlive packages are installed, in any case I can compile .tex documents using terminal. But in TeXworks while trying to run pdfLaTeX appears:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
 restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
l.2 \documentclass

Preamble is:

%& --translate-file=utf-8

here goes the text


I've uninstalled and installed once again TeXworks, the problem persist. I had before more general problem with the system, I thought I've resolved it with help of askubuntu, the thread is here: https://askubuntu.com/questions/28195/untrusted-packages-could-compromise-your-systems-security-appears-while-tryin, I don't know if there is any connection between those problems.

Thanks in advance for any suggestions

  • Did you select pdfLaTeX next to the compilation button? I think the standard is pdfTeX, which won't compile LaTeX documents.
    – Caramdir
    Feb 26, 2011 at 18:27
  • The default was changed a while ago, but it depends on which version you have. @Caramdir: Please make your comment an answer.
    – Joseph Wright
    Feb 26, 2011 at 18:36
  • @Joseph: Ubuntu usually has pretty outdated TeX packages (and 10.4 is nearly a year old).
    – Caramdir
    Feb 26, 2011 at 18:38
  • @Caramdir: As building your own TeXworks is easy on Ubuntu, it's hard to be sure if people are using one from a repository or making their own version.
    – Joseph Wright
    Feb 26, 2011 at 18:46

2 Answers 2


Did you select pdfLaTeX next to the compilation button? The default in the TeXworks version in Ubuntu 10.04 is pdfTeX, which won't compile LaTeX documents.

  • in effect, this is the problem. I thought having changed it (edit -> preferences -> typesetting -> pdfLaTeX), but I haven't notice that it doesn't "remember" my choice... Is there any way to change it for pdfLaTeX?
    – maria
    Feb 26, 2011 at 18:48
  • @maria edit -> preferences -> typesetting -> Default: pdfLaTeX works for me.
    – Caramdir
    Feb 26, 2011 at 18:53
  • 1
    @maria: You'll need to restart TeXworks to get the change of preferences to apply to existing files.
    – Joseph Wright
    Feb 26, 2011 at 19:01

This is what I did and it worked on my Linux MINT.

Open the terminal and install a LaTeX compiler (abntex)

~$ sudo apt-get install abntex 

Then I installed TexMaker and it worked fine.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .