MWE showing one of my indexing problems

Herbert Voss Herbert.Voss at fu-berlin.de
Fri Dec 10 19:28:59 UTC 2021



Am 10.12.21 um 20:06 schrieb Steve Litt via lyx-users:
> Herbert Voss said on Fri, 10 Dec 2021 10:14:29 +0100
>
>> Steve Litt via lyx-users schrieb:
>>> Attached please find mwe.lyx and mwe.pdf, which was created by
>>> mwe.lyx. This document is standard book class, sized 6 inches high
>>> by 4 inches wide to fit on reasonably sized mobile devices. The
>>> symptom is that index item "Incremental/Differential Learning" spans
>>> about 35 pages, but there's no index begin tag on the first of those
>>> pages, or anywhere near it. You can read the rest of the symptom
>>> description as chapter 1 of the actual document.
>>>
>>> I could have refined it further, but after 3 days I'm so punch drunk
>>> I was afraid I'd make the symptom vanish and have to start all over
>>> again, so if some of you could take a look at it, I'd be very
>>> grateful.
>> do not write an \index command into a sectioning command. Use it after
>> such a command. See image
>>
>> Herbert
> Confirmed! Thank you Herbert.
>
> I moved the two index opening commands from the end of the sectioning
> command to the start of the standard text that follows the sectioning
> command, which eliminated the symptom.
>
> My one remaining worry is that, with bad luck and just the wrong
> vertical alignment, the section header might fall at the bottom of the
> page *before* the page pointed to by the index entry. But so far, I
> seem to be having the opposite problem (section header falling *after*
> the page pointed to by the index entry, but only with my compile
> script, not with eyeballs) so I have to do more research.


The "real" problem was your \nameref command more than 20
pages before.  It refers to the \chapter with the label _and_ the 
\index{...|(}
command. So you get the pagenumber of the \nameref as a start,
because executes the titel _with_ the \index command.

You can also use the optional argument for special chapter headings if
you have some \nameref pointing to it:

\chapter[For TOC and nameref]{For normal title and 
index\label{foo}\index{...|(}}

Then ech refence should point to the title and not the following text.


Herbert




>
> Thanks for your help on this. It solved the worst of my two index
> problems.
>
> SteveT
>
> Steve Litt
> Spring 2021 featured book: Troubleshooting Techniques of the Successful
> Technologist http://www.troubleshooters.com/techniques



More information about the lyx-users mailing list