有时,我会在引用之前的句子中写上作者的名字。因此,我想在引用中隐藏它。我该怎么做?
唯一的解决方案是创建一个新的宏,例如\citewoauth
,类似于\cite
但没有作者姓名,还是我遗漏了什么?[下面的 MWE(实际上不起作用)是这样的,\parencite
但总体思路是类似的。]
\begin{filecontents}{\jobname.bib}
@article{doe_2011,
title = {A title},
author = {John Doe},
journal = {Journal},
number = {99},
pages = {483--488},
date = {2015},
}
\end{filecontents}
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[style=verbose-trad2,language=french,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
Some text\footnote{According to John Doe, it is \enquote{a complete nonsense} \parencite[485]{doe_2011}}
\printbibliography
\end{document}
答案1
authoryear
和样式authortitle
提供了\cite*
和,\parencite*
正是出于这个目的。verbose
样式没有这样的命令。
您可以使用\AtNextCite
钩子来禁用下一个引用中的名称显示
\makeatletter
\newcommand{\int@suppauth}{%
\def\ifciteibid{\@secondoftwo}%
\renewbibmacro*{cite:name}{}%
\renewbibmacro*{cite:idem}{}%
\renewbibmacro*{author}{}%
\renewbibmacro*{editor+others}{}%
\renewbibmacro*{translator+others}{}}
\newcommand{\suppauth}{\AtNextCite{\int@suppauth}}
\makeatother
第一行\int@suppauth
关闭可能出现的任何“ibid.”,第二行和第三行负责抑制名称和“idem”在短引文中的出现,而最后三行用于参考书目驱动程序(长引文)。如果要抑制的相关名称是editor
作品的名称,这也会起作用。
现在您只需说\suppauth\cite{foo}
在下面的引用中删除作者/标签名称即可。
\makeatletter
\DeclareCiteCommand*{\parencite}[\mkbibparens]
{\int@suppauth
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand*{\cite}
{\int@suppauth
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\makeatother
authoryear
然后模拟和authortitle
风格\cite*
和的行为\parencite*
。
平均能量损失
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[style=verbose-trad2,backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
\newcommand{\int@suppauth}{%
\def\ifciteibid{\@secondoftwo}%
\renewbibmacro*{cite:name}{}%
\renewbibmacro*{cite:idem}{}%
\renewbibmacro*{author}{}%
\renewbibmacro*{editor+others}{}%
\renewbibmacro*{translator+others}{}}
\newcommand{\suppauth}{\AtNextCite{\int@suppauth}}
\DeclareCiteCommand*{\parencite}[\mkbibparens]
{\int@suppauth
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand*{\cite}
{\int@suppauth
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\makeatother
\begin{document}
Lorem\footnote{According to Sigfridsson, it is \enquote{a complete nonsense} \suppauth\parencite[485]{sigfridsson}}
ipsum\footcite{geer} dolor\footnote{According to Sigfridsson again, it is \enquote{a complete nonsense} \suppauth\parencite[485]{sigfridsson}}
\citereset
Lorem\footnote{According to Sigfridsson, it is \enquote{a complete nonsense} \parencite*[485]{sigfridsson}}
ipsum\footcite{geer} dolor\footnote{According to Sigfridsson again, it is \enquote{a complete nonsense} \parencite*[485]{sigfridsson}}
\printbibliography
\end{document}
答案2
一种可能的解决方案是使用该xpatch
包(本地,即在 TeX 组中)修补条目类型的驱动程序(警告,您必须知道引用的条目类型)以在引用之前清除作者。
\xpretobibdriver{article}{\clearname{author}}{}{}
因此对于 OP 中的 MWE(该命令是脚注的本地命令)
Some text\footnote{According to John Doe, it is \enquote{a complete nonsense}
\xpretobibdriver{article}{\clearname{author}}{}{}
\parencite[485]{doe_2011}.}