\AtBeginDocument{% 
\@ifpackageloaded{authorindex}{% 
  \ifNAT@numbers 
    \let\org@@citex\NAT@citexnum 
  \else 
    \let\org@@citex\NAT@citex 
  \fi 
  \def\@citex[#1][#2]#3{% 
    \typeout{indexing: [#1][#2]{#3}}% 
    \org@@citex[#1][#2]{#3}% 
    \@aicitey{#3}}% 
  \renewcommand\NAT@wrout[5]{% 
    \if@filesw{% 
      \let\protect\noexpand\let~\relax 
      \immediate\write\@auxout{\string\aibibcite{#5}{#1}}% 
      \immediate\write\@auxout{\string\bibcite{#5}{{#1}{#2}{{#3}}{{#4}}}}}% 
    \fi}}{}} 
\endinput 

