I'm trying to build my own cookbook-style, which has an ingredient makro. Sometimes the ingredients should be separated and have a headline, so I tried with an optional argument. A minimum example looks like this:
\documentclass{scrartcl}
\newcommand{\ingredient}[3][]{
#1 #2 & #3 \\
}
\begin{document}
\begin{tabular}{r|l}
\ingredient[\multicolumn{2}{l}{Head} \\]{test1}{test2}
\ingredient[test3]{test4}{test5}
\ingredient{test6}{test7}
\end{tabular}
\end{document}
What's wrong with this code? I get the following error message:
! Misplaced \omit.
\multispan ->\omit
\@multispan
l.7 ...[\multicolumn{2}{l}{Head} \\]{test1}{test2}