0

I am using MikTeX Version 2.9 in Windows. Currently I am using makeidx.sty and the makeindex.exe program to crate the index entries from the TeX application files by using the tag \index. But is it possible to update and print the page numbers of index entries without running the makeindex program?

Now the auto updation is fixed by using the package "imakeidx.sty" as suggested by TeXnician. Please suggest that how can I add the tag \break, \pagebreak to the particular index entry?

My MWE is follows:

\documentclass{book}
\usepackage[makeindex]{imakeidx}

\makeindex

\begin{document}

This is a sentence indexing the command
\index{Breaking word}
with the environment\index{abstract}
and the ordinary word `document'\index{Test document}.

\printindex

\end{document}

Here, I need to break the two words "Breaking word", i.e., output should generate as \item Breaking\break word

Please suggest...

8
  • 1
    How should that work? You run makeindex for exactly that purpose. Of course you can run it automatically, but without running you won't get updated page numbers.
    – TeXnician
    Commented Jul 14, 2017 at 9:10
  • Thanks, I too agree that, anyhow, I need a confirmation from some experts like you, egreg, and David Carlisle, etc :-) but please suggest me how can I run makeindex.exe by every compilation in LaTeX...
    – MadyYuvi
    Commented Jul 14, 2017 at 9:19
  • 2
    You can use the package imakeidx and compile with -shell-escape, it will run makeindex automatically (idk whether makeidx does the same to).
    – TeXnician
    Commented Jul 14, 2017 at 9:21
  • 1
    @TeXnician -shell-escape is not needed
    – egreg
    Commented Jul 14, 2017 at 9:30
  • 1
    You should do only minor changes to questions. If the original question changes more, a follow-up question (with link to the original one) would be better. Commented Jul 20, 2017 at 12:45

1 Answer 1

1

I do not really understand, what you want. If you want a sub-entry use \index{Breaking!word}. If you really want a manual line break in an entry you may use \index{Breaking word@Breaking\linebreak word}.

\documentclass{book}
\usepackage[makeindex]{imakeidx}

\makeindex

\begin{document}

This is a sentence indexing the command
\index{Breaking word@Breaking\linebreak word}
with the environment\index{abstract}
and the ordinary word `document'\index{Test document}.

\printindex

\end{document}

would result in

enter image description here

\documentclass{book}
\usepackage[makeindex]{imakeidx}

\makeindex

\begin{document}

This is a sentence indexing the command
\index{Breaking!word}
with the environment\index{abstract}
and the ordinary word `document'\index{Test document}.

\printindex

\end{document}

in

enter image description here

You must log in to answer this question.

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