I would like to automate the use of the following arrays. In the first one, the only arguments which change are \verb!\eqDef!, the commands tested, and A \eqDef B, the visual test.
My problem is that I would like one solution which also allows to use 1, 2, 3 or 4 commands tested ? In the second array, the commands tested are \verb!\eqDef!, \verb!\eqTest!, \verb!\eqVerif! and \verb!\eqId!, and the visual tests are A \eqDef B, A \eqTest B, A \eqVerif B and A \eqId B.
I give one file with the commands proposed in my examples.
One command tested --> Two columns
\[
\renewcommand{\arraystretch}{1.2}%
\begin{array}{llll}
\textbf{Style} & \verb!\eqDef!
\\ \hline
\verb!\displaystyle! & \displaystyle A \eqDef B
\\
\verb!\textstyle! & \textstyle A \eqDef B
\\
\verb!\scriptstyle! & \scriptstyle A \eqDef B
\\
\verb!\scriptscriptstyle! & \scriptscriptstyle A \eqDef B
\end{array}
\]
Four commands tested --> Five columns
\[
\renewcommand{\arraystretch}{1.2}%
\begin{array}{lllll}
\textbf{Style}
& \verb!\eqDef! & \verb!\eqTest!
& \verb!\eqVerif! & \verb!\eqId!
\\ \hline
\verb!\displaystyle!
& \displaystyle A \eqDef B & \displaystyle A \eqTest B
& \displaystyle A \eqVerif B & \displaystyle A \eqId B
\\
\verb!\textstyle!
& \textstyle A \eqDef B & \textstyle A \eqTest B
& \textstyle A \eqVerif B & \textstyle A \eqId B
\\
\verb!\scriptstyle!
& \scriptstyle A \eqDef B & \scriptstyle A \eqTest B
& \scriptstyle A \eqVerif B & \scriptstyle A \eqId B
\\
\verb!\scriptscriptstyle!
& \scriptscriptstyle A \eqDef B & \scriptscriptstyle A \eqTest B
& \scriptscriptstyle A \eqVerif B & \scriptscriptstyle A \eqId B
\end{array}
\]
One functionnal code
% Source : http://tex.stackexchange.com/questions/35404/is-there-a-wider-equal-sign
\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{graphicx}
\makeatletter
\newcommand{\@@eqLikeDef}[3]{%
\ensuremath{\overset{\mathclap{\text{\scalebox{#1}{#2}}}}{#3}}%
}
\newcommand*{\@eqLikeDef}[2]{
\mathchoice
{% \displaystyle
\@@eqLikeDef{0.7}{#1}{#2}
}
{% \textstyle
\@@eqLikeDef{0.7}{#1}{#2}
}
{% \scriptstyle
\@@eqLikeDef{0.6}{#1}{#2}
}
{% \scriptscriptstyle
\@@eqLikeDef{0.5}{#1}{#2}
}
}
\newcommand*{\eqDef}{\@eqLikeDef{Def}{=}}
\newcommand*{\eqTest}{\@eqLikeDef{Test}{=}}
\newcommand*{\eqVerif}{\@eqLikeDef{?}{=}}
\newcommand*{\eqId}{\@eqLikeDef{Id}{=}}
\makeatother
\begin{document}
\section{Equality Signs}
\[
\renewcommand{\arraystretch}{1.2}%
\begin{array}{lllll}
\textbf{Style}
& \verb!\eqDef! & \verb!\eqTest!
& \verb!\eqVerif! & \verb!\eqId!
\\ \hline
\verb!\displaystyle!
& \displaystyle A \eqDef B & \displaystyle A \eqTest B
& \displaystyle A \eqVerif B & \displaystyle A \eqId B
\\
\verb!\textstyle!
& \textstyle A \eqDef B & \textstyle A \eqTest B
& \textstyle A \eqVerif B & \textstyle A \eqId B
\\
\verb!\scriptstyle!
& \scriptstyle A \eqDef B & \scriptstyle A \eqTest B
& \scriptstyle A \eqVerif B & \scriptstyle A \eqId B
\\
\verb!\scriptscriptstyle!
& \scriptscriptstyle A \eqDef B & \scriptscriptstyle A \eqTest B
& \scriptscriptstyle A \eqVerif B & \scriptscriptstyle A \eqId B
\end{array}
\]
\end{document}



collcellpackage - that is, LaTeX provides boxing capability by default. Regardless, I like your approach to keep the entire structure and filter columns. – Werner Nov 20 '11 at 16:43