0

I would like to make a Norwegian index for a book. Is there a MWE which can help me?

  • I cannot compile these. Perhaps it is because I use \AE, \O, \AA for the Norwegian letters. – Frode Alfson Bjørdal Nov 04 '17 at 17:30
  • If you are using commands like \AE rather than using UTF-8 characters, you need to add a merge rule for each of those commands. For example (merge-rule "\\AE *" "Æ" :eregexp :again) – Nicola Talbot Nov 04 '17 at 17:47

1 Answers1

3

Run with shell escape enabled or run

xindy -M texindy -L norwegian -C utf8 <filename>.idx

after a LaTeX run.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}

\usepackage[xindy]{imakeidx}

\makeindex[options=-M texindy -L norwegian -C utf8]

\begin{document}

xyz

\index{henne}
\index{selv}
\index{denne}
\index{før}
\index{slik}
\index{gikk}
\index{hva}
\index{igjen}
\index{fikk}
\index{man}
\index{alt}
\index{mange}
\index{ingen}
\index{får}
\index{oss}
\index{hvor}
\index{under}
\index{siden}
\index{hele}
\index{dag}
\index{gang}
\index{sammen}
\index{ned}
\index{ångstrom}

\printindex

\end{document}

enter image description here

egreg
  • 1,121,712
  • What does "shell escape enabled" mean? – Frode Alfson Bjørdal Nov 04 '17 at 17:33
  • It compiled, but ångstrøm was ranked first. I did not follow the instruction on having shell escape enabled, as I do not understand it. – Frode Alfson Bjørdal Nov 04 '17 at 17:40
  • @FrodeBjørdal It means run pdflatex --shell-escape file.tex instead of pdflatex file.tex. With that I get ångstrøm in the correct place. – Torbjørn T. Nov 04 '17 at 18:05
  • @TorbjørnT. I use Texstudio, and I do not see how to run either of these. – Frode Alfson Bjørdal Nov 04 '17 at 18:15
  • @FrodeBjørdal pdflatex without shell-escape is likely what you're using to generate the PDF now. See https://tex.stackexchange.com/a/99601/ for one way of activating shell-escape for a document. – Torbjørn T. Nov 04 '17 at 18:24
  • @Torbjørn T. I tried % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape] in the preamble, but this did not alter the ranking and ångstrøm is still first. – Frode Alfson Bjørdal Nov 04 '17 at 18:54
  • @FrodeBjørdal I added % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape] before \documentclass, and when hitting F6, I got a question if I would allow changing the build command, which I agreed to, and then it worked fine. I don't really use TeXstudio, so I'm not that familiar with it, and can't say why it wouldn't work for you (unless you have an older version perhaps). – Torbjørn T. Nov 04 '17 at 20:32
  • @TorbjørnT. Thanks, but even this did not work for me, unfortunately. – Frode Alfson Bjørdal Nov 04 '17 at 23:49