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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I defined some macros to store data. Them, I typeset them in a table. If one of the macro is not executed (the corresponding data is not available, the row should not appear.



    \ifthenelse{\isundefined{\theversion}}{}{Version: &\theversion\\}%
    \ifthenelse{\isundefined{\therevised}}{}{Revised by: &\therevised\\}%
    \ifthenelse{\isundefined{\theapproved}}{}{Approved by:&\theapproved\\}%

\revised{J. Joe}
\approved{A. Uthor}

The code runs fine if I comment the \revised{J. Joe} line. But if I comment \approved{A. Uthor}, them the following error is rised:

! Misplaced \noalign.
\bottomrule ->\noalign 
                       {\ifnum 0=`}\fi \@aboverulesep =\aboverulesep \global...
l.34 \mytable

Can anyone help me to find the bug? Thanks in advance.

share|improve this question
up vote 3 down vote accepted

I don't know precisely what's going on, but it's clearly an expansion problem. It can be solved with more direct syntax:


    p{\dimexpr 0.4\linewidth-2\tabcolsep\relax}
    p{\dimexpr 0.6\linewidth-2\tabcolsep\relax}
    \ifdefined\theversion Version: &\theversion\\\fi
    \ifdefined\therevised Revised by: &\therevised\\\fi
    \ifdefined\theapproved Approved by:&\theapproved\\\fi

There's no need to declare those commands as robust. Moreover tabular* is useless and it's necessary to correct the width to take into account the separation between columns.

share|improve this answer
Thanks for the solution. The actual table is defined inside a sidenote of the tufte-latex package, and it is necessary to use the starred version of tabular (I don't know why) – TeXtnik Jul 19 '11 at 7:06

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.