我无法从前面的问题和答案中找到解决方案:是否可以用星号标记参考书目中的指定条目?
这是我的示例代码:
\documentclass{article}
\usepackage[sorting=none, backend=biber]{biblatex} % load the package
\addbibresource{bibfilename.bib}
\begin{filecontents}{biblatex-dm.cfg}
\DeclareBibliographyCategory{asterisk}
\end{filecontents}
\addtocategory{asterisk}{key1, key2}
\renewbibmacro*{begentry}{\ifcategory{asterisk}{*\addspace}{}}
\begin{document}
\cite{key1}
\bibliography{bibfilename.bib}
\end{document}
我收到此错误信息:
我究竟做错了什么?
答案1
请按以下方式使用:
\documentclass{article}
\usepackage[sorting=none]{biblatex} % load the package
\DeclareBibliographyCategory{asterisk}
\addbibresource{bibfilename.bib}
\addtocategory{asterisk}{key1, key2}
\renewbibmacro*{begentry}{\ifcategory{asterisk}{*\addspace}{}}
\begin{document}
\cite{key1}
\printbibliography
\end{document}
biblatex-dm.cfg
在定义所有宏之前,会读取数据模型配置文件biblatex
。或者,使用默认配置文件biblatex.cfg
\RequirePackage{filecontents}% allows overwriting
\begin{filecontents*}{biblatex.cfg}
\DeclareBibliographyCategory{asterisk}
\end{filecontents*}
\documentclass{article}
\usepackage[sorting=none]{biblatex} % load the package
\addbibresource{bibfilename.bib}
\addtocategory{asterisk}{key1, key2}
\renewbibmacro*{begentry}{\ifcategory{asterisk}{*\addspace}{}}
\begin{document}
\cite{key1}
\printbibliography
\end{document}
该文件已被读取后加载中biblatex