I want to define a command to abstract a complexe table environment with vairable rows. Here is a simple demo:
\documentclass{article}%
\usepackage{tabularx}%
\begin{document}
\begin{tabularx}{\textwidth}{|X|X|}\hline
name 1 & description 1\\
\hline
name 2 & description 2\\
\hline
\end{tabularx}
\end{document}
According the answer of @egreg in this question: New command with variable number of parameters
I define a macros like that in the answer https://tex.stackexchange.com/a/72915 :
\makeatletter %
\newcommand{\members}{
\tabularx{\textwidth}{|X|X|} \hline
\@stepone}
\newcommand\@stepone{\@ifnextchar\stopmembers{\@membersend}{\@steptwo}}
\newcommand\@steptwo[2]{
#1 & #2 \\ \hline
\@stepone}
\newcommand\@membersend[1]{
\endtabularx
}
\makeatother
I want to use it like:
\begin{document}
\members
{name 1}{description 1}
{name 2}{description 2}
\stopmembers
\end{document}
But, something wrong when compile:
Misplaced \crcr. \end{document}
Extra }, or forgotten $. \end{document}
Extra }, or forgotten $. \end{document}
Undefined control sequence. \end{document}
Package array Error: Illegal pream-token (\AtEndOfPackage): `c' used. \end{document}
Extra }, or forgotten $. \end{document}
Missing $ inserted. \end{document}
Someone can help me? Thanks avance!

.csvand then simply use something likedatatoolorcsvsimple. You likely find such a solution easier in virtually every respect. – jon Dec 03 '16 at 15:05