# Auto updating index entry page numbers

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

• 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 Jul 14 '17 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 Jul 14 '17 at 9:19
• You can use the package imakeidx and compile with -shell-escape, it will run makeindex automatically (idk whether makeidx does the same to). – TeXnician Jul 14 '17 at 9:21
• @TeXnician -shell-escape is not needed – egreg Jul 14 '17 at 9:30
• 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. – Schweinebacke Jul 20 '17 at 12:45

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

\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