I'm trying to replace a single option (e.g., width=2mm
or colour=green
or dotted
) with a simple \newcommand
. I`m imagining something short like \w2
, \cg
, or \qst
, just for typing speed (especially with the option=something
ones).
What I'm specifically trying to do:
\usepackage{todonotes}
\newcommand{\q}{color=green}
\todo[\q]{my text goes here}
I'm given an error that reads "Package xkeyval Error: `color=green' undefined in families todonotes'.
Now, the package gives an alternative to this, which is to fully write out the whole line as a new command, i.e.:
\newcommand{\q}{\todo[color=green]{my text goes here}}
\newcommand{\q}[1]{\todo[color=green]{#1}}
Which is not terrible, but now I'm just curious how I can set one option as a command, since I haven't been able to find it anywhere, and I'm sure I'll want to do this in the future.
Update Looks like my speediest version is to do:
\newcommand{\q}[2][]{\todo[color=green, #1]{#1}}
So I can still change other options as normal.