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

When I run:

tex algorithms.dtx

for example, I get this message.

  ! Undefined control sequence.
l.34 \documentclass


share|improve this question
up vote 13 down vote accepted

Depending on how the .dtx is constructed, it may not work at all with TeX: you have to use (pdf)latex. To unpack the file you may well need an .ins file.

share|improve this answer
@an_ant: it doesn't need to be deleted, because it might help other users. You could even improve that chance if you change the title to "Installing a dtx file" or similar, so it could be found by users with a similar problem but any arbitrary package. – Stefan Kottwitz Dec 11 '10 at 18:59
@Stefan Kottwitz: Got it. I'll try to manage it. – user1996 Dec 11 '10 at 19:24
Thanks! Forgot that you should "Run LaTeX on the .ins file to unpack the .dtx file". – user1996 Dec 11 '10 at 19:29

Joseph Wright says "run latex on the .ins"; however, if you have LaTeX, you also have ltxdoc.cls, etc., so that unpacking the .dtx doesn't help.

Processing the .dtx file with (pdf)latex gives all you need -- a file of documentation.

share|improve this answer

Your Answer


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