Subject Subheadings in an Index

Everything related to our flagship word processor.
Post Reply
nev
Posts: 25
Joined: 2009-08-07 14:39:43

Subject Subheadings in an Index

Post by nev »

I was recently looking at the index of a book and I noticed that it has, like many books, subject subheadings in its index.

What I mean is something like this:

Code: Select all

Calendrical systems 78
calendars
  Egyptian 99
  Mesopotamian 76
  primitive 7—10
  sacred 53—4
Caligula 236
What I'm referring to as "subject subheadings" is the unpaginated subject "calendars" followed by the indented and paginated references (between "Calendrical systems" and "Caligula").

The styling seems to be such that the subject subheading title is not capitalised, and the subheadings themselves, unless they're proper nouns, are neither capitalised.

I was wondering if Nisus Writer Pro is able to generate these (perhaps with the indents) via its indexing functions, or whether this type of indexing has to be done manually, after an index is built.

I've played around with the different types of indexing available in Nisus Writer Pro and I can't seem to hit upon a way to do it, though I might have missed it.
NisusUser
Posts: 335
Joined: 2011-01-12 05:32:38

Re: Subject Subheadings in an Index

Post by NisusUser »

I cannot speak authoritatively about whether Nisus Writer Pro can do what you want, but I rather doubt it.

I think professional indexing software is needed (though I may be wrong).

One professional indexing software recently went open-source and is maintained by a passionate group of professional indexers. The software is called CINDEX.

It can be downloaded here: https://www.opencindex.com/download/

The users' group is here: https://cindexusers.groups.io/g/main

If NWP won't do what you want, this might be an alternative. I have not yet prepared an index for "real life" use in CINDEX. However, I plan to. I have done some sample indexes to try it out and have gotten excellent help from the community on the forums.

I hope that helps.
nev
Posts: 25
Joined: 2009-08-07 14:39:43

Re: Subject Subheadings in an Index

Post by nev »

Thanks for the helpful suggestion. I'll check out that software.
adryan
Posts: 603
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Subject Subheadings in an Index

Post by adryan »

G’day, nev et al

I haven’t needed to create an index myself, and I haven’t looked really closely at nev’s problem, but I suspect a relatively simple (ha-ha!) Macro may be able to do this without having to leave Nisus Writer.

Here’s an outline of one possible approach:–

(1) Create your index in the usual way.
(2) Use Find & Replace to reorder all entries containing more than one word so that the last word in the entry becomes the first.
(3) Sort the whole index.
(4) Use Find & Replace again to find each set of two or more contiguous paragaphs with the same initial word.
(5) Delete the initial word from each set and place it in a separate paragraph at the beginning of the set. Unless the word is already in the plural, it may be better to leave it in the singular, lest a can of worms be opened (eg, “city”, “species”).
(6) Either apply a First Line Indent or a Tab prefix to each of the paginated entries.

The most useful indexes have each entry in a group also represented separately in their own right (albeit adding to the size of the index). If this is what you want, Steps (4)–(6) could be combined. With judicious construction of the Replace expression, you might duplicate the set. The first instance of the set would have the word order of entries reverted to the original order. The second instance of the set would be preceded by a paragraph with the group heading and have a Tab character inserted at the beginning of each of the other paragraphs. The paragraph returns following all but the final entry in the group (ie, the entire set now including the head­ing and indented entries) would be converted to soft returns. This would allow the entire index to be sorted once more without disturbing the groups. Soft returns could subsequently be converted back to paragraph returns if needed.

The method I've described will take care of capi­talization (or not) automatically.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
adryan
Posts: 603
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Subject Subheadings in an Index

Post by adryan »

G'day, all

Actually, Step (4) in the previous post won't be possible as stated, as Find & Replace doesn't allow back references in Find expressions. Consequently, the scheme will require a loop within a Macro, rather than simply Find & Replace not embedded in a Macro.

Also, a decision would need to be made about how to deal with entries consisting of a single word (eg, "Calendar", unspecified) that also happens to be the last word in multi-word entries (eg, "Mayan calendar").

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
phspaelti
Posts: 1345
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Subject Subheadings in an Index

Post by phspaelti »

As far as I am aware, you will get exactly this output, if in the location of your document where you discuss "Egyptian calendars" you Index As "calendars" and sub-index as "Egyptian", and so on for all the others. Of course the capitalization is entirely up to you, Nisus will just use the topic names that you type into the box.
Nisus Index-subindex.png
Nisus Index-subindex.png (57.36 KiB) Viewed 17413 times
So I guess, this kind of answers the second part of your question. It has to be done manually.
But… Actually the macro language can be used to automate these things, as long as you have some actual system that allows for automatisation. So if you have such a system and would like help with a macro, feel free to let us know, and maybe we can help.

Looking at the index topics you have put here I am hard-pressed to see how you would "automatically" index this way. I love good indexes, but in this day and age, ubiquitous digitial search features make most indexes superfluous. Unless, of course, they are of the well-thought-out manually generated kind.

“Never index your own book,” she stated. (Vonnegut, Cat's cradle)
philip
User avatar
phspaelti
Posts: 1345
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Subject Subheadings in an Index

Post by phspaelti »

Finally I just want to point out one more thing: If you are indexing using the Index Using Word List… this will work too. In your word list you will just have to put the topic:sub-topic using a column. So

Code: Select all

Egyptian calendars	calendars:Egyptian
etc.
philip
nev
Posts: 25
Joined: 2009-08-07 14:39:43

Re: Subject Subheadings in an Index

Post by nev »

I wasn't expecting so many helpful replies. Thank you NisusUser, adryan and phspaelti for taking the time to respond.

The examples I gave were indeed not in alphabetical order as I made an error. They should have been:

Code: Select all

Calendar of Filocalus 278
calendars
 Egyptian 99
 Mesopotamian 76
 primitive 7—10
 sacred 53—4
Caligula 236
I typed a space before, but a proper indent was implied (a tab makes the indent look rather large here).

phspaelti — thank you. Your solution works - mostly: the only thing it doesn't do is indent the subheadings, so I suppose it is 'manual' in that regard, but it's still handy for me.

I realise that a truly 'automatic' solution is rarely—if ever—available. A digital search doesn't apply in my case, as this is for print.

Vonnegut never had to format a PDF for KDP!

I'm not using a word-list, but thanks for the tip.
User avatar
phspaelti
Posts: 1345
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Subject Subheadings in an Index

Post by phspaelti »

nev wrote: 2024-08-05 00:12:45 phspaelti — thank you. Your solution works - mostly: the only thing it doesn't do is indent the subheadings, so I suppose it is 'manual' in that regard, but it's still handy for me.
Index items should have styles applied, which should allow the control of the indent. In my case the Index topics have Index 1 style and the sub-headings Index-2. So in my case they do indeed indent.
Attachments
Nisus Index.png
Nisus Index.png (16.06 KiB) Viewed 17384 times
philip
nev
Posts: 25
Joined: 2009-08-07 14:39:43

Re: Subject Subheadings in an Index

Post by nev »

phspaelti wrote: 2024-08-05 02:10:15 Index items should have styles applied, which should allow the control of the indent. In my case the Index topics have Index 1 style and the sub-headings Index-2. So in my case they do indeed indent.
Yes — I see that applying select styles would be the appropriate way to indent them, thanks.
nev
Posts: 25
Joined: 2009-08-07 14:39:43

Re: Subject Subheadings in an Index

Post by nev »

It would be handy if there was an option in the "Index As..." dialog to apply a style to the "Sub-topic(s)", though that may not be possible in the interface and is probably asking too much!

Thanks again for the helpful tips and instructions.
User avatar
phspaelti
Posts: 1345
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Subject Subheadings in an Index

Post by phspaelti »

Styles for the subtopics can be set in the Configure Index Styles dialog.
Configure Index Styles 1.png
Configure Index Styles 1.png (103.09 KiB) Viewed 17360 times
Configure Index Styles 2.png
Configure Index Styles 2.png (115.4 KiB) Viewed 17360 times
Whatever you choose here should be set automatically.
philip
nev
Posts: 25
Joined: 2009-08-07 14:39:43

Re: Subject Subheadings in an Index

Post by nev »

phspaelti wrote: 2024-08-05 06:01:00 Styles for the subtopics can be set in the Configure Index Styles dialog.

Configure Index Styles 1.png
Configure Index Styles 2.png

Whatever you choose here should be set automatically.
Oh that's great! Makes it so easy. Thank you so much for pointing that out to me!
Vanceone
Posts: 213
Joined: 2013-05-03 07:06:31

Re: Subject Subheadings in an Index

Post by Vanceone »

I use the Index as word list option all the time.

It's the core reason I use Nisus, actually. As I've laid out in a thread before, using the Index as word list option is key to building a Table of Authorities which is a requirement for certain legal documents.

I have to index all the Cases, Statutes, Rules, and a few other types of legal authority. So I always use the two column table. As phspaelti has laid out, using index styles allows me to treat my "top level" items such as "CASES" as breaks in my index. All the cases are indexed alphabetically.

The best part? By using a word list, I can build up a database, essentially, of common references and with one click of the index using word list command index the vast majority of my document with zero effort on my part. I still have to manually tweak a few things here or there, of course.. index items that are new or I've never used them before.

It's a far more powerful feature than Word has, so it's the primary reason I use Nisus. I highly recommend it!
Post Reply