Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

chapterbib produces bibliographies per chapter. But makeidx appears to create the index without considering the matter in the bbl files. Consequently, index entries point to the wrong page numbers once the bibliographies are added. How do I stop this from happening? hyperref appears to be working correctly.

Edited to add an example, which is big as there needs to be more than a page long bibliography to cause this issue:

These files are in the same folder:

thesis.tex
intro.tex
theory.tex
Ref.bib

Contents of thesis.tex:

\documentclass[DIV=12, toc=listof, paper=A4]{scrreprt}
\usepackage[inner=3cm,outer=2.5cm,bottom=3cm]{geometry}
\usepackage[super,sort&compress]{natbib}
\usepackage{natmove}
\usepackage[sectionbib]{chapterbib}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage[hypcap]{caption}
\usepackage{makeidx}
\usepackage[hidelinks]{hyperref}

\makeindex

\pagestyle{fancyplain}
\setcitestyle{comma}

% % Math abbreviations end

%\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\sectfont}{\normalfont\bfseries}
%\setkomafont{disposition}{\rmfamily}

\begin{document}


\setstretch{1.5}

\tableofcontents
\clearpage

\pagenumbering{arabic}

\include{intro}
\clearpage

\include{theory}
\clearpage

\phantomsection
\clearpage
\addcontentsline{toc}{chapter}{\indexname}
\printindex
\end{document}

Contents of intro.tex:

\chapter{Introductions}

\newpage
\index{spin--wave} (SWs) occurred over fifty years ago  \cite{Bloch1930}.
\cite{Chumak2010, Klos2013}. 
\cite{Kim2010}.
\newpage
magnetoresistance \cite{Baibich1988, Binasch1989},  \cite{Inoue1999},  \cite{Figotin2003}  \cite{Carcia1985, Carcia1988}. modulation. \index{spin--wave}  \cite{Choi2007} along with very efficient signal transmission and logical operations, have been studied in isolated and dipole coupled ferromagnetic nanodisks.



%\section{The Landau--Lifshitz--Gilbert (LLG) equation}
\index{Landau--Lifshitz--Gilbert equation|see{LLG equation}} \index{LLG equation} 

the \index{Larmor!precession} \textit{Larmor precession}. The the \index{damping!Gilbert} \index{Gilbert damping} \textit{Gilbert damping}. 
\newpage
\newpage

A\index{LLG equation} \textit{LLG equation} \cite{Landau1935, Gilbert2004}. \cite{Donahue1999} adiabatically \cite{Antos2008}.

\cite{Berger1996}, $e$ \cite{Slonczewski1996}, \cite{Li2003},  \cite{Lee2006}  \cite{Berkov2005}. \cite{Xiao2004}.  Eq.~\eqref{eq:llg2} \cite{Donahue1999}

%\bibliographystyle{naturemag}
\bibliographystyle{aipnum4-1}
\begin{flushleft}
\bibliography{Ref}
\end{flushleft}
\addcontentsline{toc}{section}{\numberline{}Bibliography}

Contents of theory.tex:

\chapter{Theoretical Background}

\section{Ferromagnetism \index{ferromagnetism} \label{sec:ferro}}

a \index{magnetic!field} \textit{magnetic field} \cite{Kumar2013},

\bibliographystyle{aipnum4-1}
\begin{flushleft}
\bibliography{Ref}
\end{flushleft}
\addcontentsline{toc}{section}{\numberline{}Bibliography}

Contents of Ref.bib

% This file was created with JabRef 2.9.2.
% Encoding: Cp1252

@ARTICLE{Antos2008,
  author = {Roman Antos and YoshiChika Otani and Junya Shibata},
  title = {Magnetic Vortex Dynamics},
  journal = {J. Phys. Soc. Jpn.},
  year = {2008},
  volume = {77},
  pages = {031004},
  number = {3},
  doi = {10.1143/JPSJ.77.031004},
  numpages = {8},
  publisher = {The Physical Society of Japan},
  timestamp = {2014.01.08},
  url = {http://jpsj.ipap.jp/link?JPSJ/77/031004/}
}

@ARTICLE{Baibich1988,
  author = {Baibich, M. N. and Broto, J. M. and Fert, A. and Van Dau, F. Nguyen
    and Petroff, F. and Etienne, P. and Creuzet, G. and Friederich, A.
    and Chazelas, J.},
  title = {Giant Magnetoresistance of (001)Fe/(001)Cr Magnetic Superlattices},
  journal = {Phys. Rev. Lett.},
  year = {1988},
  volume = {61},
  pages = {2472--2475},
  month = {Nov},
  doi = {10.1103/PhysRevLett.61.2472},
  issue = {21},
  numpages = {0},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevLett.61.2472}
}

@ARTICLE{Berger1996,
  author = {Berger, L.},
  title = {Emission of spin waves by a magnetic multilayer traversed by a current},
  journal = {Phys. Rev. B},
  year = {1996},
  volume = {54},
  pages = {9353--9358},
  month = {Oct},
  doi = {10.1103/PhysRevB.54.9353},
  issue = {13},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevB.54.9353}
}

@ARTICLE{Berkov2005,
  author = {Dmitri V. Berkov and Natalia L. Gorn},
  title = {Stochastic dynamic simulations of fast remagnetization processes:
    recent advances and applications },
  journal = {J. Magn. Magn. Mater.},
  year = {2005},
  volume = {290--291},
  pages = {442--448},
  number = {1},
  note = {\textit{Proceedings of the Joint European Magnetic Symposia (JEMS'
    04)}},
  abstract = {Numerical simulations of fast remagnetization processes using stochastic
    dynamics are widely used to study various magnetic systems. In this
    paper, we first address several crucial methodological problems of
    such simulations: (i) the influence of finite-element discretization
    on simulated dynamics, (ii) choice between Ito and Stratonovich stochastic
    calculi by the solution of micromagnetic stochastic equations of
    motion and (iii) non-trivial correlation properties of the random
    (thermal) field. Next, we discuss several examples to demonstrate
    the great potential of the Langevin dynamics for studying fast remagnetization
    processes in technically relevant applications: we present numerical
    analysis of equilibrium magnon spectra in patterned structures, study
    thermal noise effects on the magnetization dynamics of nanoelements
    in pulsed fields and show some results for a remagnetization dynamics
    induced by a spin-polarized current. },
  doi = {http://dx.doi.org/10.1016/j.jmmm.2004.11.569},
  issn = {0304-8853},
  keywords = {Micromagnetic calculation},
  timestamp = {2013.12.31},
  url = {http://www.sciencedirect.com/science/article/pii/S0304885304018323}
}

@ARTICLE{Binasch1989,
  author = {Binasch, G. and Gr\"unberg, P. and Saurenbach, F. and Zinn, W.},
  title = {Enhanced magnetoresistance in layered magnetic structures with antiferromagnetic
    interlayer exchange},
  journal = {Phys. Rev. B},
  year = {1989},
  volume = {39},
  pages = {4828--4830},
  month = {Mar},
  doi = {10.1103/PhysRevB.39.4828},
  issue = {7},
  numpages = {0},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevB.39.4828}
}

@ARTICLE{Bloch1930,
  author = {Bloch, F.},
  title = {Zur Theorie des Ferromagnetismus},
  journal = {Z. Physik},
  year = {1930},
  volume = {61},
  pages = {206},
  timestamp = {2014.01.07}
}

@ARTICLE{Carcia1988,
  author = {Carcia, P. F.},
  title = {Perpendicular magnetic anisotropy in Pd/Co and Pt/Co thin--film layered
    structures},
  journal = {J. Appl. Phys.},
  year = {1988},
  volume = {63},
  pages = {5066--5073},
  number = {10},
  doi = {http://dx.doi.org/10.1063/1.340404},
  timestamp = {2014.01.07},
  url = {http://scitation.aip.org/content/aip/journal/jap/63/10/10.1063/1.340404}
}

@ARTICLE{Carcia1985,
  author = {Carcia, P. F. and Meinhaldt, A. D. and Suna, A.},
  title = {Perpendicular magnetic anisotropy in Pd/Co thin film layered structures},
  journal = {Appl. Phys. Lett.},
  year = {1985},
  volume = {47},
  pages = {178--180},
  number = {2},
  doi = {http://dx.doi.org/10.1063/1.96254},
  timestamp = {2014.01.07},
  url = {http://scitation.aip.org/content/aip/journal/apl/47/2/10.1063/1.96254}
}

@ARTICLE{Choi2007,
  author = {Choi, Sangkook and Lee, Ki-Suk and Guslienko, Konstantin Yu. and
    Kim, Sang-Koog},
  title = {Strong Radiation of Spin Waves by Core Reversal of a Magnetic Vortex
    and Their Wave Behaviors in Magnetic Nanowire Waveguides},
  journal = {Phys. Rev. Lett.},
  year = {2007},
  volume = {98},
  pages = {087205},
  month = {Feb},
  doi = {10.1103/PhysRevLett.98.087205},
  issue = {8},
  numpages = {4},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevLett.98.087205}
}

@ARTICLE{Chumak2010,
  author = {Chumak, Andrii V. and Tiberkevich, Vasil S. and Karenowska, Alexy
    D. and Serga, Alexander A. and Gregg, John F. and Slavin, Andrei
    N. and Hillebrands, Burkard},
  title = {All-linear time reversal by a dynamic artificial crystal},
  journal = {Nat. Commun.},
  year = {2010},
  volume = {1},
  pages = {141},
  doi = {10.1038/ncomms1142},
  timestamp = {2013.05.03}
}

@BOOK{Donahue1999,
  title = {OOMMF User's Guide, Version 1.0},
  publisher = {Tech. Rep. NIS--TIR 6376, National Institute of Standards and Technology,
    Gaithersburg, MD},
  year = {1999},
  author = {M. Donahue and D. G. Porter},
  date = {2002},
  eprint = {http://math.nist.gov/oommf/doc/userguide12a3/userguide/},
  organization = {NIST Interagency Report No. 6376},
  timestamp = {2014.01.08},
  version = {1.2a3}
}

@ARTICLE{Figotin2003,
  author = {Figotin, A. and Vitebskiy, I.},
  title = {Electromagnetic unidirectionality in magnetic photonic crystals},
  journal = {Phys. Rev. B},
  year = {2003},
  volume = {67},
  pages = {165210},
  month = {Apr},
  doi = {10.1103/PhysRevB.67.165210},
  issue = {16},
  numpages = {20},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevB.67.165210}
}

@ARTICLE{Gilbert2004,
  author = {Gilbert, T.L.},
  title = {A phenomenological theory of damping in ferromagnetic materials},
  journal = {IEEE Trans. Mag.},
  year = {2004},
  volume = {40},
  pages = {3443--3449},
  number = {6},
  doi = {10.1109/TMAG.2004.836740},
  issn = {0018-9464},
  keywords = {damping;eddy current losses;ferromagnetic materials;damping theory;ferromagnetic
    damping;ferromagnetic materials;magnetic core memories;magnetic domains;magnetic
    losses;magnetic recording;magnetization processes;phenomenological
    theory;Damping;Eddy currents;Energy loss;Equations;Extraterrestrial
    measurements;Lattices;Magnetic domains;Magnetic field induced strain;Magnetic
    materials;Magnetization;65;Ferromagnetic damping;ferromagnetic materials;magnetic
    core memories;magnetic domains;magnetic losses;magnetic recording;magnetization
    processes},
  timestamp = {2014.01.08}
}

@ARTICLE{Inoue1999,
  author = {Inoue, Mitsuteru and Arai, Ken\'ichi and Fujii, Toshitaka and
    Abe, Masanori},
  title = {One--dimensional magnetophotonic crystals},
  journal = {J. Appl. Phys.},
  year = {1999},
  volume = {85},
  pages = {5768--5770},
  number = {8},
  doi = {http://dx.doi.org/10.1063/1.370120},
  timestamp = {2014.01.07},
  url = {http://scitation.aip.org/content/aip/journal/jap/85/8/10.1063/1.370120}
}

@ARTICLE{Klos2013,
  author = {K{\l}os, J. W. and Kumar, D. and Krawczyk, M. and Barman, A.},
  title = {Magnonic Band Engineering by Intrinsic and Extrinsic Mirror Symmetry
    Breaking in Antidot Spin-Wave Waveguides},
  journal = {Sci. Rep.},
  year = {2013},
  volume = {3},
  pages = {2444},
  month = aug,
  doi = {10.1038/srep02444},
  publisher = {Macmillan Publishers Limited. All rights reserved},
  timestamp = {2013.08.21}
}

@ARTICLE{Kim2010,
  author = {Sang-Koog Kim},
  title = {Micromagnetic computer simulations of spin waves in nanometre-scale
    patterned magnetic elements},
  journal = {J. Phys. D: Appl. Phys.},
  year = {2010},
  volume = {43},
  pages = {264004},
  number = {26},
  abstract = {Current needs for further advances in the nanotechnologies of information-storage
    and -processing devices have attracted a great deal of interest in
    spin (magnetization) dynamics in nanometre-scale patterned magnetic
    elements. For instance, the unique dynamic characteristics of non-uniform
    magnetic microstructures such as various types of domain walls, magnetic
    vortices and antivortices, as well as spin wave dynamics in laterally
    restricted thin-film geometries, have been at the centre of extensive
    and intensive researches. Understanding the fundamentals of their
    unique spin structure as well as their robust and novel dynamic properties
    allows us to implement new functionalities into existing or future
    devices. Although experimental tools and theoretical approaches are
    effective means of understanding the fundamentals of spin dynamics
    and of gaining new insights into them, the limitations of those same
    tools and approaches have left gaps of unresolved questions in the
    pertinent physics. As an alternative, however, micromagnetic modelling
    and numerical simulation has recently emerged as a powerful tool
    for the study of a variety of phenomena related to spin dynamics
    of nanometre-scale magnetic elements. In this review paper, I summarize
    the recent results of simulations of the excitation and propagation
    and other novel wave characteristics of spin waves, highlighting
    how the micromagnetic computer simulation approach contributes to
    an understanding of spin dynamics of nanomagnetism and considering
    some of the merits of numerical simulation studies. Many examples
    of micromagnetic modelling for numerical calculations, employing
    various dimensions and shapes of patterned magnetic elements, are
    given. The current limitations of continuum micromagnetic modelling
    and of simulations based on the LandauâLifshitzâGilbert equation
    of motion of magnetization are also discussed, along with further
    research directions for spin-wave studies.},
  timestamp = {2014.01.08},
  url = {http://stacks.iop.org/0022-3727/43/i=26/a=264004}
}

@ARTICLE{Kumar2013,
  author = {D. Kumar and P. Sabareesan and W. Wang and H. Fangohr and A. Barman},
  title = {Effect of hole shape on spin-wave band structure in one-dimensional
    magnonic antidot waveguide},
  journal = {J. Appl. Phys.},
  year = {2013},
  volume = {114},
  pages = {023910},
  number = {2},
  eid = {023910},
  doi = {10.1063/1.4813228},
  keywords = {band structure; dispersion relations; magnons; quantum dots; spin
    waves},
  numpages = {6},
  publisher = {AIP},
  timestamp = {2014.01.08},
  url = {http://link.aip.org/link/?JAP/114/023910/1}
}

@ARTICLE{Landau1935,
  author = {L. D. Landau and E. M. Lifshitz},
  title = {On the theory of the dispersion of magnetic permeability in ferromagnetic
    bodies},
  journal = {Phys. Zeitsch. der Sow.},
  year = {1935},
  volume = {8},
  pages = {153},
  timestamp = {2013.05.03}
}

@ARTICLE{Lee2006,
  author = {Lee, Kyung-Jin and Dieny, Bernard},
  title = {Micromagnetic investigation of the dynamics of magnetization switching
    induced by a spin polarized current},
  journal = {Appl. Phys. Lett.},
  year = {2006},
  volume = {88},
  pages = {132506},
  number = {13},
  eid = {132506},
  doi = {http://dx.doi.org/10.1063/1.2190450},
  timestamp = {2014.01.01},
  url = {http://scitation.aip.org/content/aip/journal/apl/88/13/10.1063/1.2190450}
}

@ARTICLE{Li2003,
  author = {Li, Z. and Zhang, S.},
  title = {Magnetization dynamics with a spin-transfer torque},
  journal = {Phys. Rev. B},
  year = {2003},
  volume = {68},
  pages = {024404},
  month = {Jul},
  doi = {10.1103/PhysRevB.68.024404},
  issue = {2},
  numpages = {10},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevB.68.024404}
}

@ARTICLE{Slonczewski1996,
  author = {J.C. Slonczewski},
  title = {Current-driven excitation of magnetic multilayers },
  journal = {J. Magn. Magn. Mater.},
  year = {1996},
  volume = {159},
  pages = {L1 - L7},
  number = {1â2},
  doi = {http://dx.doi.org/10.1016/0304-8853(96)00062-5},
  issn = {0304-8853},
  timestamp = {2013.10.21},
  url = {http://www.sciencedirect.com/science/article/pii/0304885396000625}
}

@ARTICLE{Xiao2004,
  author = {Xiao, Jiang and Zangwill, A. and Stiles, M. D.},
  title = {Boltzmann test of Slonczewskis theory of spin-transfer torque},
  journal = {Phys. Rev. B},
  year = {2004},
  volume = {70},
  pages = {172405},
  month = {Nov},
  doi = {10.1103/PhysRevB.70.172405},
  issue = {17},
  numpages = {4},
  publisher = {American Physical Society},
  timestamp = {2014.01.08},
  url = {http://link.aps.org/doi/10.1103/PhysRevB.70.172405}
}

Normal compilation:

  1. pdflatex -> thesis.tex.
  2. bibtex -> intro.tex.
  3. bibtex -> theory.tex.
  4. makeidx -> thesis.tex.
  5. pdfchain -> thesis.tex.

Now if you note the entry of "magnetic!field" in Index, it says that it is on page 5. But it should be page 6. I think this simply because the makers of makeidx forgot about the content in bbl files which are produced in steps 2 and 3 of compilation.

share|improve this question
    
An example is needed. –  egreg Jan 8 at 11:43
    
How do I upload an example pdf. The malfunction is in pdf. Giving code while sharing a couple of pages of bibliography database may not be as helpful. –  DKS Jan 8 at 12:47
    
You should try producing a minimal example and add the LaTeX code to your question. –  egreg Jan 8 at 12:48
    
MWE provided by editing. –  DKS Jan 8 at 13:31
2  
I can't compile the example; it seems that the new version of Koma-Script has a problem. However, I think to know the source of the problem: you're missing another run of pdflatex thesis after the runs of BibTeX, which can change the page references of the index entries. –  egreg Jan 8 at 13:51

1 Answer 1

up vote 3 down vote accepted

The bibtex steps add material that wasn't previously known when the indexing took place (during the pdflatex run). So you have to add a new run of pdflatex

pdflatex thesis
bibtex intro
bibtex theory
bibtex ...<other chapters>...
pdflatex thesis
makeindex thesis
pdflatex thesis

As an aside, it seems that version 3.12 of Koma-Script (released a few days ago) breaks compatibility with chapterbib. Be aware of this and don't update your version of Koma-Script.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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