# How to add equation with cases inside the table

I want to include the complicated equation into one of the cells of my table. I am using tabular environment, additionally I have some multirows. I would like to add something like this:

\begin{table}
\centering
\begin{tabular}{l||p{6.5cm}|p{6cm}|p{3cm}|}
\multirow{2}{*}{Problem}
& a=3 & description & something \\
&
$l= \begin{cases} a when sth \\ b when sth else \\ c when elsewhere; \end{cases}$
& & \\
\end{tabular}
\end{table}


The problem is precisely when I need to use \\ in purpose of proper cases environment look. In such a case it simply (compiler) get frozen... until whole processor is 'consumed'. Anyway anyone knows how to put the function, equation with cases into table?

• Welcome to tex.sx. It would be much easier to answer the question if you edited it to make a complete document that showed the problem so that it can be reproduced. In general it should just work, but it is not easy to see what is wrong just from fragments of code. May 7, 2013 at 22:38

If I make a document from your fragments, it processes without error:

\documentclass{article}
\usepackage{amsmath,multirow}

\begin{document}
\begin{tabular}{cp{5cm}cc}
\multirow{2}{*}{Problem}
& equation 1 & description & something \\
& equation which contains cases
$l= \begin{cases} a &\text{when sth }\\ b &\text{when sth else} \\ c &\text{when elsewhere;} \end{cases}$ & & \\
xx&yy&zz
\end{tabular}
\end{document}

• Thanks for your replay and indeed after I made some tests it works in the empty document. Although as soon I glue the code into my article problem occurs. Now I suspect some strange interaction with one of the other packages, functions I am using... Nevertheless rather strange problem... May 7, 2013 at 23:09
• @mihau That's why we always ask people to post a complete document: start with the document with the problem, remove any text and packages that you can while keeping the problem, then post the resulting test document. (Of course often while making the minimal example you spot what the problem is as you see removing some package fixes it, then you don't need to post at all:-) Feel free to edit your question if you do make a test case. May 7, 2013 at 23:17