Re: MWE showing one of my indexing problems [ALL PROBLEMS SOLVED]
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 Thanks Herbert, Moving all index commands from the headline to the text immediately following solved most of of the problems. And thanks to all the rest of you who helped me. Stephan Witt recommended looking at the .ilg file. Unfortunately, for some reason I haven't figured out yet, my shellscript didn't create a .ilg file, so I just figured there were no warnings (bzzt, wrong). Then I compiled using el's command: lyx -f -e luatex lawnmower.lyx && latexmk -lualatex lawnmower.tex The preceding command gave me a .ilg file with tens or maybe over 100 warnings, and I just didn't think that was possible, because I hadn't wrongly interlaced anything or used a |( where I was supposed to use a |). After I fixed the MWE according to Herbert's advice and compiled with el's command, I got no warnings in the .ilg. Armed with such knowledge, I pulled up the real file and, chapter by chapter, moved any \index commands on headlines to the start of the text immediately below them. With each chapter so fixed, there were less and less warnings in the .ilg. Once I'd fixed all the chapters, the .ilg contained no warnings. But wait, there's more. Once I got to that point, I had to uncomment the \input{./seealso.inc} from the layout file. This immediately produced several warnings of the type: "Conflicting entries: multiple encaps for the same page under same key" Ugh! A suitable period of web searching and experimentation brought me to the conclusion that the following seealso.inc lines, although they appear logical and correct, produce the preceding error message: \index{Mental Model!Runit|see{Runit}} \index{Mental Model!Runit|seealso{ runsv}} You can't have one lookup phrase produce multiple references. So instead, you need to incorporate this one inobvious command to replace the preceding two: \index{Mental Model!Runit|see {Runit,}, \seealso{runsv}} Notice the following: * "Runit," contains a comma that shows through in the index. * The comma after the closing brace on "{Runit,}," is necessary * The space after the comma after the closing brace prevents the seealso from butting up against the comma in "Runit," * The seealso must be in command form (\seealso) Ugly, but it works. A slightly less challenging requirement is what seems like would be expressed like the following: \index{Runit|seealso{runsv}} \index{Runit|seealso{Runit=>lessons learned}} But once again, "Conflicting entries: multiple encaps for the same page under same key", for the exact same reasons: One lookup phrase with multiple references. Fortunately, because these are both seealso instead of one of each, the solution is simpler: \index{Runit|seealso{runsv, Runit=>lessons learned}} For some reason I'll never understand, the following produces some, but not all, pages that are off by a page or two: lyx -f --export luatex lawnmower.lyx lualatex lawnmower.tex makeindex lawnmower.idx luatex lawnmower.tex So instead I use el's method, which appears to give correct page numbers every time: lyx -f --export luatex lawnmower.lyx latexmk -gg -lualatex lawnmower.tex One thing I learned the hard way is what Stephan Witt told me: From the very first index mark or index range, look at your .ilg file and get rid of all errors and warnings before going on. When warnings get too numerous, debugging becomes like swimming through molasses. I put this all into a shellscript, which repeatedly deletes all intermediate files, does a texhash, a LyX reconfigure, lyx export and latexmk, displaying the .ilg file with line numbering in the less command on the CLI, and displaying the resulting PDF in the GUI. Each compile takes a little longer with all that stuff in there, but I'm guaranteed that whether the change I made was installation of a new TeX package, changing my layout file, or just changing the LyX file, all will be regenerated and accounted for. I just keep pressing Enter every time I want a new compile. Thanks for a
Re: MWE showing one of my indexing problems
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 -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: MWE showing one of my indexing problems
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. 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 -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: MWE showing one of my indexing problems
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 > Thanks, > > SteveT > > Steve Litt > Spring 2021 featured book: Troubleshooting Techniques of the Successful > Technologist > http://www.troubleshooters.com/techniques > -- > lyx-users mailing list > lyx-users@lists.lyx.org > http://lists.lyx.org/mailman/listinfo/lyx-users > -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users