1

Similar to Doing something only when the draft option is on? I wonder whether I can typeset a code only if the final option is declared within the documentclass line.

 \documentclass[final]{article}

How would I go about doing this?

ingli
  • 853
  • Does it solve your problem? https://tex.stackexchange.com/q/1492 – antshar May 21 '20 at 23:17
  • Thanks @antshar, interesting to read, but, if my skim is correct the suggested solutions there for not point me to how to query for the final option within the document. – ingli May 22 '20 at 08:55

1 Answers1

1

Sorry for the necessity of \makeatletter, but the document class option list is an "internal" command.

\documentclass[final]{article}

\makeatletter \usepackage[\@classoptionslist]{optional}

\begin{document}

test \opt{final}{FFF}\opt{draft}{DDD}\opt{x}{XXX}.

\end{document}

You can, of course, specify specific options to the optional package with

\makeatletter \usepackage[x, \@classoptionslist]{optional}