[texhax] recursive macro in latex

Mario Cupelli mario.cupelli at hightec-rt.com
Thu Jun 14 09:45:23 CEST 2007


Hi,

for my documentation a need a recursive macro for adding menu item in
the text.

I want to write

\menu{item1}{item2}...{itemn}

and this should be replaced by

\textbf{item1} $\rightarrow$ \textbf{item2} ... $\rightarrow$ \textbf{itemn}

Karl sent this macro to me but it does not compile correctly.

\def\menu#1#2{%
\def\argone{#1}%
\ifx\argone\empty
% do nothing, done
\else
\textbf{#1} $\rightarrow$ \textbf{#2}% typeset this item
\expandafter\menu
\fi
}

Thanks for your help and happy texing.

Regards,

Mario



More information about the texhax mailing list