1

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?

4
  • 1
    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 Jul 17, 2016 at 7:33
  • \usepackage{xcolor} worked! Thanks! Can you put the comment as an answer? I can accept it then.
    – stebahpla
    Jul 17, 2016 at 7:36
  • I'm voting to close this question as off-topic because it was solved by the comment below the question Jul 17, 2016 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, 2016 at 13:42

1 Answer 1

2

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}

to your document.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .