I am using a precompiled preamble with the \documentclass inside. However, I sometimes want to change the document to 'draftmode'. Recompile the preamble everytime I am doing this is not so comfortable. So it is somehow possible to activate the draftmode even after the command \documentclass in the preamble?

  • Yes, this is possible, but it may depend on what you mean by "recompile the preamble". Can you provide some code that explains your setup and how you change things to switch between draft and non-draft mode at the moment? – Werner Aug 27 '18 at 22:54
  • Try \PassOptionsToClass{draft}{article} before the precompiled preamble – aloneprism Aug 27 '18 at 23:01
  • My code looks overall 'normal' I just use Mylatexformat which creates a .fmt file which consits of the preloaded preamble (so loading all the usepackages etc.) I also added the \documentclass in this precompiling so everytimt I have to change something inside documentclass I can do so but then recompile it again to make changes take effect. Besides this my code is completely normal I can still disable the function and run the code in the normal way – SRel Aug 27 '18 at 23:02
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Sep 13 '18 at 9:32

The full definition of the draft option in the standard classes is


so you can get the equivalent effect by doing


at any point.

However using [draft] on document class makes it a global option so it may have had an effect on packages you have loaded (but you have not given any information on which packages).

Most packages will ignore it, some may just set a flag to true for draft mode, in which case you may be able to set that flag to false, but some packages may alter the code loading and so not load the "normal" code at all in draft mode. The behaviour is all specific to each packages handling of any draft option that it has.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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