我使用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}}