我使用biblatex
Biber 後端來imakeidx
索引我的論文。在正文中,我用來\citetitle
引用書籍或文章的名稱。這些會自動添加到索引中。我想避免這種情況。有沒有辦法保留biblatex
或imakeidx
不將這些條目添加到索引中?
這是一個 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}
索引中的輸出:
答案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}}