I am using LyX 1.6.4 with MikTeX, compiling using XeTeX (in case it matters), to format a dissertation.

I want to use child documents, but when I move all my chapters to child documents (chapter1.lyx, etc.), I have a problem with the table of contents. I have added a line in ERT to add "Chapter" above the first chapter in the TOC:

\addtocontents{toc}{\noindent CHAPTER \par}

It should look like this:

Chapter
   1. My First Chapter
   2. My Second Chapter

As long as I have the first chapter in the main LyX document, this works fine. Subsequent chapters can be in child documents--no problem.

If Chapter 1 is in a child document and included, then CHAPTER shows up in the TOC just after the first chapter and before the second chapter:

   1. My First Chapter
Chapter
   2. My Second Chapter

I can't think of why this is happening, though if I add some random text between the ERT and the Include: chapter1.lyx, it solves the problem (but adds unwanted text). It is as if the ERT is placed after the include command, but it's not--it's before.

Any ideas about how to fix this?

Daniel

Reply via email to