我正在使用该类APA6
编写一篇文章。引用文章时,第一次引用条目时写出的名称比第二次引用时写出的名称多。
这很好,但有时我想控制打印哪个版本(较长或较短)(一种用例可能是我想创建一个表格,其中长格式占用了太多空间,或者我想列出一些文章并使其格式看起来相同)。我该如何实现这一点?(我宁愿不操纵 APA6 类本身,因为我希望这个解决方案是可移植的)。
MWE 演示:
\documentclass[biblatex]{apa6}
\usepackage[american]{babel}
\usepackage{csquotes}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{References.bib}
\begin{document}
This is a test. The best test ever was actually written by \cite{Testson2019}. I repeat: It was written by \cite{Testson2019}.
\printbibliography
\end{document}
我的References.bib
文件如下所示:
@article{Testson2019,
Author = {Test Testson AND Trying Tryingson AND Latex Latexson AND Stack Exchangeson},
Journal = {Journal of Silly Articles},
Number = {1},
Pages = {1-10},
Title = {This is a silly journal article},
Volume = {1},
Year = {2019}}
生成
这是一个测试。有史以来最好的测试实际上是由 Testson、Tryingson、Latexson 和 Exchangeson 于 2019 年编写的。我再说一遍:它是由 Testson 等人于 2019 年编写的。
可以看出,第二次Testson2019
引用时使用了“et al.”而不是打印所有四个姓氏。
答案1
biblatex-apa
检查\ifciteseen
引文是否应以长格式或短格式出现。您可以通过在引文开头重新定义该测试来操纵其决定。
您可以将其打包成两个命令,并在之前发出这两个命令\cite
来改变其行为。
\documentclass[biblatex]{apa6}
\usepackage[american]{babel}
\usepackage{csquotes}
\addbibresource{biblatex-examples.bib}
\makeatletter
\newcommand*{\ForceNextCiteShort}{\AtNextCite{\let\ifciteseen\@firstoftwo}}
\newcommand*{\ForceNextCiteLong}{\AtNextCite{\let\ifciteseen\@secondoftwo}}
\makeatother
\begin{document}
This is a test. The best test ever was actually written by \cite{yoon}.
I repeat: It was written by \cite{yoon}.
\ForceNextCiteLong\cite{yoon}
I repeat: It was written by \cite{yoon}.
\ForceNextCiteShort\cite{cotton}
\cite{cotton}
\printbibliography
\end{document}
不过,这些\cite
s 仍按正常方式被跟踪。因此,在 MWE 中,第二个cotton
引用很短,即使没有对该作品的长引用。如果您希望强制引用不影响一般的长/短行为,您需要一个稍微更复杂的定义
\makeatletter
\newcommand*{\ForceNextCiteShort}{%
\AtNextCite{%
\blx@opt@citetracker@false
\protected\long\def\blx@imc@ifentryseen##1##2##3{##2}%
\let\ifciteseen\@firstoftwo}}
\newcommand*{\ForceNextCiteLong}{%
\AtNextCite{%
\blx@opt@citetracker@false
\protected\long\def\blx@imc@ifentryseen##1##2##3{##3}%
\let\ifciteseen\@secondoftwo}}
\makeatother
这意味着引用跟踪器忽略了该引用。