How would one define a newcommand so that it can be used for attributes?
I have \somecommand which I can pass attributes, for example color=black in square brackets.
Now I want to have a newcommand to do something like this:
\newcommand{\anewcommand}{color=black}
\begin{document}
\somecommand[\anewcommand]
\end{document}
Although the anewcommand holds the same value as I would pass by typing it out, it doesn't work and tells me that my attributes are not defined.
Well. The \somecommand is actually the ganttbar command of the gantt.sty package. I want to have \newcommand{\person}{color=black} and then pass \person to \ganttbar[\person]. hope this clarifies it more.
MWE:
\documentclass[paper=a4,landscape]{scrartcl}
\usepackage[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{gantt}
\newcommand{\person}{color=black}
\begin{document}
\begin{gantt}[xunitlength=0.8cm,fontsize=\small,titlefontsize=\small,drawledgerline=true]{2}{7} %{# of tasks}{# of slots}
\begin{ganttitle}
\titleelement{week 1}{7}
\end{ganttitle}
\ganttbar[color=NavyBlue]{localization}{3}{3} % this works
\ganttbar[\person]{Bla}{1}{1} % this doesn't
\end{gantt}
\end{document}
\somecommand,\anewcommandmay be used directly or expanded. We need more context to give a good answer. – Joseph Wright♦ Jun 20 '12 at 10:04