The Make Index palette enables you to generate an index for your notebook or project. The Wolfram System calculates page numbers for all the index entries that you specify and lists them in alphabetical order. Each entry in the index is hyperlinked to the related material in the source notebook(s).
To create an index for a document, you must assign an index entry to each cell in the notebook that will be referenced in the index. This is done using the Edit Notebook Index dialog box of the Make Index palette.
A simple index is used to check that all the index entries you specified were entered correctly. It lists all the entries including duplicate entries and sub-entries on a separate line. The text of the hyperlink for each entry consists of the cell tag of the target material and the name of the notebook in which it occurs.
The simple index is saved in the same directory as the source notebook(s). By default the file is called SimpleIndex.nb, but you can specify a different name using the Set Index FileName button at the bottom of the palette.
- Duplicate index entries to the same page are removed. Duplicate index entries on consecutive pages in the same notebook are combined into a single page range.
If the book index builds without error, it is saved in the same directory as the source notebook(s). By default the file is called BookIndex.nb, but you can specify a different name using the Set Index FileName button at the bottom of the palette.
If the two-column index builds without error, it is saved in the same directory as the source notebook(s). By default the file is called TwoColumnIndex.nb, but you can specify a different name using the Set Index FileName button at the bottom of the palette.
To create an index, you must associate index entries with specific cells in your source notebooks. This is done using the Edit Notebook Index dialog box, which allows you to add, edit, and remove index entries.
Any index entries associated with a cell are displayed in the box at the bottom of the dialog box if you select that cell. After you add a new entry, you can click Refresh to check that the entry you specified has been assigned.
1. For a single notebook, open the notebook and make it the currently selected notebook. For multiple notebooks, open the Make Project dialog box and load the project file for your project. (If you have not already created a project file, see "Creating a Project File" to learn how.)
5. Click Paginate to assign page numbers to the source notebook(s). You can skip this step if you have paginated the notebooks previously or if you are creating a simple index, which does not contain any page numbers.
6. Click the button corresponding to the type of index you want to create. For example, to build a simple index, click Make Simple Index. The other formats available are book index, two-column index, and browser index. See the "Introduction" section to learn about the differences among these four types of indexes.
The Wolfram System kernel refers to any open notebook via an expression of the form NotebookObject[fe,id], where fe specifies the front end in which the notebook is open and id is a unique serial number for the notebook.
The command Notebooks returns a list of notebook objects corresponding to all notebooks currently open in the front end.
Alternatively, you can identify a notebook by specifying the name and location of the notebook file. You can use the ToFileName function to construct a string specifying the full pathname of the file.
1. Associate index entries with specific cells in your source notebook. The simplest way to insert index entries is using the Edit Notebook Index dialog box, accessed from the Make Index palette. Alternatively, you can type and evaluate the AddIndexEntry function. The following command associates the specified main entry and sub-entry with the currently selected cell(s) in the notebook.
2. Generate the index using the MakeIndex function. This generates an index for the notebook.
The second argument of MakeIndex specifies the format of the index. You can choose from four different formats: "Simple", "Book", "TwoColumn", or "BrowserIndex". (See the "Introduction" section for more information on these formats.)
Note: The MakeIndex command inserts cell tags into the source notebook and automatically saves the changes. If you do not want your source notebook modified, you should keep a separate copy as a backup.