Writing Done Right
Creating an Index in LibreOffice
Summary: This tutorial will teach you how to make an index for your book.

Related Software

Related Affiliates


LibreOffice can build indexes either manually or with a concordance file. This tutorial will show you how to create your index with either option.

An index is inserted using a list of entries that you specify. If there are only a few words that you want to index, then manually creating the index entries is a good option. But if your document contains several keywords, you will want to build a concordance file and upload that into your document.

Once the index is created, you can update the list by right clicking on the index and hit the Update Index option. You can edit the index, which will be changing styles, adding a concordance file, or adjusting the output, but selecting the Edit Index entry. Let's get started with manual index entries.

Manual Index Entries

By highlighting a word, you can go to Insert → Table of Contents and Index → Index Entry and add the selected word to the index.

On this dialog box, you will first select the Index that the entry goes into. It is possible to have a variety of indexes, but for the sake of this tutorial, we will keep the Alphabetical Index that is already selected. The Entry field will display how that entry will be populated in the index.

1st Key is if your index has a structure. Leave this blank for a simple index, but add something here if you want to structure your index into groups. For example, if you want a section for Countries, then Cities, then the index term, Country would be the first key, City the section key.

Main Entry defines a special formatting, like if you want capital cites in our example to have a different format than the rest of the cities, use the Main Entry function to make those stand out more.

Apply to all similar texts will make all instances of the selected word be included in the index (this is usually what you want). If this is unchecked, then only the highlighted instance of the word will be indexed.

Go through your document and add all the entries you want to include and then put the cursor where you want the index to be and go to Insert → Table of Contents and Index → Table of Contents, Index, or Bibliography. I usually leave the title blank because I use the book styling for the title to include it in the table of contents. Under Type, select Alphabetical Index.

Protect against manual changes prevents you from accidentally editing the index. I like to uncheck this, so I can fix anything that might go wrong, which occasionally happens.

The other settings are OK for now. So hit the OK button and let the document populate the index. We will cover styling in a different article.

You can read the LibreOffice documentation on Index Entries here.

Concordance Files

A large index is created by utilizing a concordance file, which is merely a csv file where the values are separated by a semicolon, with the '.sdi' file extension. There are six entries per line in the file:

Search term;Alternative entry;1st key;2nd key;Match case;Word only

Search Term - The value being searched as it appears in the document

Alternative Entry - The way the search term is printed in the index.

1st Key - The top index category

2nd Key - The second index category

Match Case - Is the search term matched exactly to the case? (0 - no, 1 - yes)

Word Only - Searching just the word? (0 - no, 1 - yes)

I create my file on a LibreCalc spreadsheet and then export it as a csv with a semicolon as the delimiter. Simply rename the file to have the '.sdi' extension and you are set for your index.

Create a new index or edit your current index and select the Concordance file option on the Type tab. Insert your file and press the OK.

Here is the documentation on Concordance Files.

You will now have a good list of your index terms and page numbers. If you edit the manuscript further, just right click the index and click the Update Index option to add new entries and updated page numbers.