langsci / pypi

Packages for the Python Package index
2 stars 1 forks source link

indexentries in footnotes are dropped #12

Closed stefan11 closed 4 years ago

stefan11 commented 4 years ago

If \ia{Zappa, Frank} is used in a footnote, the index entry will be:

\indexentry {Zappa, Frank|infn {3}}{450}

The fixind script does not recognize the pattern, probably due to "infn" and just discards the item.

Glottotopia commented 4 years ago

works for me.

main.tex

abc
\ia{Frank Zappa}
\newpage
\iai{Bobby Brown}
\newpage
\name{Janis}{Joplin}\footnote{\name{John}{Lennon}}
\newpage
abc\footnote{\ia{Motörhead, Lemmy}}
\newpage
sdf\footnote{\citet{Nordhoff2018}}
\newpage
sdf\footnote{\ia{Lemmy Motörhead}}

main.adx

\indexentry {Frank Zappa|hyperpage}{1}
\indexentry {Bobby Brown|hyperpage}{2}
\indexentry {Joplin, Janis@Joplin, Janis|hyperpage}{3}
\indexentry {Lennon, John@Lennon, John|hyperindexformat{\infn {1}}}{3}
\indexentry {Motörhead, Lemmy|hyperindexformat{\infn {2}}}{4}
\indexentry {Nordhoff, Sebastian|hyperpage}{5}
\indexentry {Lemmy Motörhead|hyperindexformat{\infn {4}}}{6}

mainmod.adx

\indexentry {Frank Zappa|hyperpage}{1}
\indexentry {Bobby Brown|hyperpage}{2}
\indexentry {Joplin, Janis@Joplin, Janis|hyperpage}{3}
\indexentry {Lennon, John@Lennon, John|hyperindexformat{\infn {1}}}{3}
\indexentry {Motorhead, Lemmy@Motörhead, Lemmy|hyperindexformat{\infn {2}}}{4}
\indexentry {Nordhoff, Sebastian|hyperpage}{5}
\indexentry {Lemmy Motorhead@Lemmy Motörhead|hyperindexformat{\infn {4}}}{6}

main.and

\begin{theindex}

  \item Bobby Brown, \hyperpage{2}

  \indexspace

  \item Frank Zappa, \hyperpage{1}

  \indexspace

  \item Joplin, Janis, \hyperpage{3}

  \indexspace

  \item Lemmy Motörhead, \hyperindexformat{\infn {4}}{6}
  \item Lennon, John, \hyperindexformat{\infn {1}}{3}

  \indexspace

  \item Motörhead, Lemmy, \hyperindexformat{\infn {2}}{4}

  \indexspace

  \item Nordhoff, Sebastian, \hyperpage{5}

\end{theindex}

Unrelated to the bug reported, note that the footnote information is missing from the Nordhoff entry.

stefan11 commented 4 years ago

OK. The problem was that my makefile had some outdated sed commands in it replacing the hyperref code. I guess you looked for this in the fixindy script.

sed -i.backup 's/hyperindexformat{\(infn {[0-9])}/\1/' .adx