I want to have the beginning and end of a tabularx table appear only in some cases, but this does not seem to be possible. I get a "Runaway argument error". Why is wrong, or is this kind of construction impossible?
Here is a minimal example:
\documentclass[a4paper,12pt]{book}%
\usepackage[utf8]{inputenc}
\usepackage[swedish]{babel}
\usepackage{tabularx}
\usepackage{ifthen}
\newboolean{thing}
\begin{document}
\setboolean{thing}{false}
\chapter*{Testchapter}
\ifthenelse{\boolean{thing}}{}{\begin{tabularx}{7cm}{|c|X|}}
3&5\\
\ifthenelse{\boolean{thing}}{}{\end{tabularx}}
\end{document}
(Of course, in my real document the "3&5\" line is replaced with something that is not a table in the cases where "thing" is true.)

ifthenpackage obsolete? – Werner Jul 30 '18 at 20:52