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?


1 Answer 1


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

  • Does this answer apply to this question as well? tex.stackexchange.com/questions/628554/… Commented Dec 31, 2021 at 2:54
  • @wolfsatthedoor: I think it would apply Commented Dec 31, 2021 at 5:36
  • Do you think if I bounty the question, you could spare a few moments to show me how to get it to work? This would be a really amazing thing to figure out, as most lyx users seem to think this is impossible. Commented Jan 7, 2022 at 23:02
  • 1
    @wolfsatthedoor I'd be happy to help. But I should note that it's been a while since I've written my thesis (and therefore used this feature). Please try the posted answer and if it doesn't work, shoot me an email and I'll be happy to help as best as I can Commented Jan 10, 2022 at 14:04

You must log in to answer this question.

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