2

I have defined a new command for each of the team members in my project group to add individual todo-notes with different color and name.

Now I would like to add another option, but is having trouble with the syntax.

Here is the current definition of the command:

% TODO thilemann
\newcommand{\thilemann}[2][ ]
{
  \ifthenelse{\equal{#1}{inline}}
    {\todo[inline, size=\small, color=NavyBlue!35]{\textbf{\color{NavyBlue}{Thilemann:} } #2}}
    {\todo[size=\small, color=NavyBlue!35]{\textbf{\color{NavyBlue}{Thilemann:} } #2}}
}

How is it possible to add another option to the above code? What I want is basically to define a todo as "mine" which should underline the name (Thilemann:).

I would like the syntax to be something like \thilemann[mine]{Notes here} or if it is an inline todo \thilemann[mine][inline]{Notes here} (or \thilemann[mine, inline]{Notes here}.

Corentin
  • 9,981
thilemann
  • 369
  • 3
  • 11
  • 1
    Have a look at http://tex.stackexchange.com/questions/29973/more-than-one-optional-argument-for-newcommand – lockstep Oct 09 '12 at 09:49

1 Answers1

3

It would have been easier with a complete document showing which packages you are using (I think this is todonotes). Since you are already using a keyval syntax I think I would use the same here so define

\define@key{mykeys}{mine}[true]{%
...
}

\define@key{mykeys}{inline}[true]{%
...
}

Then in your code activate these with

\setkeys{mykeys}{#1}

so usage would be

\thilemann[mine, inline]{Notes here}.

If it is todonotes I think that uses the extended xkeyval package syntax in which case you should use that.

David Carlisle
  • 757,742
  • Sorry, I'm quite new to custom commands and it doesn't seem like I can get the syntax put together the right way :/ – thilemann Oct 09 '12 at 16:43