I am trying to redefine the figure environment, which works fine in general. However, if the body of the figure environment to be replaced includes a tabular environment inside a conditional expression, I receive the error
"Incomplete \ifx; all text was ignored after line 11"
I find this pretty surprising, since my renewed environment does not even used that body. It does not strictly depend on tabular, a tikzpicture raises the same error. Also, it does not depend on \ifpdf, other valid conditionals raise the same error, too.
This is my code:
\documentclass{article}
\usepackage{environ}
\RenewEnviron{figure}{It's gone!}
\usepackage{ifpdf}
\begin{document}
\begin{figure}
\ifpdf
\begin{tabular}{l}
This works without RenewEnviron, ifpdf or tabular!
\end{tabular}
\else\fi
\end{figure}
\end{document}
tabularin a group. – campa Jan 30 '19 at 07:55\usepackage{newenviron}and\renewenviron{figure}{It's gone!}fixes the issue, too. – bers Jan 30 '19 at 08:24