TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing my thesis using LyX's thesis template, and each chapter is a different file (chapter-x.lyx).

However, sometimes, I need to refer to a section from another chapter, which is in a different file. So for example:


this is explained further in chapter \ref{chap:White-Box-Testing}


\begin_layout Chapter
White Box Testing
\begin_inset CommandInset label
LatexCommand label
name "chap:White-Box-Testing"

The problem is that when I generate the PDF document from Thesis.lyx, which has the pointers to all the chapter-x.lyx files, I get broken links in the output document.

How would I go about fixing this?

share|improve this question
up vote 4 down vote accepted

The problem is solved by setting the correct "master document": In each branched document (chapter-x.lyx), go to Document>Settings>Document Class.
Here, ensure that Select default master document is checked and the value is set to the filename referring to the main document from which all these other documents branch off. In my case, this document is Thesis.lyx and not the default thesis.lyx.

This rename fixes the issue

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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