TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: http://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

share|improve this question
Did you select pdfLaTeX next to the compilation button? I think the standard is pdfTeX, which won't compile LaTeX documents. – Caramdir Feb 26 '11 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 '11 at 18:36
@Joseph: Ubuntu usually has pretty outdated TeX packages (and 10.4 is nearly a year old). – Caramdir Feb 26 '11 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 '11 at 18:46
up vote 8 down vote accepted

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.

share|improve this answer
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 '11 at 18:48
@maria edit -> preferences -> typesetting -> Default: pdfLaTeX works for me. – Caramdir Feb 26 '11 at 18:53
@maria: You'll need to restart TeXworks to get the change of preferences to apply to existing files. – Joseph Wright Feb 26 '11 at 19:01
@Joseph: Works! Thanks :) – maria Feb 26 '11 at 19:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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