I've been trying to understand the notion of recursion in TeX - not easy given that my background is the high-level stuff in LaTeX. The only examples I can (just about) understand are very basic for-loop constructions, but I don't really feel like I have a picture for what expansion is or how it works.
I'd like to write a function that will take as its argument a group
{{#1}{#2}...{#n}}
where n can take any positive-integer value, and return the pair of groups
{#1}{{#2}...{#n}},
when n is at least 2, and {#1} otherwise.
This seems like it should be reasonably simple to do, but I don't know how I'd go about it.
edit: I want to use this function in beamer to progressively overlay lines inside AMSMath environments such that
- Vertical spacing is preserved;
- Equation numbering (where applicable) appears in-time with the displayed lines of the equation array, and is preserved (i.e. not incremented) between overlays.