使 biblatex 跳過特定引文的作者,將其保留在參考書目中

使 biblatex 跳過特定引文的作者,將其保留在參考書目中

我想放棄author特定命令中 biblatex 條目的字段\cite(就像它根本沒有作者一樣),但仍然將其列在書目中。

我需要這個,因為這些數字是我的原創作品,在引文中重複我的名字是很尷尬的。所以基本上:

\begin{figure}[!hbt]
  \centering
  \includegraphics[width=300px]{image.jpg}
  \caption{\cite[]{the-biblatex-entry}} % *shouldn't* produce my name, only title, date, etc...
\end{figure}

\printbibliography % *should* produce my name, along with title, date, etc...

我可以使用 以外的其他命令\cite\citenoauthor如果我知道如何製作的話,我真的很想有一個命令。

編輯:這是一個 MWE

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{example.bib}
@book{somebook,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}

\usepackage[style=verbose,backend=bibtex]{biblatex} %backend tells biblatex what you will be using to process the bibliography file
\bibliography{example}

\begin{document}
\cite{somebook} % I'd like this to not include the author, only the other fields
\printbibliography % All the fields, please
\end{document}

答案1

這個\caption問題可以透過明智地使用來解決,或者您可以使用's\protect定義您自己的「強大」命令(預設需要並載入)。那是:etoolbox\newrobustcmdbiblatexetoolbox

\caption{%
  \AtNextCitekey{\protect\clearname{author}}%
  \cite{somebook}}

或者:

\newrobustcmd{\hlcite}[1]{%
  \AtNextCitekey{\clearname{author}}%
  \cite{#1}}

完整範例:

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{example.bib}
@book{somebook,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}

\usepackage[style=verbose,backend=bibtex]{biblatex}
%\bibliography{example}% <-- deprecated
\addbibresource{example.bib}
\usepackage{caption}

\newrobustcmd{\hlcite}[1]{%
  \AtNextCitekey{\clearname{author}}%
  \cite{#1}}

\begin{document}
\begin{figure}
  \rule{3cm}{3cm}
  \caption{%
    \AtNextCitekey{\protect\clearname{author}}%
    \cite{somebook}}
\end{figure}

\begin{figure}
  \rule{3cm}{3cm}
  \caption{\hlcite{somebook}}
\end{figure}

\printbibliography
\end{document}

相關內容