![Biblatex:\footcite 中只有姓氏](https://linux22.com/image/286190/Biblatex%EF%BC%9A%5Cfootcite%20%E4%B8%AD%E5%8F%AA%E6%9C%89%E5%A7%93%E6%B0%8F.png)
我怎样才能在以下 MWE 中删除作者的名字?我已经隐藏了条目的卷数和页数。我只想这样读:
Brav 和 Heaton (2002)。《金融异常的竞争理论》。《金融研究评论》。
\documentclass{beamer}
\usetheme{Boadilla}
\usepackage{chngcntr}
\usepackage{lmodern}
\begingroup\newif\ifmy
\IfFileExists{\jobname.bib}{}{\mytrue}
\ifmy
\begin{filecontents}{\jobname.bib}
@ARTICLE{Brav2002,
author = {Alon Brav and J. B. Heaton},
title = {Competing Theories of Financial Anomalies},
journal = {Reveiw of Financial Studies},
year = {2002},
volume = {15:2},
pages = {575-606},
owner = {User},
timestamp = {2013.11.03}
}
\end{filecontents}
\fi\endgroup
\usepackage[backend=bibtex,citestyle=verbose]{biblatex}
\addbibresource{delete.bib}
\renewbibmacro{in:}{\hspace{-5pt}}
\AtEveryCitekey{\clearfield{pages}\clearfield{volume}}
\begin{document}
\begin{frame}
\frametitle{Stuff famous linguists asked}
\begin{block}{A block}
\begin{enumerate}
\item Is it part?\footcite{Brav2002}
\item More Saussure.
\end{enumerate}
\end{block}
\end{frame}
\end{document}
答案1
您可以使用\DeclareNameFormat
指令来丢弃名字。我刚刚在您的代码中添加了以下行
\DeclareNameFormat{}{\usebibmacro{name:first-last}{}{#5}{#1}{#7}}
它只是省略了名字的输出,正如您在下面的示例页面中看到的那样:
我必须承认,在某些部分它有点像一个黑客解决方案,因为它只是滥用 bibmacro name:first-last
,而且我也没有检查它是否正确处理名称后缀和前缀,但它在你的 MWE 环境中有效。
答案2
我建议使用以下重新定义cite:full
:
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{labelname}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}
cite:full
在verbose
样式中通常只打印整个参考书目条目,因为它将打印在参考书目中,但在此之前它会更改sortname
为default
(\DeclareNameAlias{sortname}{default}
),因此我们得到first-last
格式的名称(因为这是default
默认设置为...)。
我们只需将sortname
其改为labelname
,这样我们就可以尽可能地获得姓氏,否则获得明确的名字(取决于选项uniqeuname
;无论如何,名字格式将与后续引用相同)。
如果你无论如何都坚持姓氏,我建议
\DeclareNameFormat{family}{%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\usebibmacro{name:andothers}}
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{family}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}
编辑biblatex
>= 3.3中的新名称格式,请参阅 3.3 之前代码的编辑历史。
平均能量损失
\documentclass{beamer}
\usetheme{Boadilla}
\usepackage{chngcntr}
\usepackage{lmodern}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Brav2002,
author = {Alon Brav and J. B. Heaton},
title = {Competing Theories of Financial Anomalies},
journal = {Reveiw of Financial Studies},
year = {2002},
volume = {15:2},
pages = {575-606},
}
\end{filecontents*}
\usepackage[backend=bibtex,style=verbose]{biblatex}
\addbibresource{\jobname.bib}
\renewbibmacro{in:}{\hspace{-5pt}}
\AtEveryCitekey{\clearfield{pages}\clearfield{volume}}
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{labelname}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}
\begin{document}
\begin{frame}
\frametitle{Stuff famous linguists asked}
\begin{block}{A block}
\begin{enumerate}
\item Is it part?\footcite{Brav2002}
\item More Saussure.\footcite{Brav2002}
\end{enumerate}
\end{block}
\end{frame}
\end{document}