我正在使用该类apa6
来编写元分析。对于参考书目,我使用的是biblatex-apa
。我想用星号 ( *
) 标记所有作为主要研究的参考文献。星号应位于第一作者姓氏的前面。我的第一次尝试是将星号添加到作者的 bibtex 条目中。这失败了,因为星号也出现在文本中 :/
我发现该apacite
包有一个方便的\nocitemeta
命令,只需在参考列表中添加星号即可。我不想切换到,apacite
否则biblatex-apa
工作正常。有没有简单的解决方法biblatex
?
答案1
您可以将以下内容添加到序言中
\newtoggle{bib@asterisk}
\DeclareEntryOption{asterisk}[true]{\settoggle{bib@asterisk}{#1}}
\renewbibmacro*{begentry}{%
\iftoggle{bib@asterisk}%
{*}%
{}%
}
asterisk
这允许您在文件中针对每种类型设置选项.bib
。如果设置了此选项,则将在参考书目条目前打印一个星号。
像这样使用
@book{uthor,
author = {Uthor, Arnold},
title = {A Book},
date = {2013},
location = {Place},
publisher = {P. Ublisher's \& Co.},
options = {asterisk},
}
平均能量损失
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{bohec,
author = {Le Bohec, Yann},
title = {Histoire militaire des guerres puniques},
date = {1996},
location = {Monaco},
publisher = {Rocher},
isbn = {2-268-02147-5},
options = {asterisk},
}
@book{uthor,
author = {Uthor, Arnold},
title = {A Book},
date = {2013},
location = {Place},
publisher = {P. Ublisher's \& Co.},
options = {asterisk},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\newtoggle{bib@asterisk}
\DeclareEntryOption{asterisk}[true]{\settoggle{bib@asterisk}{#1}}
\renewbibmacro*{begentry}{%
\iftoggle{bib@asterisk}%
{*}%
{}%
}
\begin{document}
\cite{wilde,cicero,coleridge,vangennep,bohec,uthor}
\printbibliography
\end{document}
如果您更喜欢即时的解决方案,请尝试一下。
我们声明一个新的书目类别asterisk
。
\DeclareBibliographyCategory{asterisk}
\renewbibmacro*{begentry}{%
\ifcategory{asterisk}%
{*}%
{}%
}
然后我们就可以\addtocategory{asterisk}{uthor,bohec}
在文档中使用。
这会不是打印有问题的条目,如果打印的话只需将其标记为需要星号即可。
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{bohec,
author = {Le Bohec, Yann},
title = {Histoire militaire des guerres puniques},
date = {1996},
location = {Monaco},
publisher = {Rocher},
isbn = {2-268-02147-5},
}
@book{uthor,
author = {Uthor, Arnold},
title = {A Book},
date = {2013},
location = {Place},
publisher = {P. Ublisher's \& Co.},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareBibliographyCategory{asterisk}
\renewbibmacro*{begentry}{%
\ifcategory{asterisk}%
{*}%
{}%
}
\begin{document}
\addtocategory{asterisk}{uthor,bohec}
\cite{wilde,cicero,coleridge,vangennep,bohec,uthor}
\printbibliography
\end{document}
两种 MWE 均产生
使用第二种方法,
\DeclareBibliographyCategory{asterisk}
\renewbibmacro*{begentry}{%
\ifcategory{asterisk}%
{*}%
{}%
}
我们甚至可以\nocitemeta
通过以下方式定义
\newcommand*{\nocitemeta}[1]{%
\nocite{#1}%
\addtocategory{asterisk}{#1}%
}
我们可以使用类似于 APAcite 的命令\nocitemeta
。请注意,即使\nocitemeta
之前引用过的条目\nocitemeta
在执行 时也会得到星号。
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{bohec,
author = {Le Bohec, Yann},
title = {Histoire militaire des guerres puniques},
date = {1996},
location = {Monaco},
publisher = {Rocher},
isbn = {2-268-02147-5},
}
@book{uthor,
author = {Uthor, Arnold},
title = {A Book},
date = {2013},
location = {Place},
publisher = {P. Ublisher's \& Co.},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareBibliographyCategory{asterisk}
\renewbibmacro*{begentry}{%
\ifcategory{asterisk}%
{*}%
{}%
}
\newcommand*{\nocitemeta}[1]{%
\nocite{#1}%
\addtocategory{asterisk}{#1}%
}
\begin{document}
\nocitemeta{bohec,uthor}
\cite{wilde,cicero,coleridge,vangennep,bohec}
\printbibliography
\end{document}