since I was not able to find a solution online, which fixed this problem, so I hope someone here can help me :)

Here is my main.tex file:

\usepackage[a4paper,left=3.125cm, right=3.125cm, top=2.5cm, bottom=3.0cm]{geometry}







file1 looks like this:

%!TeX root = file1.tex

In file2 I'm trying to cross referencing to the theorem like this:

%!TeX root = file2.tex

... Theorem~\ref{X-theorem:fix} ...

During compilation, I'm getting this warning

name{theorem.0.1} has been referenced but does not exist, replaced by a fixed one

which I imagine produces this problem...

And the output in the pdf looks like this

Theorem 0.1

with the hyperlink pointing just to the top of the document. It doesn't change if I'm compiling main.tex, which produces a large file with all the subfiles or just file2.tex. The interesting thing is, in my opinion, that it somehow knows that I'm trying to reference to something already labeled. Otherwise instead of 0.1, ?? would be standing there. So if I write \label{theorem:fi} instead of \label{theorem:fix}, ?? would be written here rather then 0.1.

  • Don't show incomplete snippets. Make a real example that we can use for tests. Aug 12, 2019 at 16:39
  • Sorry! I've added now an main.tex file. I hope it's ok so!
    – ezen1993
    Aug 12, 2019 at 17:43


You must log in to answer this question.

Browse other questions tagged .