# Restore original definition of $I found an incompatibility between onlyamsmath and tabu, related to the redefinition of the $-sign. (Its is an active char, and thus breaks inside tabu columns specifiers). This is triggered with:

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,error]{onlyamsmath}
\usepackage{tabu}
\begin{document}
\begin{tabu} to 0.6\textwidth{X[c]X[c]X[$c]} a & b & c\\ \end{tabu} \end{document}  If I could restore the original definition of $ at the beginning of the document I could work around the bug. Note that I want to include this 'bugfix' in a package and can not rely on the correct loading order. So I do not want to enforce loading before onlyamsmath.

-

You can patch the tabu environment so that it sets the correct catcode

\usepackage{tabu}
\usepackage{etoolbox}
\AtBeginEnvironment{tabu}{\catcode$=3 }  In this way the "protection" given by onlyamsmath is disabled only inside the tabu environment. - add comment You need to set the catcode of $ back to its normal value of 3. However, onlyamsmath does this at-begin-document and you need to change it back after that. In order to ensure that, you can use the filehook package and then:

\AtEndOfPackageFile*{onlyamsmath}{\AtBeginDocument{\catcode\$=3\relax}}  Which will install the required code in the at-begin-document hook at the end of onlyamsmath, if it gets loaded or immediately, if it was already loaded. Full example (both orders work): \documentclass{article} \usepackage{amsmath} \usepackage{filehook} \AtEndOfPackageFile*{onlyamsmath}{\AtBeginDocument{\catcode\$=3\relax}}

\usepackage[all,error]{onlyamsmath}
\usepackage{tabu}

%\usepackage{filehook}
%\AtEndOfPackageFile*{onlyamsmath}{\AtBeginDocument{\catcode\$=3\relax}} \begin{document} \begin{tabu} to 0.6\textwidth{X[c]X[c]X[$c]}
a & b & c\\
\end{tabu}
\end{document}

-
This disables many of the features of onlyamsmath. –  egreg Nov 17 '11 at 11:39
@egreg: I guessed so, but I simply delivered as ordered. –  Martin Scharrer Nov 17 '11 at 12:06