Reimplementation of LaTeX's indexing macros
