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
6

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.

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

For lualatex use

\documentclass{article}
\usepackage[english,french]{babel}
\usepackage{breqn}
\usepackage{unicode-math}
...
  • 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 ? – neok Jun 1 at 20:45
  • 1
    No, unicode-math is not experimental. Show your preamble! – Red-Cloud Jun 2 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.