3

i want to change the default layout of my index. Need to use makeidx instead of imakeidx because i need it at the beginning of the document (found out that it is not possible with imakeidx)

I was not able to find styles to makeidx. Hope you can help me :)

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[colorlinks, linkcolor = blue, urlcolor = blue]{hyperref}

\usepackage{makeidx}
\makeindex

\begin{document}

\printindex


\section{Introduction}
first \index{first}
belongs to first first \index{first!yo}

\end{document}

I want to have something like this. Maybe with 3 columns.Just need to understand how i can code it.

enter image description here

2 Answers 2

2

Found a solution

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[colorlinks, linkcolor = blue, urlcolor = blue]{hyperref}

\usepackage[afterindex]{indextools} #makes it possible to print it before
\makeindex[title=Index,columns=2,options={-s indexstyle.ist}] #load layout

\begin{document}

\printindex


\section{Introduction}
first \index{first}
belongs to first first \index{first!yo}

\end{document}

Also you need to add an .ist file

mystyle.ist

headings_flag 1
heading_prefix "{\\large\\sffamily\\bfseries "
heading_suffix "}\\nopagebreak\n"
delim_0 " \\dotfill "
delim_1 " \\dotfill "
delim_2 " \\dotfill "

Look also at this post.

2

There is no problem in using imakeidx, provided you don't rely on the automatic run of MakeIndex, which can only be done at the end.

It's actually a bit curious to have an index at the beginning.

% arara: pdflatex
% arara: makeindex
% arara: pdflatex

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[noautomatic]{imakeidx}
\usepackage[colorlinks, linkcolor = blue, urlcolor = blue]{hyperref}


\makeindex[columns=3]

\newcommand{\nindex}[1]{\index{#1@\textsl{#1}}}

\begin{document}

\indexprologue{L'index est encore très incomplet et beaucoup de travail
  d'indexation reste à faire.}
\printindex

\clearpage

\section{Introduction}

\nindex{Bohr, N.}
\nindex{Boltzmann, L.}
\index{champ gravitationnel}
\nindex{Descartes, R.}
\nindex{Gauss, C. F.}
\index{identités!matricielles}
\index{identités!trigonométriques}
\index{identités!vectorielles}

\end{document}

I use arara to automatize the process, but it's the same if you run

pdflatex
makeindex
pdflatex

You can then add the preferred style.

1
  • i am using it like a database. its easy to find the position of an input. thanks for yourhelp
    – credenco
    Commented Mar 2, 2020 at 9:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .