0

I am having a bug: when I want to use both stmaryrd for \llbracket and french babel in some book I am writing, compilation never ends. Happens on my local machine and on Overleaf.

Here is some MWE:

\documentclass{book}

%General setup \usepackage[margin=2.5cm]{geometry} \usepackage{graphicx} \usepackage{amssymb} \usepackage{amsmath} \usepackage{enumitem} \usepackage{commath} \usepackage{stmaryrd} \usepackage{import} %Custom style \renewcommand{\partname}{Partie} \renewcommand{\contentsname}{Sommaire} \renewcommand{\chaptername}{Thème} \setcounter{tocdepth}{4} \setcounter{secnumdepth}{4}

\usepackage{hyperref}

\makeatletter @addtoreset{chapter}{part} \makeatother

\usepackage[frenchb]{babel}

\title{My title} \date{Today} \author{Kal}

\begin{document}

\maketitle

\newpage

\begin{center}\Large \textit{Préambule} \end{center}

\bigskip

\begin{equation} \forall k \in \llbracket 1 : N \rrbracket, : i_k = \frac{G_k}{\sum\limits_{l=1}^N G_l} i \end{equation}

\end{document}

I tried everything, and the only thing I can tell you is that commenting the babel import on the MWE does the trick and gets it to compile. However, I cannot do this in the whole document. I am really stuck, especially without any error message...

Mico
  • 506,678
Kal8578
  • 175
  • 2
    the problem is the commath package, and if you search on the site you will find a number of questions reporting problems. – Ulrike Fischer Apr 19 '23 at 22:59

1 Answers1

2

As pointed out by Ulrike, this is not a conflict between stmaryrd and babel-french, but between commath and babel-french. See Incompatibility between commath and babel packages

The commath makes the colon active, this conflicts with babel-french also making it active. As commath doesn't seem to be maintained (last update 2006), I could suggest to comment out lines 281-286 in commath.sty. If := needs to be patched in math mode (that's the only purpose of making the colon active), there are alternatives (mathtools.sty f.i.).

A cleaner solution would be to pick up the commands you really need in commath.sty, to add them to your preambule (or to a personal style file) and to drop the call to commath.sty.

B.t.w, I would suggest to add \usepackage[T1]{fontenc} as recommended by babel-french and also \usepackage{lmodern} to get the Latin Modern fonts instead of the "cm-super" fonts.

Daniel Flipo
  • 2,059
  • Thanks a lot, I was miles away from even imagining that the problem could be the : and not a command such as \llbracket ! Hence I did not make enough test to conclude about this incompatibility by myself. Lesson learned on that ! Also thanks for your detailed explanation and advice, which I'll follow. – Kal8578 Apr 20 '23 at 15:52