* Index with distinguishable entries -- again
@ 2017-04-26 13:18 Florian Grammel
2017-04-26 15:16 ` Rik Kabel
0 siblings, 1 reply; 4+ messages in thread
From: Florian Grammel @ 2017-04-26 13:18 UTC (permalink / raw)
To: mailing list for ConTeXt users
Back in april 2012 Robert Blackstone asked some questions about indexing
http://www.mail-archive.com/ntg-context@ntg.nl/msg63134.html
i.a.:
> For a book in the area of musicology I would like to make one register with
> entries of different kinds, distinguishable by their appearance in the
> register (or index or whatever).
> The index entries will mostly be authors, including composers, musical terms
> and musical compositions. The titles of the compositions and the foreign words
> are set in italic characters throughout in the text of the book.
> What I would like is to be able to distinguish all entries according to whether
> they are treated in the text, are shown in a musical example, or are mentioned
> only in a foot- or endnote.
>
> In many books page numbers indicating illustrations are set in italics.
> Pagenumbers indicating foot- or endnotes often have a suffix "n".
>
His other question were resolved, but this one remained unanswered, apart from that two other users also wanted to do exactly the same thing.
I would like to do something very similar and was wondering: Has this been addressed/solved since then?
Thanks in advance!
Best,
Florian.
____________________________________________
Florian Grammel
Copenhagen, Denmark
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Index with distinguishable entries -- again 2017-04-26 13:18 Index with distinguishable entries -- again Florian Grammel @ 2017-04-26 15:16 ` Rik Kabel 2017-04-27 11:14 ` Florian Grammel 0 siblings, 1 reply; 4+ messages in thread From: Rik Kabel @ 2017-04-26 15:16 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 2951 bytes --] On 2017-04-26 09:18, Florian Grammel wrote: > Back in april 2012 Robert Blackstone asked some questions about indexing > http://www.mail-archive.com/ntg-context@ntg.nl/msg63134.html > i.a.: > >> For a book in the area of musicology I would like to make one register with >> entries of different kinds, distinguishable by their appearance in the >> register (or index or whatever). >> The index entries will mostly be authors, including composers, musical terms >> and musical compositions. The titles of the compositions and the foreign words >> are set in italic characters throughout in the text of the book. >> What I would like is to be able to distinguish all entries according to whether >> they are treated in the text, are shown in a musical example, or are mentioned >> only in a foot- or endnote. >> >> In many books page numbers indicating illustrations are set in italics. >> Pagenumbers indicating foot- or endnotes often have a suffix "n". >> > His other question were resolved, but this one remained unanswered, apart from that two other users also wanted to do exactly the same thing. > > I would like to do something very similar and was wondering: Has this been addressed/solved since then? > > Perhaps the following can help. It has separate user page numbers for the main matter and back matter, with a suffixed ‘n’ for the items indexed from backmatter pages, but no suffix on the backmatter page numbers. The index entries for figures are rubricated and have a leading ‘f’. \defineprocessor [backpart] [style=slanted,right=n] \defineprocessor [Figure] [style=\tf,color=red,left=f] \defineconversionset [backpart:pagenumber][][backpart->o] \setupuserpagenumber[way=byblock] \setuppagenumbering [location=none] \setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}] \setupnote[footnote][location=none] \useMPlibrary[dum] \starttext \startbodymatter \startchapter[title=A chapter] \index{aaa}This is in the main body.\footnote{\index{bbb}This is a footnote.} \stopchapter \startchapter[title={Another chapter}] \index{aaa}This is in the main body.\footnote{\index{bbb}This is a footnote.} \startplacefigure[location=default, title={Body illustration\index[Figure->]{ccc}}] \externalfigure[dummy][] \stopplacefigure \stopchapter \stopbodymatter \page \startbackmatter \startchapter[title=An appendix] This is in the backmatter.\index{aaa}\footnote{\index{bbb}This is a footnote.} \startplacefigure[location=default, title={Appendix illustration\index[Figure->]{ddd}}] \externalfigure[dummy][] \stopplacefigure \stopchapter \startchapter[title=Notes] \placenotes[footnote] \stopchapter \startchapter[title=Index] \placeregister[index] \stopchapter \stopbackmatter \stoptext -- Rik [-- Attachment #1.2: Type: text/html, Size: 4156 bytes --] [-- Attachment #2: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Index with distinguishable entries -- again 2017-04-26 15:16 ` Rik Kabel @ 2017-04-27 11:14 ` Florian Grammel 2017-04-27 18:43 ` Rik Kabel 0 siblings, 1 reply; 4+ messages in thread From: Florian Grammel @ 2017-04-27 11:14 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 3814 bytes --] Thank you very much for your example -- it really helps a lot! That’s one smart trick for the endnotes. It will do fine for my current project, but obviously it will not work for footnotes directly on the pages. I had somehow hoped that there would be something like „if within some environment/command" to the processors. With this also the formating of the items within the captions could be done automatically. A real problem though is that adding \setupregister [index] [compress=yes] will wrongly compress e.g. "aaa 1, 2, 1n“ to "aaa 1–1n“. I’ll need to use compressed ranges and would be happy with a result, where formatted numbers a subsumed under the regular ones. You don’t happen to know how to make this work correctly, do you? Best, Florian. > > On 2017-04-26 09:18, Florian Grammel wrote: >> Back in april 2012 Robert Blackstone asked some questions about indexing >> http://www.mail-archive.com/ntg-context@ntg.nl/msg63134.html <http://www.mail-archive.com/ntg-context@ntg.nl/msg63134.html> >> i.a.: >> >>> For a book in the area of musicology I would like to make one register with >>> entries of different kinds, distinguishable by their appearance in the >>> register (or index or whatever). >>> The index entries will mostly be authors, including composers, musical terms >>> and musical compositions. The titles of the compositions and the foreign words >>> are set in italic characters throughout in the text of the book. >>> What I would like is to be able to distinguish all entries according to whether >>> they are treated in the text, are shown in a musical example, or are mentioned >>> only in a foot- or endnote. >>> >>> In many books page numbers indicating illustrations are set in italics. >>> Pagenumbers indicating foot- or endnotes often have a suffix "n". >>> >> His other question were resolved, but this one remained unanswered, apart from that two other users also wanted to do exactly the same thing. >> >> I would like to do something very similar and was wondering: Has this been addressed/solved since then? >> >> > Perhaps the following can help. It has separate user page numbers for the main matter and back matter, with a suffixed ‘n’ for the items indexed from backmatter pages, but no suffix on the backmatter page numbers. The index entries for figures are rubricated and have a leading ‘f’. > > \defineprocessor [backpart] [style=slanted,right=n] > \defineprocessor [Figure] [style=\tf,color=red,left=f] > \defineconversionset [backpart:pagenumber][][backpart->o] > \setupuserpagenumber[way=byblock] > \setuppagenumbering [location=none] > \setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}] > \setupnote[footnote][location=none] > \useMPlibrary[dum] > \starttext > \startbodymatter > \startchapter[title=A chapter] > \index{aaa}This is in the main body.\footnote{\index{bbb}This is a footnote.} > \stopchapter > \startchapter[title={Another chapter}] > \index{aaa}This is in the main body.\footnote{\index{bbb}This is a footnote.} > \startplacefigure[location=default, > title={Body illustration\index[Figure->]{ccc}}] > \externalfigure[dummy][] > \stopplacefigure > \stopchapter > \stopbodymatter > \page > \startbackmatter > \startchapter[title=An appendix] > This is in the backmatter.\index{aaa}\footnote{\index{bbb}This is a footnote.} > \startplacefigure[location=default, > title={Appendix illustration\index[Figure->]{ddd}}] > \externalfigure[dummy][] > \stopplacefigure > \stopchapter > \startchapter[title=Notes] > \placenotes[footnote] > \stopchapter > \startchapter[title=Index] > \placeregister[index] > \stopchapter > \stopbackmatter > \stoptext > > -- > Rik [-- Attachment #1.2: Type: text/html, Size: 6509 bytes --] [-- Attachment #2: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Index with distinguishable entries -- again 2017-04-27 11:14 ` Florian Grammel @ 2017-04-27 18:43 ` Rik Kabel 0 siblings, 0 replies; 4+ messages in thread From: Rik Kabel @ 2017-04-27 18:43 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 4000 bytes --] On 2017-04-27 07:14, Florian Grammel wrote: > Thank you very much for your example -- it really helps a lot! > > That’s one smart trick for the endnotes. It will do fine for my > current project, but obviously it will not work for footnotes directly > on the pages. > I had somehow hoped that there would be something like „if within some > environment/command" to the processors. With this also the formating > of the items within the captions could be done automatically. > > A real problem though is that adding > \setupregister [index] [compress=yes] > will wrongly compress e.g. "aaa 1, 2, 1n“ to "aaa 1–1n“. I’ll need to > use compressed ranges and would be happy with a result, where > formatted numbers a subsumed under the regular ones. > You don’t happen to know how to make this work correctly, do you? > > I do not think that it is wrong in the way it reports compressed page numbers. The aaa entry is indeed on those consecutive pages. Add some blank pages (or pages without the indexed items) and look at the result. You can use the same method I showed with indexed terms in footnotes. Just create another processor and use it in within the indexing command in the footnote, or create a new command to wrap it, as \defineprocessor[Footnote][style=bold,color=blue] \define[1]\fnindex{\index[Footnote->]{#1}} of course, if you use the optional indexunder component already ( \index[as if it were spelled this way]{displayed as} ) then you will have to create a more complex command. (I leave that as an exercise for those who need it and do not want to fall back to the \index command.) So: \defineprocessor [backpart] [style=slanted,right=n] \defineprocessor [Figure] [style=\tf,color=red,left=f] \defineprocessor [Footnote] [style=bold,color=blue] \define[1]\fnindex{\index[Footnote->]{#1}} \define[1]\fiindex{\index[Figure->]{#1}} \defineconversionset [backpart:pagenumber][][backpart->o] \setupuserpagenumber[way=byblock] \setuppagenumbering [location=none] \setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}] \setupregister[index][compress=yes] %\setupnote[footnote][location=none] \useMPlibrary[dum] \starttext \startbodymatter \startchapter[title=A chapter] \index{aaa}This is in the main body.\footnote{\fnindex{bbb}This is a footnote.} \stopchapter \startchapter[title={Another chapter}] \index{aaa}This is in the main body.\footnote{\fnindex{bbb}This is a footnote.} \startplacefigure[location=default, title={Body illustration\fiindex{ccc}}] \externalfigure[dummy][] \stopplacefigure \stopchapter \startchapter[title=A third chapter] This is in the main body.\footnote{This is a footnote.} \stopchapter \startchapter[title=A fourth chapter] This is in the main body. \stopchapter \startchapter[title={Another chapter}] \index{aaa}This is in the main body.\footnote{\fnindex{bbb}This is a footnote.} \startplacefigure[location=default, title={Body illustration\fiindex{ccc}}] \externalfigure[dummy][] \stopplacefigure \stopchapter \stopbodymatter \page \startbackmatter \startchapter[title=An appendix] This is in the backmatter.\index{aaa}\footnote{\index{bbb}This is a footnote.} \startplacefigure[location=default, title={Appendix illustration\index[Figure->]{ddd}}] \externalfigure[dummy][] \stopplacefigure \stopchapter \startchapter[title=Notes] \placenotes[footnote] \stopchapter \startchapter[title=Index] \placeregister[index] \stopchapter \stopbackmatter \stoptext Of course, there may be conflicts. You may index the same term twice on one page, once in the text, once in a footnote. Context will not choke, and there is a fifty-fifty chance it will default to what you want. -- Rik [-- Attachment #1.2: Type: text/html, Size: 6347 bytes --] [-- Attachment #2: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-27 18:43 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-04-26 13:18 Index with distinguishable entries -- again Florian Grammel 2017-04-26 15:16 ` Rik Kabel 2017-04-27 11:14 ` Florian Grammel 2017-04-27 18:43 ` Rik Kabel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).