1

I had to switch from makeindex to imakeidx due to this accents related issue, but I get the error Missing \begin{document}. I'm running lualatex-dev.exe in TeXnicCenter, the parameters of makeindex.exe are "%tm.idx" -t "%tm.ilg" -o "%tm.ind", everything is updated as of today. Please see my example below:

\documentclass{article}
\usepackage[hungarian]{babel}
\usepackage{imakeidx} % Putting here xindy as an option doesn't seem to matter.
\usepackage[round]{natbib}
\makeindex[program=texindy,options=-l hungarian -c utf8] % I don't know if encoding option is necessary.
\begin{document}
\frenchspacing

Egy hegylánc közepén keresztültörve tetejéről talapjáig, négymértföldnyi messzeségben; kétoldalt hatszáz lábtól háromezerig emelkedő magas, egyenes sziklafalak, közepett az óvilág óriás folyama, az Ister: a Duna. A ránehezülő víztömeg törte-e magának e kaput, vagy a föld alatti tűz repeszté kétfelé a hegyláncot? Neptun alkotta-e ezt, vagy Volcán? Vagy ketten együtt? A mű Istené! Ahhoz hasonlót még a mai istenutánzó kor vaskezű emberei sem bírnak alkotni.

\printindex \end{document}

  • 2
    natbib redefines \makeindex and then it not longer can take an optional argument (and it fails with pdflatex too). Load natbib earlier and hope. – Ulrike Fischer Aug 30 '22 at 13:26

1 Answers1

0

Load natbib before imakeidx, but also change the call of \makeindex, because -l and -c are wrong and should be -L and -C respectively.

Use lualatex-dev -shell-escape in order to get automatic generation of the index. Otherwise, run texindy and not makeindex.

\documentclass{article}
\usepackage[hungarian]{babel}
\usepackage[round]{natbib}
\usepackage{imakeidx} % Putting here xindy as an option doesn't seem to matter.
\makeindex[program=texindy,options=-L hungarian -C utf8]
\begin{document}
\frenchspacing

Egy hegylánc közepén keresztültörve tetejéről talapjáig, négymértföldnyi messzeségben; kétoldalt hatszáz lábtól háromezerig emelkedő magas, egyenes sziklafalak, közepett az óvilág óriás folyama, az Ister: a Duna. A ránehezülő víztömeg törte-e magának e kaput, vagy a föld alatti tűz repeszté kétfelé a hegyláncot? Neptun alkotta-e ezt, vagy Volcán? Vagy ketten együtt? A mű Istené! Ahhoz hasonlót még a mai istenutánzó kor vaskezű emberei sem bírnak alkotni.

\index{együtt} \index{kétfelé}

\printindex \end{document}

enter image description here

If you don't enable -shell-escape you get the warning

Package imakeidx Warning: Remember to run lualatex again after calling
(imakeidx)                `texindy -L hungarian -C utf8 magyaridx.idx'.

that tells you what to do.

egreg
  • 1,121,712