我想丢弃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
可以通过明智地使用来解决该问题,或者您可以使用(默认情况下需要和加载)\protect
定义自己的“强大”命令。即:etoolbox
\newrobustcmd
biblatex
etoolbox
\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}