# Newcommand not working in Lyx

I am using lyx for writing a latex document. The following is the preamble in Document > Settings:

\usepackage{fullpage}

\newcommand{\authnote}[1]{\textcolor{green}{\small {\textbf{(Auth:} #1\textbf{) }}}}

\usepackage{hyperref}


And the document contains only 1 line:

In the Ctrl+L environment: \authnote{aa}

It is giving an undefined control sequence error. What's the problem?

• Which sequence is reported is undefined? You use \textcolor so you need to load a package that defines that command, e.g. color or xcolor – Andrew Swann Jul 17 '16 at 7:33
• \usepackage{xcolor} worked! Thanks! Can you put the comment as an answer? I can accept it then. – stebahpla Jul 17 '16 at 7:36
• I'm voting to close this question as off-topic because it was solved by the comment below the question – Stefan Pinnow Jul 17 '16 at 11:41
• @StefanPinnow I would understand that it is off-topic as a package was missing. But answered in comments doesn't make something off-topic right? Also as the question has a real answer. You could also find a duplicate, but to me an undefined control sequesnce would be off-topic, as there are indefinitely many typos. – Johannes_B Jul 17 '16 at 13:42

Your command contains the macro \textcolor. This is not part of standard LaTeX, so you need to load an appropriate package. The two main choices are the color package from the graphics bundle, and the xcolor package which is an extension with many more predefined color names and access to different color models. So I suggest you add
\usepackage{xcolor}