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 would like to do some stuff that is only enabled when the draft option is given in \documentclass[draft]{article}.

How would I go about doing this?

share|improve this question
up vote 9 down vote accepted

The draft option sets \overfullrule to 5pt; so you can say


and say

\ifdraft{do this, we are in draft mode}{do that, we aren't in draft mode}

Note that \ifdraft is not a real conditional, so perhaps it should be named \@ifdraft but this would force you to use it in definitions between \makeatletter and \makeatother.

Of course, you shouldn't be setting \overfullrule yourself.

share|improve this answer

There is also the ifdraft package that does what you want.

It defines \ifdraft{Do in draft}{Do in final} and some others

share|improve this answer

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.