Possible Duplicates:
Conditional Compiling and \documentclass
Passing parameters to a document
Changing LaTeX headers via a makefile
I'm setting up a Rakefile for a LaTeX document and I'd like to be able to build different versions of the document with this script without changing the LaTeX source. The two different options that I'd like to change are:
\documentclass[draft]{memoir}
which can be changed to:
\documentclass[final]{memoir}
by invoking a different target. Is it possible to change these on-the-fly at compile time? I'm using xelatex if that makes any difference.

\PassOptionsToClass{..}{article}. – Martin Scharrer Jul 28 '11 at 19:45<pre> … </pre>is a lot better. Also, who said the op uses Windows and Adobe Reader? – Andrey Vihrov Jul 28 '11 at 21:47