我用它biblatex
来管理一些章节参考书目。我需要在文档的某些章节中以粗体打印特定的个别参考书目条目。我该如何实现?
目前我的 MWE 如下所示:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex,
maxnames = 3,
firstinits=false,
uniquename=init,
autocite=superscript,
style=nature,
articletitle=false,
natbib=true,
defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\newrefsection
\section{First section}
I am citing \autocite{angenendt,westfahl:space} and both entries will appear in the same style in my section bibliography.
\printbibliography
\newrefsection
\section{Second section}
Now I am citing again \autocite{angenendt} and \autocite{westfahl:space}, but I would like \autocite{angenendt} to be typed in bold in the bibliography this time...
\printbibliography
\end{document}
答案1
由于在您的另一个问题中(Biblatex:仅更改一个部分中列出的参考书目中的作者数量) 我们已经如此广泛地使用了切换开关,为什么不再次尝试一下呢?
\newtoggle{bbx:boldentries}
\DeclareBibliographyCategory{boldentry}
\AtEveryBibitem{\ifboolexpr{togl {bbx:boldentries} and test {\ifcategory{boldentry}}}{\bfseries}{}}
我们定义一个“书目类别” boldentry
,所有您想要的粗体条目都可以添加到该类别中
\addtocategory{boldentry}{<citekey>}
如果您希望标记的条目以粗体显示,只需发出\toggletrue{bbx:boldentries}
之前的内容即可。\printbiblioagrphy
平均能量损失
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex,
maxnames = 3,
firstinits=false,
uniquename=init,
autocite=superscript,
style=nature,
articletitle=false,
natbib=true,
defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\newtoggle{bbx:boldentries}
\DeclareBibliographyCategory{boldentry}
\AtEveryBibitem{\ifboolexpr{togl {bbx:boldentries} and test {\ifcategory{boldentry}}}{\bfseries}{}}
\begin{document}
\newrefsection
\section{First section}
I am citing \autocite{angenendt,westfahl:space} and both entries will appear in the same style in my section bibliography.
\printbibliography
\newrefsection
\section{Second section}
\addtocategory{boldentry}{angenendt}
\toggletrue{bbx:boldentries}
Now I am citing again \autocite{angenendt} and \autocite{westfahl:space}, but I would like \autocite{angenendt} to be typed in bold in the bibliography this time...
\printbibliography
\end{document}