# Bug using breqn and babel

I've hit a bug that I cannot fix (no warnings/errors in the logs).

Here is a mwe:

\documentclass{article}
\usepackage[english,french]{babel}
\usepackage{breqn}

\begin{document}
$\{A, B, C\}$

\selectlanguage{french}
$\{A, B, C\}$

\selectlanguage{english}
$\{A, B, C\}$
\end{document}


I use the following command to compile:

$latexmk -lualatex bug.tex  The output is as follows, the commas are mapped to a \Gamma symbol !? Does anyone have a clue on how to fix this ? $ lualatex --version
This is LuaTeX, Version 1.07.0 (TeX Live 2018)
\$ latexmk --version
Latexmk, John Collins, 17 Jan. 2018. Version 4.55

• breqn is a nice proof-of-concept, but it's incompatible with a wealth of packages. Jun 1, 2019 at 20:27
• Jun 1, 2019 at 20:28

The babel-french module does \std@math@comma upon entering and also exiting French language blocks.

This resets the mathcode for the comma to the standard, but breqn wants that the mathcode stays "8000.

Simply make \std@math@comma to do nothing.

\documentclass{article}
\usepackage[english,french]{babel}
\usepackage{breqn}

\makeatletter
\let\std@math@comma\relax
\makeatother

\begin{document}

$\{A, B, C\}$

\selectlanguage{french}
$\{A, B, C\}$

\selectlanguage{english}
$\{A, B, C\}$

\end{document}


You should be aware that breqn is not really compatible with several package and is better not used in serious typesetting tasks.

• Great investigation egreg, many thanks for the detailed explanations ! Jun 1, 2019 at 22:46

For lualatex use

\documentclass{article}
\usepackage[english,french]{babel}
\usepackage{breqn}
\usepackage{unicode-math}
...

• Thanks, this works for this particular mwe but throws tons of errors for my huge document. I also see that unicode-math is quite eqperimental ? Jun 1, 2019 at 20:45
• No, unicode-math is not experimental. Show your preamble! Jun 2, 2019 at 4:01