I want to typeset inference rules containing tables (or arrays) in the premises. I'm using the semantic package, which sets the premises (and conclusion) in math mode, so I thought this might work:

\inference{\expr{axis} \in \left\{
    \expr{child}\\ \expr{descendant}
\right\} }{conclusion}

However, this gives me an error message I'm perplexed looking at:

ERROR: Missing \cr inserted.

--- TeX said ---
<inserted text> 
l.56 \right\} }
               {\expr{axis::node-test predicate*} : \<node-set>}
--- HELP ---
From the .log file...

I'm guessing that you meant to end an alignment here.

which is strange, because typesetting the premise alone in a math environment works fine:

\expr{axis} \in \left\{ \begin{array}{l}

Could you shed some light on why am I getting the error message above and how to get rid of it?

PS: \expr{} is basically \texttt{}.


You can "protect" the array from the \inference construction by using braces:

enter image description here

\usepackage{semantic}% http://ctan.org/pkg/semantic
\inference{\expr{axis} \in \left\{
    \expr{child}\\ \expr{descendant}
\right\} }{conclusion}

The reason for this being a problem is because, in a nested way, the \inference macro processes the premises (first argument) expecting a \\; actually, it expects <something>\\<something>\end, and the \\ in your array construction conflicts with this definition.

In this instance, you could also replace \\ with \cr to remove the conflict usage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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