1

I trying to have the good number when I refer the Chapter 2 of my Ph.D Thesis but without success.

I have four files, the main with a lot of packages and :

% Manuscrit.tex ----> Main files
\documentclass[a4paper,11pt,final,twoside]{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{subfiles}
\usepackage[pdftex,pagebackref=true]{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=RoyalBlue,
    citecolor=OliveGreen,
    urlcolor=mymauve}

\externaldocument[Int-]{./Introduction/Introduction}
\externaldocument[I-]{./Chapitre_1/Chapitre_1}
\externaldocument[II-]{./Chapitre_2/Chapitre_2}
\externaldocument[III-]{./Chapitre_3/Chapitre_3}

\begin{document}

\mainmatter
\subfile{./Introduction/Introduction.tex}
\subfile{./Chapitre_1/Chapitre_1.tex}
%\subfile{./Chapitre_2/Chapitre_2.tex}
\subfile{./Chapitre_3/Chapitre_3.tex}
\end{document}

In Introduction.tex file :

\documentclass[./../Manuscrit.tex]{subfiles}

\begin{document}

\chapter{Introduction}
\label{chap:intro}
\end{document}

In Chapitre_1.tex :

\documentclass[./../Manuscrit.tex]{subfiles}
\chapter{High energy Physics - Matter - Quark-Gluon-Plasma}
\label{chap:context}
\end{document}

And in the Chapitre_3 where I want to reference the chapter 1 (not the introduction)

\documentclass[./../Manuscrit.tex]{subfiles}

\externaldocument[I-]{./../Chapitre_1/Chapitre_1}
\externaldocument[II-]{./../Chapitre_2/Chapitre_2}

\begin{document}

\chapter{Methods to study of anisotropic flow}
\label{Chap:flow}

We see in the previous chapter the tool what I have used all of this Ph.D Thesis. In this chapter, I will show the analysis that I have done all this Ph.D Thesis. Typically, I had put some part of this chapter in the event generator \gls{epos} presented in the previous chapter.

\setlength{\parskip}{0.5cm}

The main observable of this Ph.D is the anisotropic flow that I had briefly introduce in the section \ref{I-subsec:flow} of the Chapter \ref{I-chap:context}. Consquently, this chapter will be dedicated of the history and tacticals to calculs the anisotropic flow. To recall the section \ref{I-subsec:flow} of the Chapter \ref{I-chap:context}.
\end{document}

But the results gives me :

The main observable of this Ph.D is the anisotropic flow that I had briefly introduce in the section 1.3.1 of the Chapter 1. Consquently, this chapter will be dedicated of the history and tacticals to calculs the anisotropic flow. To recall the section 1.3.1 of the Chapter 1.

The reference of the section is good but not the Chapter, I want to ref the Chapter 2 and not the Chapter 1. Why I have the Chapter 1 and how we can fix it ?

Thanks

1
  • 1
    Your code is fragmented -- nobody can compile it as it stands
    – user31729
    Oct 22, 2017 at 17:56

1 Answer 1

2

The cause of the missing references is the fact that \subfile does not compile the sub file, so there is no relevant .aux file for the included sub files, i.e. no cross-reference information is available and LaTeX complains about the missing references (Exception: There has been previous compilations of the sub files already and the .aux files were not deleted in between)

Solution: Compile the individual .tex files twice (or even three times) and then Manuscrit.tex

Also load \usepackage{xr-hyper} before hyperref and remove xr then.

8
  • Thanks for the answer, I put the \usepackage{xr-hyper} before hyperref and I remove xr but now I cannot compile because I have also a glossary with \acrlong command and now Latex does not recognize the command \acrlong. I edit my question adding some things of my glossary. I had already compile twice or three times all files and I have already .aux file
    – G. Sophys
    Oct 23, 2017 at 17:55
  • @G.Sophys: Well, that wasn't in your question, was it? ;-)
    – user31729
    Oct 23, 2017 at 18:08
  • Sorry, I didn't know that glossary package and xr-hyper are not compatible between them. I must to put another question or we can continue in this topic ? I had edit the first message
    – G. Sophys
    Oct 23, 2017 at 18:22
  • 1
    @G.Sophys: Editing changes the question and requires another answer most likely, leaving my answer useless.
    – user31729
    Oct 23, 2017 at 19:31
  • But the question is exactly the same, why I have not the good number of chapter ?
    – G. Sophys
    Oct 23, 2017 at 19:37

You must log in to answer this question.

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