4

I am making a songbook, using the songs package. The book is in norwegian, and thus we need the norwegian letters æ,ø,å to be indexed after z. As far as i understand, this is only possible with the xindy package. Creating the index is no problem, but I want to customize how it looks. As pr. now, it looks like this:

Current layout

Using makeindex, I was able to make it look correct Correct layout

Here is the code for makeindex

\usepackage[makeindex]{imakeidx} % Normal LaTeX indexing
\makeindex[columns=1, title=Sangregister,program=makeindex,intoc=true,options=-s idxconf.ist] % Properties of index

This is for xindy

\usepackage[texindy]{imakeidx} 
\def\xindylangopt{-M lang/norwegian/latin1-test }
\makeindex[columns=1,name=master,title =Sangregister,intoc=true,options=\xindylangopt]

The layout-options, is in the file idxconf.ist, which works on makeindex looks like this

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

Is it possible to use the idxconf.ist file with xindy? If not, how do I customize xindy to look like the last picture.

Here is a minimum working example:

xindy:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[norsk]{babel}
\usepackage[texindy]{imakeidx}
\def\xindylangopt{-M lang/norwegian/latin1-test}
\makeindex[columns=1,name=xindytest,title =Sangregister,  options=\xindylangopt]
\begin{document}
start
\index{a}\index{æ}\index{ø}\index{å}
end
blabla
\printindex
\end{document}

makeindex, which looks correct, but æøå is treated as symbols.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[norsk]{babel}
\usepackage[makeindex]{imakeidx}
\makeindex[columns=1, title=Sangregister,program=makeindex,intoc=true,options=-s idxconf.ist] % Egenskaper til indeks
\begin{document}
start
\index{a}\index{æ}\index{ø}\index{å}
end
blabla
\printindex
\end{document}
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Aug 28 '14 at 9:39
  • Oh yes, here is a MWE ` – Kristianfkt Aug 28 '14 at 9:49
  • From my answer to another question it seems that for Danish texindy results in a different alphabetical ordering to that produced using xindy -I xindy. Perhaps the same is occurring with Norwegian. – Nicola Talbot Sep 15 '14 at 11:21
8

For a smilar work, in italian (songbook with songs beginning with accented letters) I used this style file (indicealfabetico.xdy)

 (markup-index :open  "\begin{theindex}\sffamily~n
 \providecommand*\lettergroupDefault[1]{}
 \providecommand*\lettergroup[1]{%
 \par\textbf{\large#1}\par
   \nopagebreak
  }"
          :close "~n~n\end{theindex}~n"
          :tree)


;; The indexentries (item_<..> specifiers)

(markup-indexentry :open "~n  \item "           :depth 0)
(markup-indexentry :open "~n    \subitem "     :depth 1)
(markup-indexentry :open "~n      \subsubitem " :depth 2)

;; Location-references

;; delim_0 <string>         ", "
;; delim_1 <string>         ", "
;; delim_2 <string>         ", "

(markup-locclass-list :open "\dotfill " :sep ", ")

;; delim_n <string>         ", "

(markup-locref-list   :sep ", ")

;; delim_r <string>         "--"

(markup-range :sep "--")

using xindy in this way:

% arara: xelatex: { shell : yes }
\documentclass[12pt]{book}
\usepackage{imakeidx} 
\makeindex[name=alfabetico,title=Indice alfabetico,program=truexindy,options=-M texindy -C utf8 -L italian -M indicealfabetico]

A compilable example, that works with xelatex:

% arara: xelatex: { shell : yes}
\begin{filecontents*}{style.xdy}
(markup-index :open  "\begin{theindex}\sffamily~n
 \providecommand*\lettergroupDefault[1]{}
 \providecommand*\lettergroup[1]{%
 \par\textbf{\large#1}\par
   \nopagebreak
  }"
          :close "~n~n\end{theindex}~n"
          :tree)

(markup-locclass-list :open "\dotfill " :sep ", ")
;; End
\end{filecontents*}
\documentclass{article}
\usepackage{fontspec}
\usepackage{imakeidx}
\makeindex[columns=1,title=Sangregister,program=truexindy,options=-M texindy -C utf8 -L norwegian -M style]
\begin{document}
start
\index{a}\index{æ}\index{ø}\index{å}\index{Song}
end
blabla
\printindex
\end{document}

That gives:enter image description here

5

Not entirely shure I answer your question sufficiently, but using the provided MWE I created the desired result using the "glossaries" package instead of trying to tweak "imakeidx".

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[norsk]{babel}
\usepackage[xindy]{glossaries}
\renewcommand*\glspostdescription{\dotfill}      % Dotted line to page numbers
\renewcommand*{\glsnamefont}[1]{\textnormal{#1}} % No bold font on index names

\makeglossaries

\begin{document}

\newglossaryentry{a}{name={a},description={}}
\newglossaryentry{ae}{name = {{æ}},description = {}} %Improtant to note the double curly
\newglossaryentry{oe}{name = {{ø}},description = {}} %brackets around the special caracters,
\newglossaryentry{aa}{name = {{å}},description = {}} %and only ASCII (afaik) in the handle.

start \gls{ae} \gls{aa} \gls{oe} \gls{a}
end
blabla

\printglossary[style=indexgroup, title=Sangregister]
\end{document}

This gives:

LaTeX xindy glossary result

I commented the places where I thought an explanation would be needed. I recommend reading the user documentation found here: CTAN Glossaries.

In case you're using MiKTeX, and haven't already fully installed xindy and pearl, I recommed these three posts from user Speravir:

If you're using TeXmaker (or one of its derivatives): Here's a good answer to where to add the "makeglossaries" command:

Hope this helps!

  • Welcome to TeX.SX! – mvkorpel Sep 15 '14 at 9:33
  • Thanks! Forgot to mention that it is important to recompile after running makeglossaries ... – Yngve Sep 23 '14 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.