HsIndex

About HsIndex

HsIndex is an index generator that can be used with the LaTeX (LuaLaTeX, XeLaTeX, …) processor in association with the imakeidx package.

HsIndex was made to compensate the absence of xindy in my current Debian 9 installation and my need to make index with Cyrillic characters.

It's written with Haskell to give an efficient, stable and portable binary program.

Portable

HsIndex can be compiled from source on many Linux distributions and Windows environments where the Haskell platform is available. It should build well with Haskell platform older than 2014.2.

International

HsIndex can handle several languages with various alphabet. At this time, it can generate indexes in :

It is very few but I wish to increase the number of supported language quickly.

Customizable

HsIndex allow the user to tweak the LaTeX style of the index (Size of font, alignment, delimiters, …) and the language itself (sorting order, characters substitutions, …).

Introduction

An index is decomposed in 3 sections :

In each section, letters, numbers and symbols are sorted in a specific order.

Built in languages provided by the HsIndex generate an index with a classical characters order, a standard style and should be satisfying for most usages.

Characters substitutions are performed on accentuated letters to simplify the index and give a coherent ordering. For example é is replaced by e and œ is replaced by oe

If the style or the language definition doesn't meet the user requirements, it is possible to set the style and the letters orders in each section.

Modifying style

It is possible to modify the style of the index by setting a style file which contain the LaTeX commands to execute at specific moment in the index.

For example, to modify the preamble, put the following string in a text file :

preamble "\begin{theindex}"

It is possible to modify various key setting of the index such as heading prefix and suffix or the group skip :

heading_prefix "{\vspace{1.5cm}\huge{\textbf{"
heading_suffix "}}\hfill}\nopagebreak"
group_skip     "\\n\\n \indexspace\\n" 

Note : It's possible to put line break \n but these line breaks must be preceded by two backslashes \\n.

Page ranges

Actually, HsIndex can't read the page range format given by opening and closing parenthesis after | in \indexentry{the entry|(}{1}. But it's possible to automatically convert successive page numbers (3 or more) to a range by using the --range option.

hsindex english --range --style="myindexstyle.sty" --input=input.idx --output=output.ind

Custom language

It is also possible to modify the character order with a language definition file.

This file is decomposed in several sections :

LETTERS : 

Describe the characters treated as characters and their sorting order.

NUMBERS : 

Describe the characters treated as numbers and their sorting order.

SYMBOLS : 

Describe the characters treated as symbols and their sorting order. If this section is missing, every non letters and numbers characters will be treated as symbols.

SUBSTITUTIONS : 

Describe the list of substitutions to perform to give an equivalent name to the index items. This can be used to make accented letters equivalent to another. This equivalent name is then used to sort the items.

œ->oe
à->a
ê->e

Usage

Running HsIndex

HsIndex usage is the same as makeindex or xindy :

  1. Place the HsIndex binary in your LaTeX working directory.

  2. Build your LaTeX document with the imakeidx package (1st pass).

  3. Run the HsIndex binary with appropriate arguments.

    hsindex english --style="myindexstyle.sty" --input=input.idx --output=output.ind
    
  4. Build your LaTeX document to incorporate the index (2nd pass).

Downloading HsIndex

Source code of the latest version of hsindex can be downloaded from my GitLab account :

hsindex on GitLab

A binary version running on Windows can be downloaded here:

hsindex v0.12.0

hsindex v0.11.1

hsindex v0.9.1

Comparison with makeindex

If you wish to see the difference between makeindex and HsIndex, see the comparative bellow (generated with the testidx LaTeX package):

makeindex
,
 
LaTeX
Haskell
,
 
HsIndex
,
 
LaTeX
Haskell
,
 
HsIndex
,
 
LaTeX

Evolution

At this time, hsindex development is just beginning and its features are not exactly the same than makeindex. For example, it's not possible to reuse the pages ranges manually set with LaTeX, and I'm not sure to implement this feature in the future.

If you have suggestions to improve this software, a new language you wish to use, email me.