Skip to content
martin-henz edited this page Jan 9, 2021 · 20 revisions

Here is how we indicate index entries in the XML:

  • <INDEX>: the usual rendering is applied to the content of the element
  • <SUBINDEX>: optional tag for subindex within index: the usual rendering is applied to the content of the element
  • <ORDER>: optional tag within <INDEX> and <SUBINDEX> to define the order in which the element appears in the (sub)index
  • <DECLARATION>...</DECLARATION>: within <INDEX> or <SUBINDEX> creates JavaScript-formatted text (names) and a page number in italics
  • <USE>...</USE>: within <INDEX> or <SUBINDEX> creates JavaScript-formatted text (names) and a page number in roman
  • <INDEX>... <OPEN/></INDEX> ... <INDEX>...<CLOSE/></INDEX>: indicating page ranges. Such elements need to appear in pairs, and the opening element needs to appear in the source documents before the closing element.
  • <INDEX><PRIMITIVE/><SUBINDEX>...</SUBINDEX></INDEX>: item is listed under "primitive functions"
  • <INDEX><OPERATOR/><SUBINDEX>...</SUBINDEX></INDEX>: item is listed under "operators"
  • <INDEX>...<SEE>...</SEE></INDEX>: creates a "see" entry
  • <INDEX>...<SEEALSO>...</SEEALSO></INDEX>: creates a "see also" entry
  • index entries within figure captions create a (fig...) after the page number
  • index entries within exercises create a (ex...) after the page number

Turn on color-code margin annotations by setting indexAnnotations to true in javascript/parseXmlLatex.js.

  • <INDEX>...<FRAGILE/></INDEX>: avoids placing items into margin when indexAnnotations is turned on in parseXmlLatex.js. Instead, the items are placed inline in the text. Placement inside text is also used (even without explicit <FRAGILE/>) when the item appears in a footnote.

The PDF edition currently features an index. The ebook and web editions don't have an index at the moment; users need to rely on search for those editions.

SICP coding standard mandates that index terms are on their own line. This may add trailing white space between the end of prose and an index, which in LaTeX may lead to lines overflowing with an entirely blank next line. This is extremely rare (<1 occurrence per mille!). If this happens, insert a comment between the prose and index terms to consume the space, like so:

    <UL>
      <LI>
        <B>primitive expressions</B>, which represent the simplest
        entities the language is concerned with,<!--
        --><INDEX>primitive expression</INDEX>
      </LI>
      <LI>
        <B>means of combination</B>, by which compound
        elements are built from simpler ones, and<!--
        --><INDEX>means of combination</INDEX><!--
        --><INDEX>combination, means of</INDEX>
      </LI>
      <LI>
        <B>means of abstraction</B>, by
        which compound elements can be named and manipulated as units.<!--
        --><INDEX>means of abstraction</INDEX>
      </LI>
    </UL>
Clone this wiki locally