I want to define \index[table]{#1} to hold several arguments: \index[table]{{#1}{#2}} and build a table row with it, using the splitindex.
How can I do this?
I want to define \index[table]{#1} to hold several arguments: \index[table]{{#1}{#2}} and build a table row with it, using the splitindex.
How can I do this?
This has nothing to do with imakeidx nor with \item. Just define a new index style. With imakeidx it's just simpler to manage the whole thing.
ind10.istSave this file in the same directory as your LaTeX file
preamble "\\begin{theindex}\n\\begin{longtable}{lll}\\mygobble"
postamble "\n\\end{longtable}\n\\end{theindex}\n"
item_0 "\\\\\n\\mymacro"
delim_0 "&"
\documentclass{article}
\usepackage{longtable}
\usepackage{imakeidx}
\makeindex[options=-s ind10,columns=1]
\newcommand{\mymacro}[2]{#1}
\newcommand{\mygobble}[1]{}% for gobbling the first \\
\begin{document}
abc\index{{aa}{bb}}\index{{ddd}{eeeeeeeee}}
\printindex
\end{document}
.ind file\begin{theindex}
\begin{longtable}{lll}\mygobble\\
\mymacro{aa}{bb}&1\\
\mymacro{ddd}{eeeeeeeee}&1
\end{longtable}
\end{theindex}

glossaries package is surely better for this.
– egreg
May 24 '14 at 22:01
options=-s <name>.ist to an index, it's not inherited by other indices. If you don't pass the -s option, the default style is used.
– egreg
May 24 '14 at 22:20
imki@indexitemforimakeidx? – 1010011010 May 22 '14 at 11:20