I'm writing some documentation about some macros I've made up. (I know there will probably be comments about the macros too, but that's not what I'm asking about.) Ideally, I'd like to make a sort of table where each row lists the macro itself, the result, and a comment. Here is a MWE that shows what I'm currently doing and what I'd like to do:
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{xparse}
\usepackage{lmodern}
\usepackage{listings}
\usepackage[most]{tcolorbox}
\DeclareTCBListing{macrobox}{s G{} }{IfBooleanTF={#1}{}{listing side text},title=#2,
listing options={style=tcblatex,commentstyle=\color{red!70!black}}
}
% Funny macro - don't worry about this part
\NewDocumentCommand{\TnidxRoot}{m m m m m m m}{%
{#1}{1} #2 %
\IfBooleanF{#5}{{#1}{2} #2} %
\IfBooleanTF{#6}{ %
{#1}{3} % 3D
\IfBooleanT{#7}{#2 {#1}{4} } % 4D
}{ %
\IfBooleanTF{#3}{\cdots}{\dots} #2 {#1}_{#4} %
}%
}
% Funny macro - don't worry about this part
\NewDocumentCommand{\Tnsz}{s s t! G{n} O{d}}{%
\TnidxRoot{#4}{\times}{\BooleanTrue}{#5}{#3}{#1}{#2}%
}
\begin{document}
What I currently do is this:
\begin{macrobox}{Size commands}
$\Tnsz$ \ % Default
$\Tnsz!$ \ % Compact, no 2nd index
$\Tnsz{m}$ % Change main letter
\end{macrobox}
But I'd like a nice macro to generate rows of the following table, where the macro for row 1 might be something like \verb|\ExampleRow{\Tnsz}{Default}|.
\begin{tabular}{|l|l|l|}
\hline
\LaTeX\ Command & Result & Description \ \hline
\verb|\Tnsz| & $\Tnsz$ & Default \ \hline
\verb|\Tnsz!| & $\Tnsz!$ & Compact, no second index \ \hline
\verb|\Tnsz{m}| & $\Tnsz{m}$ & Change main letter \ \hline
\end{tabular}
\end{document}




