6

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 !?

Output

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
t-bltg
  • 237

2 Answers2

5

For lualatex use

\documentclass{article}
\usepackage[english,french]{babel}
\usepackage{breqn}
\usepackage{unicode-math}
...
user187802
  • 16,850
  • 1
    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 ? – t-bltg Jun 01 '19 at 20:45
  • 1
    No, unicode-math is not experimental. Show your preamble! – user187802 Jun 02 '19 at 04:01
5

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}

enter image description here

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

egreg
  • 1,121,712