Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}.

share|improve this question
1  
Have a look at tex.stackexchange.com/questions/29973/… –  lockstep Oct 9 '12 at 9:49
add comment

1 Answer

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.

share|improve this answer
    
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 9 '12 at 16:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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