[Tex/LaTex] “No suitable columns” error when putting cases in tabulary

casestablestabulary

This code runs fine:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tabulary}
\begin{document}
\begin{tabulary}{\linewidth}{L}
    $ M $\\
\end{tabulary}
\end{document}

But this code produces the message "Package tabulary Warning: No suitable columns! on input line 7.":

\documentclass{article}
\usepackage{amsmath}
\usepackage{tabulary}
\begin{document}
\begin{tabulary}{\linewidth}{L}
    $ \begin{cases} M \end{cases}$\\
\end{tabulary}
\end{document}

Can anyone figure out why this is and/or how to fix it? It also fails if the cases is in an 'l' column (which is actually the case in the production code I'm trying to get working), so it's not just tabulary having trouble with stretching a cases or anything like that. It works just fine in tabular.

I am aware that a warning is not an error, and the code above compiles fine. But the problem in my actual use case is that tabulary gives up on finding suitable columns, and therefore other rows, ones which don't even have a cases in them, run off the page.

Best Answer

Er who knows what tabulary is doing:-)

Something in its setup is confusing the nested cases construct. You could try complaining to the package author and it might get resolved, but if you just want to get on with the document and and make the warning go away, I'd avoid the nesting:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tabulary}
\newsavebox\mybox
\begin{document}
\sbox\mybox{$ \begin{cases} M \end{cases}$}
\begin{tabulary}{\linewidth}{L}
   \usebox{\mybox}\\
\end{tabulary}
\end{document}