现有的文档代码如下:
\documentclass[12pt, final, a4paper]{article}
\usepackage[backend=biber,style=authoryear-icomp,sorting=nyt,isbn=false,doi=true,dashed=false,maxbibnames=99,uniquename=init,giveninits]{biblatex}
\addbibresource{referenser.bib}
\DeclareLabeltitle{%
\field{titleaddon}
\field{shorttitle}
\field{title}
\field{maintitle}
}
\begin{document}
Here is one sentence.\parencite{Knuth:ct-a}
Here is another sentence.\parencite{noauthor_solcell_2020}
\printbibliography
\end{document}
以及.bib
文件:
@Book{Knuth:ct-a,
author = "Donald E. Knuth",
title = "The {\TeX}book",
publisher = "Addison-Wesley",
year = "1986",
volume = "A",
series = "Computers and Typesetting",
pages = "ix + 483",
}
@online{noauthor_solcell_2020,
titleaddon = {Nationalencyklopedin},
title = {solcell},
url = {https://www.ne.se/uppslagsverk/encyklopedi/l%C3%A5ng/solcell},
urldate = {2020-04-13},
date = {2020}
}
截至目前,它打印出:
我如何打印出来国家百科全书在参考文献列表中,而不是标题中索尔塞尔当没有作者的时候?
我\DeclareLabletitle
用国家百科全书打印而不是文本中的标题。有没有类似的方法来更改参考文献列表?
由于我不完全理解上面的代码中发生了什么,您能否演示一下将这些更改放在哪里才是安全的,以使其正常工作?
答案1
正如我在回答中写道当没有提供作者时,为什么 biblatex 默认使用标题而不是作者,我该如何将其更改为使用 journaltitle?“升级”企业作者是完全没问题的,比如国家百科全书到author
您的@online
条目。
\documentclass[12pt, final, a4paper]{article}
\usepackage[backend=biber, style=authoryear-icomp,
maxbibnames=99, uniquename=init, giveninits,
dashed=false,
isbn=false, doi=true,]{biblatex}
\begin{filecontents}{\jobname.bib}
@book{Knuth:ct-a,
author = {Donald E. Knuth},
title = {The {\TeX}book},
publisher = {Addison-Wesley},
year = {1986},
volume = {A},
maintitle = {Computers and Typesetting},
pagetotal = {ix + 483},
}
@online{noauthor_solcell_2020,
author = {Nationalencyklopedin},
title = {solcell},
url = {https://www.ne.se/uppslagsverk/encyklopedi/l%C3%A5ng/solcell},
urldate = {2020-04-13},
date = {2020},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Here is one sentence. \autocite{Knuth:ct-a}
Here is another sentence. \autocite{noauthor_solcell_2020}
\printbibliography
\end{document}
我可以理解,把国家百科全书作为编辑器,但它肯定会在这里给出最好的结果。
理论上,您还可以使用在没有给出、或 的label
情况下作为后备的字段。author
editor
translator
@online{noauthor_solcell_2020,
label = {Nationalencyklopedin},
title = {solcell},
url = {https://www.ne.se/uppslagsverk/encyklopedi/l%C3%A5ng/solcell},
urldate = {2020-04-13},
date = {2020},
}
该字段的缺点label
是 Biber 无法执行唯一性计算,label
因此如果您引用两个,则可能会得到两个相同标签的不同条目国家百科全书2020 年的文章。所以我真的不能label
在这里推荐。