# Tag Info

12

The main purpose of \string\zzzz is to write something to a file that when read back in produces a command token with name zzzz. The most general way to get the command token with name the empty string is to use \csname\endcsname so TeX defines \string to produce that if the following token is a command token with name the empty string. Another way to get ...

6

This is perhaps the simplest method, note that the cell macro itself is not expanded at all but the loop variables are expanded while constructing the macro. I have to use \& rather than & because of some weirdness in the tikz matrix code, with tabular you could use & rather than \noexpand\&. \documentclass[tikz]{standalone} ...

2

I added the solution similar to the @David's solution, but using the macros \gaddto and \xaddto. The \gaddto adds the unexpanded parameter to the macro and the \xaddto adds the expanded parameter to the macro. The usage (in the loop) is less tricky then using \expandafter\unexpanded\expandafter etc.: ...

2

Token list comparison cannot be expandable, because the only way TeX has for comparing them is to make them the replacement text of macros. However, all the engines (except for Knuth TeX) implement an expandable “string comparison” that basically works with \detokenize (details are a bit more involved). With \usepackage{pdftexcmds} you have available ...

2

Due to how scanning for \noalign works, an unexpandable command (here \futurelet used by \@ifnextchar) starts a new alignment cell and it's too late for a line to be inserted. You have to do the scanning for the optional argument inside a \noalign group: \documentclass{standalone} \makeatletter \def\myline{% \noalign\bgroup \@ifnextchar[% ...

1

I started with the \ifcase code from OP and added two lines in order to create expandable \euppercase macro. \def\euppercaseB#1{\ifcase`#1\relax 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or 10\or11\or12\or13\or14\or15\or16\or17\or18\or19\or 20\or21\or22\or23\or24\or25\or26\or27\or28\or29\or ...

Only top voted, non community-wiki answers of a minimum length are eligible