I encounter various problems when i want to control the display of a table with a ifthenelse
test. For example, consider the following M(non)WE :
\documentclass{article}
\usepackage{multirow}
\usepackage{ifthen}
\newcommand{\essai}[1]{
\begin{tabular}{cc}
a&b \\ \hline
\ifthenelse{\equal{#1}{coucou}}{\multicolumn{2}{|c|}{oui - #1} \\ \hline}{non \\ \hline}
\end{tabular}
}
\begin{document}
\essai{coucou}
\end{document}
If i call \essai{hallo}
, then the ifthenelse
test is false
, and it compiles : the second line of the table has 2 columns, as expected.
If i call \essai{coucou}
, then the test is true
and i would expect to have a multicolumn line. But it gives a compilation error Misplaced \omit...