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
2

2 Answers 2

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.

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

For lualatex use

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