# Rmathbr doesn't work with \coloneqq

I was creating one complex tikz-flow chain. One moment compiler stopped working. I was trying to get why.

And I found that the following MWE causes that

\documentclass{article}

\usepackage{empheq}
\usepackage{tikz}
\usepackage{rmathbr}
\begin{document}
$b\coloneqq b - F$
\end{document}

(\coloneqq is getting from empheq in addition)

I am not expert in LaTeX so it's difficult for me to find the reason of incompatibility of them in the code of packages. But I really need both of them in my work.

• As far as I can tell it is an error (catcode) caused by rmathbr. Without the package it works. Apr 15 '17 at 10:50
• @TeXnician yes, that's the question :)
– user98432
Apr 15 '17 at 10:52
• It was just to reassure that you also have the catcode error (there is another one when loading the packages in other order). Apr 15 '17 at 10:54
• @TeXnician for me the strangest thing that if I load tikz compiler says that I forgot { }-brackets. and some ways to write := don't work also. I tried \mathrel{\mathop:}=
– user98432
Apr 15 '17 at 11:00
• Btw empheq us not relevant here, mathtools is (it is autoloaded by empheq) Apr 15 '17 at 12:39

The rmathbr package is quite invasive and it's not surprising it doesn't behave with other packages.

Here's a fix.

\documentclass{article}
\usepackage{empheq}

% fix \ordinarycolon and define \ordinaryequals
\edef\ordinarycolon{\mathchar\the\mathcode: }
\edef\ordinaryequals{\mathchar\the\mathcode= }

\usepackage{rmathbr}
% don't change the category code of ^ here!
\catcode^=7

\AtBeginDocument{%
% do the category code change later
\catcode^=12
% fix \coloneqq to be a mathrel also for rmathbr
\def\coloneqq{%
\mathrel{{\mathop\ordinarycolon}\mkern-1.2mu{\ordinaryequals}}%
}%
}

\begin{document}

$b\coloneqq b - F$

\end{document}

• Thanks. I appreciate that. I hope, in future I will have time to read some books, material in order to become true LaTeXpert.
– user98432
Apr 15 '17 at 11:23
• @barbarabeeton Probably so. Fixed. Apr 15 '17 at 17:18