Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am curious to know why the following failed. A similar thread is on comp.text.tex unanswered. Of course, other manipulations of \whileexpr work, but why does this fail?


% Test (worked):
\generaterow{x}{3}% -> x1x2x3

% Failed:

share|improve this question
Please take a look over the questions you've asked and see if you can 'accept' some of the answers. When there is an answer that 'works for you' it's a good idea to accept it. –  Joseph Wright Dec 8 '11 at 22:10
@Joseph: Which questions? This is my first question here in 12 months. Or are you referring to comp.text.tex? I can't find any answer there. –  Ahmed Musa Dec 8 '11 at 22:17
@AhmedMusa: See the questions you've asked on TeX.SX. They're found in your profile. –  Werner Dec 8 '11 at 22:19
We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  Werner Dec 9 '11 at 1:09
Adding to Joseph's suggestion of accepting answers to questions you've asked: At the moment, your user information, which is shown underneath each of your questions, contains 0% accept rate in red letters. This can make others more reluctant to answer your questions. It's generally a good idea to aim for an accept rate above 50%, by accepting answers that answer your question, and improving unanswered questions (or providing bounties). –  Jake Dec 9 '11 at 1:31

1 Answer 1

up vote 3 down vote accepted

I have seen the problem: conditionals can't be split across & in \halign. Each cell is executed in an alignment group. The following worked. It allows the conditional to complete execution before the material (including the alignment character &) is placed/executed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.