# \mathbb{Z} is not working properly for \not?

I am using pdflatex on Ubuntu 20.04.2. I wrote the following latex code.

\documentclass{article}
\usepackage{amssymb,breqn}
\newcommand{\bZ}{{\mathbb Z}}
\newcommand{\lhdZl}{\lhd_{\bZ^{l}}}
\begin{document}
\begin{align}
a &\not\lhdZl b\\
a &\not\lhd_{\bZ^{l}} b
\end{align}
\end{document}


It seems to me that two lines in the align environment are supposed to give the same expressions, because the first one uses \lhdZl, which is defined as \lhd_{\bZ^{l}}, and the second one just uses \lhd_{\bZ^{l}}. However, the resulting pdf below puts the first one not with the \mathbb Z and the second one with the \mathbb Z.

Is there something wrong?

The obvious problem is breqn.

A couple of fixes at the beginning:

1. the correct syntax is \mathbb{Z}, not {\mathbb Z};

2. \lhd is not defined as a binary relation symbol.

Fix without breqn:

\documentclass{article}
\usepackage{amsmath,amssymb}

\newcommand{\bZ}{\mathbb{Z}}
\newcommand{\nsg}{\mathrel{\lhd}} % normal subgroup
\newcommand{\nsgZl}{\nsg_{\bZ^{l}}}

\begin{document}

\begin{align}
a &\not\nsgZl b\\
a &\not\nsg_{\bZ^{l}} b
\end{align}

\end{document}


Now let's try with breqn. No, it doesn't work. Sorry. What can you do? Don't use breqn.

Apparently, breqn (or, rather, flexisym) wants to see an explicit _ after the negated symbol and hiding it in a macro will ruin everything. And, for strange reasons, making \lhd into a binary relation symbol will make \not unable to recognize it as such. Which is a bug in breqn: for instance, also \not\sqsubset produces a correct result.

• Thank you for your answer! It's very clear. I hope the bug gets fixed, because sometimes I use breqn for the dmath environment. – veo May 9 at 10:09