biblatex / imakeidx – 避免 \citetitle 條目出現在索引中

biblatex / imakeidx – 避免 \citetitle 條目出現在索引中

我使用biblatexBiber 後端來imakeidx索引我的論文。在正文中,我用來\citetitle引用書籍或文章的名稱。這些會自動添加到索引中。我想避免這種情況。有沒有辦法保留biblateximakeidx不將這些條目添加到索引中?

這是一個 MWE:

\begin{filecontents*}{\jobname.bib}
@article{lewis1979a,
    Author = {David Lewis},
    Journal = {Philosophical Review},
    Number = {4},
    Pages = {513--543},
    Title = {Attitudes \emph{De Dicto} and \emph{De Se}},
    Volume = {88},
    Year = {1979},
}
\end{filecontents*}

\documentclass{article}

\usepackage[backend=biber,style=philosophy-classic]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{imakeidx}
\makeindex[options=-s latex.ist]

\begin{document}
As described by in Lewis's \citetitle{lewis1979a}, blabla.\index{Some Entry}

\printbibliography
\printindex

\end{document}

索引中的輸出:

MWE的輸出

答案1

由於某種原因biblatex-philsophy\citetitle命令不檢查\ifciteindex,但始終對標題進行索引。使用以下定義,我們將檢查加回來

\DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex{\indexfield{indextitle}}{}%<--- the check is new
    \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex{\indexfield{indextitle}}{}%<--- the check is new
    \printtext[bibhyperref]{\printfield[citetitle]{title}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

相關內容