1

I'm currently writting my thesis and I have to record two introductions (environment \chapter*) : one in French and one in English. Since the informations and equations are exactly the same, I would like to use the same numerotation for both chapter. But it seems like latex considers that the two environments chapter* belong to the same chapter.

Do you have any idea to fix my problem? This is an example:

\documentclass[a4paper,10pt,french,reqno]{amsbook}    
\usepackage[utf8x]{inputenc}  
\usepackage[T1]{fontenc}  
\usepackage[reqno]{amsmath}  
\usepackage{amsfonts}  
\usepackage{amssymb}  
\usepackage{amsthm}  
\usepackage[english]{}  
\usepackage{hyperref}

\numberwithin{equation}{chapter}

\begin{document}
\mainmatter

\chapter*{French}  
\section{Section 1}  
\begin{equation}\label{eq1_FR}  
x=y  
\end{equation}  
La première équation \eqref{eq1_FR}.  

\chapter*{English}  
\stepcounter{chapter}  
\addtocounter{chapter}{-1}  
\section{Section 1}  
\begin{equation}  
\label{eq1_EN}  
x=y  
\end{equation}  
I cite the first equation \eqref{eq1_EN} of the chapter "English", but the hyperref sends me to the equations \eqref{eq1_FR}, even if there are well labeled.  

\chapter{First chapter}  

\begin{equation}  
\label{chap1}  
x=y  
\end{equation}  

There is no problem for this equation \eqref{chap1}.  
\end{document}  

Thanks!

  • 1
    Welcome to TeX.SX! Maybe \setcounter{equation}{0} after the second \chapter*? – egreg Sep 10 '18 at 9:47
  • One solution could be to reset the counter for equations \setcounter{equation}{0}. But I don't know if this is a good solution. – faltfe Sep 10 '18 at 9:48
  • I haven't tested this, but: If, after \begin{chapter*}, you insert \stepcounter{chapter}, then all the counters that should be reset at a chapter start should be reset. Follow it by \addtocounter{chapter}{-1} in order not to mess up chapter numbering. Of course, if \theequation, \thesection and so on contain a reference to the chapter number, you have a bigger problem. But I trust you realize that, and know what to do if so. (If this works, let me know in a comment, and I'll convert it to an answer.) – Harald Hanche-Olsen Sep 10 '18 at 11:02
  • First of all, thanks a lot for your help! All of these solutions works fine, and it gives the right numerotation. However, the hyperlink of an equation in the second introduction (\eqref{intro2:eq1}) leads me to the right equation but in the first introduction (\label{intro1:eq1}). I have the same problem for the hyperlink of the sections, but not for the hyperlink of the figures. Yes, this lacks logic! – Norah Sep 11 '18 at 13:11
  • @Norah You have to use different labels in both sections, for example \label{intro1:eq1:english} and \label{intro1:eq1:french} – samcarter Sep 17 '18 at 14:30
1

From the example document, I assume that English is the main language.

In order to reset the counters related to chapter, the strategy is to issue \stepcounter{chapter}, accompanied by \addtocounter{chapter}{-1} to keep the number to zero.

For hyperref one can locally redefine \theHchapter so to give unique anchors in the French part.

\documentclass[a4paper,10pt,reqno]{amsbook}    
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}        % not utf8x
\usepackage[french,english]{babel} % english is the main language
%\usepackage[reqno]{amsmath}       % redundant with amsbook
%\usepackage{amsfonts}             % redundant with amssymb
\usepackage{amssymb}
%\usepackage{amsthm}               % redundant with amsbook

\usepackage{hyperref}

\numberwithin{equation}{chapter}

\begin{document}
\mainmatter

\begin{otherlanguage}{french}
\renewcommand{\theHchapter}{FR\thechapter}

\chapter*{French}
\section{Section 1}
\begin{equation}\label{eq1_FR}
x=y
\end{equation}
La première équation \eqref{eq1_FR}.

\end{otherlanguage}

\addtocounter{chapter}{-1}  
\stepcounter{chapter}

\chapter*{English}
\section{Section 1}
\begin{equation}
\label{eq1_EN}
x=y
\end{equation}
I cite the first equation \eqref{eq1_EN} of the chapter "English", 
but the hyperref sends me to the equations \eqref{eq1_FR}, 
even if there are well labeled.

\chapter{First chapter}

\begin{equation}
\label{chap1}
x=y
\end{equation}

There is no problem for this equation \eqref{chap1}.

\end{document}

Note that utf8x has been unmaintained for several years and that, on the contrary, utf8 is actively maintained and developed by the LaTeX team.

  • Thanks a lot, this works fine. I also take into account your remark on utfx8 ! – Norah Sep 25 '18 at 13:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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