1

I am using following code for creating an index at the end of the document (which contains much of the example code shown on https://docs.racket-lang.org/scribble/getting-started.html), but it is not working:

@(index (list "mouse" "milk" "straw" "cookie" "color" "cystic" "fibrosis" "cartoon" "jpg" "scale" "scribble" "started" "getting" "consequence" "start" "chocolate" "chip") "pre-content")

Only the word "pre-content" shown on the browser. The rest of the html page is rendering all right. Where is the problem and how can I correct this?

rnso
  • 23,686
  • 25
  • 112
  • 234
  • 1
    It is unclear to me what exactly you are trying to do, but I don’t think [`index`](https://docs.racket-lang.org/scribble/base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._index%29%29) is the function you want. The `index` function just registers a term in the index—it just renders as the content you provide it. It seems to me that you might be looking for [`index-section`](https://docs.racket-lang.org/scribble/base.html?q=index#%28def._%28%28lib._scribble%2Fbase..rkt%29._index-section%29%29), instead? – Alexis King Jul 31 '16 at 10:01
  • I want to produce an Index as is seen at the end of books which lists the page number (maybe link here) to keywords. Is this possible with scribble with 'index' or 'index-section' or any other command? – rnso Jul 31 '16 at 10:35
  • 1
    Yes, that's what `index-section` does. You use `index` to mark places in the text that should be included in the index, then use `index-section` to render the actual index. – Alexis King Jul 31 '16 at 10:38

0 Answers0