Ahem. If an indexable term appears in a section heading, the index
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 15 Apr 2004 08:37:39 +0000 (08:37 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 15 Apr 2004 08:37:39 +0000 (08:37 +0000)
should not also point to a page in the contents! :-)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4078 cda61777-01e9-0310-a592-d414129be87e

bk_paper.c

index e6e17f7..68ebc83 100644 (file)
@@ -12,9 +12,6 @@
 /*
  * TODO in future work:
  * 
- *  - the index should not refer to the contents, if an indexable
- *    term crops up in a section title!
- * 
  *  - include the version IDs.
  * 
  *  - linearised PDF, perhaps?
@@ -571,6 +568,9 @@ void *paper_pre_backend(paragraph *sourceform, keywordlist *keywords,
            paper_idx *pi = (paper_idx *)entry->backend_data;
            para_data *text, *pages;
 
+           if (!pi->words)
+               continue;
+
            text = make_para_data(para_Normal, 0, 0,
                                  conf->base_width - conf->index_colwidth,
                                  NULL, NULL, entry->text, conf);
@@ -1742,7 +1742,10 @@ static int render_text(page_data *page, para_data *pdata, line_data *ldata,
             * referenced by an index entry.
             */
          case word_IndexRef:
-           {
+           /*
+            * We don't create index references in contents entries.
+            */
+           if (!pdata->contents_entry) {
                indextag *tag;
                int i;