[Tex/LaTex] French equation numbering using bis, ter, etc

amsmathequationslanguagesnumbering

As a corollary to my other Question "French section numbering using bis, ter, etc", I am looking for a way to number equations by appending "bis," "ter," and other latin suffixes after the equation number.

The figure that follows illustrates the desired output. Note the italic bis and ter in the equation numbers.

enter image description here

I am able to accomplish this with the following MWE:

\documentclass[letterpage,12pt]{book}

\usepackage{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[hyphenation,parindent,lastparline]{impnattypo}
\usepackage[all]{nowidow}
\raggedbottom
\usepackage{verbatim}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[frenchb]{babel}

\begin{document}

Equation no. 1 to follow.
\begin{equation}
(\lambda + \mu) \frac{d\theta}{dx} + \mu\Delta_2u
\end{equation}

Equation no. 1 \textit{bis} to follow

\begin{equation}\tag{1 \textit{bis}}
\theta = \frac{du}{dx} + \frac{dv}{dy} + \frac{d\eta}{dz}
\end{equation}

Equation no. 2 to follow.
\begin{equation}
y = mx + b \\[0.5em]
\end{equation}

Equation no. 2 \textit{bis} to follow

\begin{equation}\tag{2 \textit{bis}}
a^2 + b^2 = c^2
\end{equation}

Equation no. 2 \textit{ter} to follow

\begin{equation}\tag{2 \textit{ter}}
E = mc^2
\end{equation}

Equation no. 3 to follow

\begin{equation}
e^{\pi i}=-1
\end{equation}

Equation no. 4 to follow

\begin{equation}
\cos^2{x} + \sin^2{x} = 1
\end{equation}

\end{document}

However, this syntax lacks the automatic equation numbering that I would like to preserve.

The MWE that follows is my non-working example that I am trying to edit to accomplish the desired output.

\documentclass[letterpage,12pt]{book}

\usepackage{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[hyphenation,parindent,lastparline]{impnattypo}
\usepackage[all]{nowidow}
\raggedbottom
\usepackage{verbatim}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[frenchb]{babel}

\begin{document}

Equation no. 1 to follow.
\begin{equation}
(\lambda + \mu) \frac{d\theta}{dx} + \mu\Delta_2u
\end{equation}

Equation no. 1 \textit{bis} to follow

\begin{equation}
\theta = \frac{du}{dx} + \frac{dv}{dy} + \frac{d\eta}{dz}
\end{equation}

Equation no. 2 to follow.
\begin{equation}
y = mx + b \\[0.5em]
\end{equation}

Equation no. 2 \textit{bis} to follow

\begin{equation}
a^2 + b^2 = c^2
\end{equation}

Equation no. 2 \textit{ter} to follow

\begin{equation}
E = mc^2
\end{equation}

Equation no. 3 to follow

\begin{equation}
e^{\pi i}=-1
\end{equation}

Equation no. 4 to follow

\begin{equation}
\cos^2{x} + \sin^2{x} = 1
\end{equation}

\end{document}

This syntax numbers the second equation as (2) and in ascending order afterward, as one would expect.

I will want to be able to cross-reference these equation numbers as well. How can I go about accomplishing my desired output?

Best Answer

Without expl3, you can convert integers to whatever you want with:

\ifcase#1\or\or bis\or ter\or quater\or quinquies\or
  sexies\or septies\or octies\or novies\or decies\fi

By substituting #1 by the number you want. In this case, we can create a macro, and pass \value{equation} as argument.

In any case, I don't know what's the way the arabic numbers in front of bis and such is incremented. So I create a macro, \latintags to be used inside of a group, that saves the current equation counter and starts using bis, etc.

\documentclass{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{mathtools,amsthm,amssymb}
\usepackage[frenchb]{babel}

\newcommand*\dif{\mathop{}\!d}
\newcommand*\latinnumeral[1]
  {\ifcase#1\unskip\or\unskip\or bis\or ter\or quater\or quinquies\or
     sexies\or septies\or octies\or novies\or decies\fi}
\newcommand*\latintags
  {\xdef\startingequationnumber{\the\numexpr\value{equation}+1\relax}%
   \setcounter{equation}{0}%
   \aftergroup\resetarabicequations
   \def\theequation
     {\startingequationnumber~\textit{\latinnumeral{\value{equation}}}}}
\newcommand*\resetarabicequations
  {\setcounter{equation}{\numexpr\startingequationnumber\relax}}

\begin{document}
\latintags

Equation no. \eqref{abc} to follow.
\begin{equation}
(\lambda + \mu) \frac{\dif \theta}{\dif x} + \mu\Delta_2u \label{abc}
\end{equation}

\bigskip

Equation no. \eqref{def} to follow
\begin{equation}
\theta = \frac{\dif u}{\dif x} + \frac{\dif v}{\dif y} + \frac{\dif \eta}{\dif z} \label{def}
\end{equation}

\end{document}

enter image description here

If (as I imagine) you want this to happen only inside a certain environment, like, e.g., corollary, you can use etoolbox

\usepackage{etoolbox}
\AtBeginEnvironment{corollary}{\latintags}
..
\begin{corollary}
  Equation no. \eqref{abc} to follow.
  \begin{equation}
    (\lambda + \mu) \frac{\dif \theta}{\dif x} + \mu\Delta_2u \label{abc}
  \end{equation}

  \bigskip

  Equation no. \eqref{def} to follow
  \begin{equation}
    \theta = \frac{\dif u}{\dif x} + \frac{\dif v}{\dif y} + \frac{\dif \eta}{\dif z} \label{def}
  \end{equation}
\end{corollary}

Or may be not necessarily inside a theorem like environment, but just a few equations, you can use the {latintags} environment to group them:

\begin{equation}
  A
\end{equation}

\begin{equation}
  A
\end{equation}

\begin{equation}
  A
\end{equation}

\begin{latintags}
  Equation no. \eqref{abc} to follow.
  \begin{equation}
    A \label{abc}
  \end{equation}

  Equation no. \eqref{def} to follow
  \begin{equation}
    A \label{def}
  \end{equation}

  Equation no. \eqref{ghi} to follow
  \begin{equation}
    A \label{ghi}
  \end{equation}

  Equation no. \eqref{jkl} to follow
  \begin{equation}
    A \label{jkl}
  \end{equation}

  Equation no. \eqref{mno} to follow
  \begin{equation}
    A \label{mno}
  \end{equation}

  Equation no. \eqref{pqr} to follow
  \begin{equation}
    A \label{pqr}
  \end{equation}

  Equation no. \eqref{stu} to follow
  \begin{equation}
    A \label{stu}
  \end{equation}
\end{latintags}

\begin{equation}
  A
\end{equation}

\begin{equation}
  A
\end{equation}

\begin{equation}
  A
\end{equation}

\begin{equation}
  A
\end{equation}

enter image description here

Related Question