When I use the xcolor package, I can pass the option monochrome, which turns all colors into black. Is it possible to define commands \mono and \notmono that will print their content only if the option monochrome is/isn't given?
Say,
\documentclass{report}
\usepackage[
% monochrome
]{xcolor}
\newcommand{\notmono}[1]{???} % No idea how to define this
\newcommand{\mono}[1]{???} % No idea how to define this
\begin{document}
\mono{Print this only if option monochrome IS given to xcolor.}
\notmono{Print this only if option monochrome is NOT given to xcolor.}
\end{document}
EDIT: I could define
\newcommand{\mono}[1]{}
\newcommand{\notmono}[1]{#1}
in case I do not give the monochrome option, and redefine them when necessary to
\newcommand{\mono}[1]{#1}
\newcommand{\notmono}[1]{}
But I'd still like to know if there is a better way of doing that.




@ifpackagewith) – user202729 Nov 03 '22 at 16:34