I learnt from this topic how to create chapter headers with cross-reference (you just refer to the chapter heading wich is always level one heading). Now my question is: what if your chapters consist of several sub-chapters (that is, of headings of level 2,3 etc) and you want them to appear also in the header using cross-reference? I didn’t find a way with cross-refernece to include every sub-heading regardless of its level. Is there a way?
(The problem is that with cross-reference
you always have to chose a specific level of heading which excludes form the header others, if you have more than one levels of headings).
Better describe what you want from user point of view. A user sees a cross-reference, that what? That shows a table of content for a chapter? that shows a list on hover? That on click moves you to five different places at once? that gives you a warm feeling that something unthinkable is accomplished?
I understand that you want something like this in your header:
2. My Chapter two
2.3 The third sub in the chapter
2.3.1 The first part in the sub
---------- header/text separator -------------
Lorem ipsum …
if the page starts in 2.3.1.
To do that, you “simply” insert 3 cross-references, each designating a level.
But there is a catch. The cross reference does not requires strictly (or exactly) the designated level. If it does not exist (e.g. you’re only at 2.3 at top of page), the cross-reference will return the highest level less than or equal to the desired one. In this case, you’ll get 2, 2.3, 2.3, i.e. twice 2.3 (level 2) because level 3 does not exist and, as a fall back, level 2 is returned instead of “void”.
My recommendation is to avoid such a situation. Show the chapter heading on the left page and the current heading on right page (you can request level 10 – or you stop at some level, like 4).
well as you see in my document I have 3 fields of cross-reference in the header. A: is the title of the document (that works OK). B: Is the chapter number (heading level 1). That is also OK. C: is where I want to display subchapters of whichever level (actually there is only one more - level 3).
edit.
So as I see now in your comment you suggest that field “C” should consist of two diferent fields than one as I have it?
this doesn’t work as it makes it appear as: “1. / 1.4. / 1.4.1”
If C is just the highest level at start of page, insert a cross-reference for level 10. It will pick up the highest existing. See what I wrote as “But there is a catch” in my previous comment.
I didn’t pay much attention to this, I didn’t know how to find the level 10 for cross reference but I found it. Yes, that’s it! Thank you!