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 am using the package todonotes in order to handle my TODOs. As written in the manual, one can define a custom TODO command like that:

\newcommand{\feedbackRequired}[1]{\todo[color=red!70]{#1}}

This works in general if one uses it without any options:

\feedbackRequired{Do I have to do that, supervisor?}

But unfortunately, it is not possible to use the new command and give it some extra options like that:

\feedbackRequired[inline]{Do I have to do that, supervisor?}

This will break the output. The tex file will still be compiled, but the TODO note output in the PDF is broken:

enter image description here

How can I solve that problem?

share|improve this question
2  
Your command is not defined for optional arguments –  Christian Hupfer Aug 6 at 8:10
    
Please add a MWE in order to see which packages etc. you use otherwise. Consider a retag to macros, as the problem is not directly to todonotes but rather to the usage of macros and optional parameters –  Christian Hupfer Aug 6 at 8:15
    
I will next time. This time I already thought that this will be an easy pick for people who really understand LaTeX :-) –  Simon Aug 6 at 8:18
    
Yes, I can understand that, but guessing around about packages, documentclass... it's tedious. I have to admit, however, that the principial issue of your requestion is not related to a particular class/package –  Christian Hupfer Aug 6 at 8:20

1 Answer 1

up vote 5 down vote accepted

For an optional argument, you must use

\newcommand{\feedbackRequired}[2][]{\todo[color=red!70,#1]{#2}}

The second [] holds the optional argument, in this case it is predefined to be empty, but later on, in your example, it will be inline. Your actual note is contained in the 2nd argument.


\documentclass{scrartcl}

\usepackage{todonotes}%
\usepackage{xcolor}%


\newcommand{\feedbackRequired}[2][]{\todo[color=red!70,#1]{#2}}



\begin{document}

\feedbackRequired{Do I have to do that, supervisor?}

\feedbackRequired[inline]{Do I have to do that, supervisor?}


\end{document}

enter image description here

share|improve this answer

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.