source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/params/make.index.markup.xml@ 4d4915a

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 4d4915a was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.8 KB
Line 
1<refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="5.0" xml:id="make.index.markup">
7<refmeta>
8<refentrytitle>make.index.markup</refentrytitle>
9<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
10</refmeta>
11<refnamediv>
12<refname>make.index.markup</refname>
13<refpurpose>Generate XML index markup in the index?</refpurpose>
14</refnamediv>
15
16<refsynopsisdiv>
17<src:fragment xml:id="make.index.markup.frag">
18<xsl:param name="make.index.markup" select="0"/>
19</src:fragment>
20</refsynopsisdiv>
21
22<refsection><info><title>Description</title></info>
23
24<para>This parameter enables a very neat trick for getting properly
25merged, collated back-of-the-book indexes. G. Ken Holman suggested
26this trick at Extreme Markup Languages 2002 and I'm indebted to him
27for it.</para>
28
29<para>Jeni Tennison's excellent code in
30<filename>autoidx.xsl</filename> does a great job of merging and
31sorting <tag>indexterm</tag>s in the document and building a
32back-of-the-book index. However, there's one thing that it cannot
33reasonably be expected to do: merge page numbers into ranges. (I would
34not have thought that it could collate and suppress duplicate page
35numbers, but in fact it appears to manage that task somehow.)</para>
36
37<para>Ken's trick is to produce a document in which the index at the
38back of the book is <quote>displayed</quote> in XML. Because the index
39is generated by the FO processor, all of the page numbers have been resolved.
40It's a bit hard to explain, but what it boils down to is that instead of having
41an index at the back of the book that looks like this:</para>
42
43<blockquote>
44<formalpara><info><title>A</title></info>
45<para>ap1, 1, 2, 3</para>
46</formalpara>
47</blockquote>
48
49<para>you get one that looks like this:</para>
50
51<blockquote>
52<programlisting>&lt;indexdiv&gt;A&lt;/indexdiv&gt;
53&lt;indexentry&gt;
54&lt;primaryie&gt;ap1&lt;/primaryie&gt;,
55&lt;phrase role="pageno"&gt;1&lt;/phrase&gt;,
56&lt;phrase role="pageno"&gt;2&lt;/phrase&gt;,
57&lt;phrase role="pageno"&gt;3&lt;/phrase&gt;
58&lt;/indexentry&gt;</programlisting>
59</blockquote>
60
61<para>After building a PDF file with this sort of odd-looking index, you can
62extract the text from the PDF file and the result is a proper index expressed in
63XML.</para>
64
65<para>Now you have data that's amenable to processing and a simple Perl script
66(such as <filename>fo/pdf2index</filename>) can
67merge page ranges and generate a proper index.</para>
68
69<para>Finally, reformat your original document using this literal index instead of
70an automatically generated one and <quote>bingo</quote>!</para>
71
72</refsection>
73</refentry>
Note: See TracBrowser for help on using the repository browser.