2

I am writing a dissertation and I need it to be in two languages (English and Spanish).

The organization is as follows:

  1. Table of contents
  2. Preface and Abstract appear in both languages
  3. Body of the dissertation: first, all the chapters appear in english (in part 1) and then all the chapters in Spanish (in part 2). The content of part 1 and part 2 is the same but translated. So, I decided to reset page numbering and chapter numbering when transitioning from Part 1 to Part 2.

I use both cleverer and hyperlink packages (this is a must).

Below, you can find a simplified version of the template utilized for the dissertation:

\documentclass[12pt, footinclude=true,headinclude=true,  twoside=semi,  headsepline=true, chapterprefix=false, appendixprefix=true, headings=big, numbers=enddot]{scrbook}
\usepackage[english, spanish]{babel}
\usepackage[utf8]{inputenc}
% MWE 21June16
% COMMENTS: Resetting chapter counter to 0 for each new part.
%=========================================
\usepackage{lipsum}
\usepackage{shorttoc}
\usepackage{etoc}
\usepackage{hyperref}
\usepackage[noabbrev,capitalise,nameinlink]{cleveref}

% Or
% \usepackage{chngcntr}
% \counterwithin{chapter}{part}

\begin{document}
%===========
\frontmatter
%===========
\selectlanguage{english}
\tableofcontents
\chapter{Preface/Prefacio}
.... some text ....

\chapter{Abstract/Resumen}
.... some text ....
%===========
\mainmatter
%===========

\part*{English version}

\chapter{English}\label{chapter1EN}
This is \Cref{chapter1EN}.


\chapter{English}\label{chapter2EN}
This is \Cref{chapter2EN}.


\chapter{English}\label{chapter3EN}
This is \Cref{chapter3EN}.


\chapter{English}\label{chapter4EN}
This is \Cref{chapter4EN}.


\selectlanguage{spanish}
\newpage
\setcounter{chapter}{0}
\pagenumbering{arabic}
\part*{Spanish version}
\chapter{Spanish}\label{chapter1ES}
This is \Cref{chapter1ES}.

\chapter{Spanish}\label{chapter2ES}
This is \Cref{chapter2ES}.

\chapter{Spanish}\label{chapter3ES}
This is \Cref{chapter3ES}.

\chapter{Spanish}\label{chapter4ES}
This is \Cref{chapter4ES}.

\end{document}

The issue is that all the references also "reset" and when clicking the link corresponding to label=chapter1ES in both the text (in the portion of text corresponding to \Cref{chapter1ES}) and in the TOC it refers to label=chapter1EN.

Is there any way of resetting the page numbering and the chapter counter without affecting the labels and their references?

1
  • consider if this is really a good idea to repeat page numbers. E.g. try to print page 7. Which one will you get? Sep 26 at 21:34

1 Answer 1

1

The problem is that you have distinct pages with the same number.

Disabling hypertexnames should cure the problem.

\documentclass[
  12pt,
  footinclude=true,
  headinclude=true,
  twoside=semi,
  headsepline=true,
  chapterprefix=false,
  appendixprefix=true,
  headings=big,
  numbers=enddot
]{scrbook}
\usepackage[english, spanish]{babel}
\usepackage[T1]{fontenc} % <--- needed for Spanish
%\usepackage[utf8]{inputenc} % <--- no longer needed

\usepackage{lipsum}
\usepackage{shorttoc}
\usepackage{etoc}
\usepackage[hypertexnames=false]{hyperref}
\usepackage[noabbrev,capitalise,nameinlink]{cleveref}

\begin{document}

%===========
\frontmatter
%===========
\selectlanguage{english}

\tableofcontents

\chapter{Preface/Prefacio}
.... some text ....

\chapter{Abstract/Resumen}
.... some text ....

%===========
\mainmatter
%===========

\part*{English version}

\chapter{English}\label{chapter1EN}
This is \Cref{chapter1EN}.


\chapter{English}\label{chapter2EN}
This is \Cref{chapter2EN}.


\chapter{English}\label{chapter3EN}
This is \Cref{chapter3EN}.


\chapter{English}\label{chapter4EN}
This is \Cref{chapter4EN}.

\cleardoublepage
\selectlanguage{spanish}

\setcounter{chapter}{0}
\pagenumbering{arabic}

\part*{Spanish version}

\chapter{Spanish}\label{chapter1ES}
This is \Cref{chapter1ES}.

\chapter{Spanish}\label{chapter2ES}
This is \Cref{chapter2ES}.

\chapter{Spanish}\label{chapter3ES}
This is \Cref{chapter3ES}.

\chapter{Spanish}\label{chapter4ES}
This is \Cref{chapter4ES}.

\end{document}

Look at the comments at the beginning about packages. I'm not sure about using both shorttoc and etoc, though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .