• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Indexes in EPUB

Engaged ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

Hi. Using ID 19.2 under Win 11.

My question was partially answered by Peter Kahrel here (it was something of a revelation):
https://community.adobe.com/t5/indesign-discussions/is-it-possible-to-convert-index-numbers-in-indes...

But my question goes just a little further into EPUB, and I'm hoping for advice from the community.

Summary:

Like the OP of the linked post, I would like to use an InDesign index in an EPUB. Peter Kahrel ably showed how to use GREP to replace the numbers in an ID index with a string (I used "Go") that maintains the link to the target location, thus allowing a non-page-specific index link to an index target location. This works (great) for PDFs, but does not appear to work in EPUBs, although I can see it work in the Calibre EPUB editor. I'm obviously missing something (mea culpa!)

Detail: (This is a duplicate of my question asked 'way down on the OP posting above, hate to ask it twice but I'm not sure how soon anyone might see it.)

 

My question:

Summary of problem: The eventual EPUB created using the GREP substitution method does not appear to link from the Index to the instance, and I'm not sure how to figure this out/debug. I am aware that EPUB is a set of zipped HTML docs.

Details:

  1. I created an InDesign book with two documents; call them targets.indd and index.indd.
  2. In targets.indd, there are three pages, each containing a single item; this, that, and the other thing.
  3. I created a normal index, which showed the three items and their respective page numbers.
  4. I tested this by creating a PDF, and the ID links from the index to the target were in place and worked.
  5. I ran the Peter Kahrel's GREP, and replaced each of the page numbers with the word "Go."
  6. I tested this revision by creating a PDF, and the ID links from the index to each target still worked (this is great!).
  7. I created an EPUB version of the doc. This is where I began to have trouble. In ID, Window | Interactive | EPUB Interactivity Preview showed the target pages and the index page as expected. While the EPUB previewer gave me a finger "pointer," clicking the word Go in the index did not take me to the target (no reaction).
  8. I opened the EPUB in Calibre editor (not an Adobe product; I know). In Calibre, clicking the word Go took me to the target -- so as far as the HTML was concerned in Calibre, this arrangement works.
  9. I opened the EPUB in Kindle Previewer 3.78 (just downloaded today; not an Adobe product, I know). The Kindle Previewer displayed the three target pages and the Index as expected, but clicking Go in the index did not take me to the targets. There was no reaction to the click. Just like the Adobe EPUB previewer.

 

So in both the Adobe EPUB previewer and in the Kindle EPUB previewer, the index links did not work. But in both PDF and in Calibre, they did.

 

I am puzzled why the links appear to work sometimes but not others. I am sure this is because I am missing something that I otherwise should know. The GREP works just fine... except I don't end up with an index usable in EPUB. Any advice?

 

PS: It may be that Kindle cannot handle an index even though it is made up of unnumbered target links. I can live with that, but want to make sure I'm not simply doing something incorrectly or missing a simple setting. Likewise, it may be that ID's interactive EPUB window won't deal with indexes. I can live with that too, with the same proviso. But Calibre works as expected....

 

Thanks as always to the community.

-j

TOPICS
EPUB , How to

Views

394

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 03, 2024 Mar 03, 2024

These are mostly observations, not necessarily leading to or adding up to a "solution" as you're looking for it.

 

  • I wouldn't bother with the ID EPUB previewer; while it's not completely broken like ADE, it's just not a very useful tool for a number of reasons, and glitches on many 'complex' things like cross-refs. KP and Calibre Reader are much better proofing and test tools.
  • The need for an index in an e-book is questionable, since the text is inherently searchable and a multi-level TOC can e
...

Votes

Translate

Translate
Community Expert ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

These are mostly observations, not necessarily leading to or adding up to a "solution" as you're looking for it.

 

  • I wouldn't bother with the ID EPUB previewer; while it's not completely broken like ADE, it's just not a very useful tool for a number of reasons, and glitches on many 'complex' things like cross-refs. KP and Calibre Reader are much better proofing and test tools.
  • The need for an index in an e-book is questionable, since the text is inherently searchable and a multi-level TOC can easily be created that is accessible at any point in the book. While neither quite replaces a truly professional index with topic or concept entries (as opposed to just keyword listings or headings, which the other two alternatives provide — and, frankly, most indexes are just keyword lists anyway; InDesign's tool is little more than a keyword finder/manager), the need for that level of indexing is usually limited to fairly advanced works. So the first serious question is: "Can this book just do without an 'index' as long as search and a deep TOC are included?"
  • I pulled up a well-proofed book project and threw some indexing at it. Simple summary, it worked just fine in both KP and Calibre.
  • The only 'fault' is, of course, the meaningless page numbers.... but maybe question two should be "Will the small subset of book readers who use the index be bothered by these bits of cataloging detritus?" To the point where an elaborate solution needing post-EPUB export steps (always to be avoided, IMVHO) is worth it? When a short notice can be added to the Index that the page numbers refer to a paginated version and are useful only as approximate location indicators, blah blah blah — which they are; it's often helpful to know an entry is near the start or end or middle of a book when looking for a particular piece of information. (A row of five 'Go' markers will lose that context.)
  • I don't think trying to remove the numbers in ID is a good approach; all cross-refs in ID are exceptionally fragile and fussy, and get some multiple of fragile-er when exported to EPUB. The right solution, if you absolutely have to get rid of the page numbers, would be to remove them in the exported XHTML file. Which doesn't allow ID's GREP to help, risks damaging the code/organization in the export material and goes against the rule of Don't Edit the D*mn EPUB File.

 

That said, I was able to extract the content file, locate the index entries, and hand edit a number of page numbers into X's. Poke back into EPUB, test — works fine. So editing the index AFTER export is the path most likely to lead to success, whether or not (1) an index is really needed at all and (2) page numbers are just too-too 'orrible to leave as-is.

 

The approach I'd use, at gunpoint or with a large project check dangling, would be to:

  • Generate the EPUB as ready to publish.
    • It may be easier for everything that follows if you split the EPUB at chapter headings, so that the Index section will be its own file and you won't have to edit a single immense XHTML file. But all-same either way.
  • Extract the right XHTML file (main or index-only) from the EPUB using a ZIP archive tool.
  • Open that main/index file in a competent text editor (I prefer Notepad++; DreamWeaver would be an adequate alternative; there are other good code editors around.)
  • In each Index entry, find the text for each number and replace it with whatever you want — an X, another simple glyph, or 'Go' as you used before. Here's a simple example from my test:

 

<p class="Index-Level-1">Rihanna <a href="TEST.xhtml#_idIndexMarker001">4</a><span class="Underline_Text">,</span> <a href="TEST.xhtml#_idIndexMarker002">36</a><span class="Underline_Text">, </span><a href="TEST.xhtml#_idIndexMarker005">147</a></p>

 

 

  • This is a bit messy with span styles and so forth, but you could use search and/or GREP to find each number and replace it with your chosen index marker. (I'd probably clean things up like remove the underline text application, maybe remove the commas, etc. as well but it's all up to how skilled you are with search/replace, GREP, macros etc. to speed and automate the job.) The only thing you want to avoid is breaking any of those <a MARKER>X</a> strings.

 

This worked perfectly, as noted, in both Kindle Previewer and Calibre Reader.

 

But once more — it's MUCH simpler to just leave the numbers, which have some if not precise value in locating info, and that avoids all problems and the need to edit each exported iteration of the book. (Because, of course, edits to an EPUB don't survive the next export.) That would be my recommendation as book designer, EPUB/Kindle specialist, and, honestly, reader.

 

Note that I did not say "Use Calibre or Sigil or another EPUB tool to extract and edit this file." There are two reasons for that: first, I dislike these tools on multiple levels, mostly because of my dislike of post-export EPUB editing and the whole "Build A Bear" model of EPUB creation they manifest, and because I suspect they would get in the way of this "controlled breakage" of the EPUB, trying to be too "helpful" or "automated" since they are essentially amateur-publisher tools in the first place.

 

Any of that help?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

Thank you for your excellent response. I know the client will expect (a) an index in the print-on-demand document (long and quite technical), and (b) the same index reflected in the EPUB. I tried using Peter Kahrel's GREP method (I did not try to leave the index page numbers in place, but will).

 

I think my advice to the client will be to enjoy the benefits of the nice print index in the POD and resort to keyword search in the KPD -- unless I can make this work.

 

Still mystified, tho. I did the GREP pre-EPUB output -- so no post-EPUB processing -- and it worked in PDF and in Calibre; it just didn't work in Kindle Previewer (leaving the Adobe EPUB previewer out of the discussion). I may try again. Thanks again for taking the time to work through this with me. I will be taking your advice.

-j

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 04, 2024 Mar 04, 2024

Copy link to clipboard

Copied

UPDATE: Did a quick test without the GREP replacement strings for the Index numbers; so did no pre-processing of the doc containing the index page and no post-EPUB-generation processing. Again, the links worked in PDF, worked in Calibre, and did not work in Kindle Previewer. The file generated as an EPUB 3.0. This may have had an effect.

 

It still seems to me that this process should just work (GREP or no GREP, and without post-processing), thus allowing an EPUB to have an index with links to specific topic locations, even tho EPUBs may have a perfectly good keyword search. Part of the value of an index is to see what topics the author -- or the indexer, at least -- finds important, and where to find their major locations. A keyword search may generate hundreds of hits, not all of which will be important. Will keep poking. -j

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2024 Mar 04, 2024

Copy link to clipboard

Copied

I don't know why the same EPUB would work in Calibre and not in KP. While formatting diffierences are fairly common and require tweaking for each destination, it's rare to see functional differences. Things like TOCs, cross-refs and indexes either work or fail to work in both.

 

It may be a fault of having the index in a separate document. Can you place it at the end of the main document instead?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 04, 2024 Mar 04, 2024

Copy link to clipboard

Copied

Hi. I placed the index on a fourth page at the end of the other three in the same document (this would be impractical in a big book, as my client is planning). No change. My pages are absolute bare-bones test. I did not create a cover, a TOC, and am not using Lorem Ipsum to generate extra text.... so I may be leaving something out that is critical for KDP. As an aside, I do not see a way within ID to generate any EPUB other than 3.0 to test that. Nevertheless, the EPUB test works in Calibre (Calibre 2 editor, to be precise) but does not work in Kindle Previewer.

 

I may have to create a bigger test doc and go through all the TOC generation etc. to create a more formal EPUB. Thanks -- a lot -- for your advice.

 

Attached an example file.

-j

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 04, 2024 Mar 04, 2024

Copy link to clipboard

Copied

SOLVED. 

I have only proven my own lack of observation.

InDesign was saving to FIXED-FORMAT.

When I change it to Reflowable, everything worked.

I knew it was going to be something stupid. I have outdone myself on this one.

Thanks for all help.

-j

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2024 Mar 04, 2024

Copy link to clipboard

Copied

LATEST

I thought that had been asked and answered. 😛

 

FXL is essentially an obsolete format and should not be used for anything but the most selective "picture page" books liike children's books and graphic novels. That should have been caught WAY back in this discussion.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2024 Mar 04, 2024

Copy link to clipboard

Copied

There is no valid version of EPUB except 3.xx, usually 3.2 or 3.3 depending on how recently the tool has been updated. Version 2.xx should not even be an option any more, not without being something that needs to be manually set up and selected for compatibility with existing libraries or the like.

 

Again, it's very unsual for technical factors to vary between EPUB (with Calibre as the example) and Kindle Previewer. Something is wrong here, but I can't put a finger on it from the examples given.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines