Skip to content

Commit

Permalink
Mention using imakeidx to build an index (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden authored Jul 29, 2024
1 parent 00adbb3 commit a96c1b9
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/books/book-structure.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Note that you can change the chapter title to whatever you like, remove `.unnumb

For PDF output, you can create an index using the LaTeX [makeidx](https://ctan.org/pkg/makeidx?lang=en) package along with the `\index` command.

To add an index to the PDF output for a book, add these `include-in-header` and `include-after-body` entries to your `pdf` format configuration in `_quarto.yml`: quart
To add an index to the PDF output for a book, add these `include-in-header` and `include-after-body` entries to your `pdf` format configuration in `_quarto.yml`:

``` yaml
format:
Expand All @@ -105,6 +105,29 @@ Markdown\index{Markdown} allows you to write using
an easy-to-read, easy-to-write plain text format.
```

Alternatively, you can also use the [imakeidx](https://ctan.org/pkg/imakeidx) package.
This packages offers additional features for formatting the index. For example:

``` yaml
format:
html:
theme: cosmo
pdf:
documentclass: scrreprt
include-in-header:
text: |
\usepackage{imakeidx}
\makeindex[intoc=true, columns=3, columnseprule=true, options=-s latex/indexstyles.ist]
include-after-body:
text: |
\printindex
```

In the above example, `intoc=true` will include an entry for the index into the table of contents,
`columns=3` will format the index into three columns, and `columnseprule=true` will display a line between index columns.
Finally, `options=-s latex/indexstyles.ist` will use additional formatting options from an index-style file located at `latex/indexstyles.ist`.
Many other features are available in the [imakeidx](https://ctan.org/pkg/imakeidx) package. Please refer to its documentation for further details.

Note that `\index` commands are automatically ignored for non-PDF output.

## Parts & Appendices
Expand Down

0 comments on commit a96c1b9

Please sign in to comment.