我已经使用biblatex
包并希望以相同的格式打印作者内容。在bib
数据库中Yedidia J S and Freeman W T and Weiss Y
,并希望以与相同的 PDF 格式打印Yedidia J S and Freeman W T and Weiss Y
。以及如何ed
在前面添加Lakemeyer
?(编辑器)
我的 MWE 是:
\documentclass[english]{article}
\usepackage{babel,hyperref,fontspec}
\usepackage{csquotes,microtype}
\usepackage[bibencoding=utf8,style=numeric,sorting=none,maxbibnames=5]{biblatex}
\renewcommand*{\revsdnamepunct}{}
\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibnamedelimi}{\addnbspace}
\renewcommand*{\newunitpunct}{\space}
\renewcommand*{\finentrypunct}{}
\renewcommand*{\bibpagespunct}{}
\DeclareFieldFormat{chapter}{#1}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat[article,inproceedings]{series}{(#1)}
\DeclareFieldFormat[inproceedings]{eid}{(#1)}
\DeclareFieldFormat[thesis]{note}{\textit{#1}}
\DeclareFieldFormat[article,inproceedings,thesis,online]{title}{{#1}}
\renewbibmacro{in:}{
\ifentrytype{article}{}{
\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat[article]{volume}{\textbf{#1}}
\DeclareFieldFormat{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat[inproceedings]{booktitle}{\textit{#1}}
\DeclareFieldFormat{booktitle}{{#1}}
\DeclareListFormat{location}{%
\usebibmacro{list:delim}{#1}%
(#1:\isdot
\usebibmacro{list:andothers}}
\DeclareListFormat{publisher}{%
\usebibmacro{list:delim}{#1}%
#1\isdot)
\usebibmacro{list:andothers}}
\DeclareFieldFormat[thesis]{publisher}{#1}
\DeclareFieldFormat[thesis]{location}{#1}
\renewcommand*{\bibfont}{\fontsize{9}{11}\selectfont}
\DeclareNameAlias{default}{family-given}
\renewcommand*{\entrysetpunct}{\par}
\DefineBibliographyExtras{english}{%
\let\finalandcomma\empty
\let\finalandsemicolon\empty
}
\DeclareBibliographyDriver{article}{%
\printnames{author}%
\newunit\newblock
\printfield{series}%
\newunit\newblock
\printfield{year}%
\newunit\newblock
\printfield{title}%
\newunit\newblock
\printfield{journaltitle}%
\newunit\newblock
\printfield{volume}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printfield{pages}%
\finentry}
\DeclareBibliographyDriver{book}{%
\printnames{author}%
\newunit\newblock
\printfield{year}%
\newunit\newblock
\printfield{booktitle}%
\newunit\newblock
\printfield{title}%
\newunit\newblock
\printnames{editor}%
\newunit\newblock
\printfield{volume}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\printlist{publisher}%
\newunit\newblock
\printfield{pages}%
\newunit\newblock
\printfield{eid}%
\newunit\newblock
\printfield{url}%
\finentry}
\DeclareBibliographyDriver{inproceedings}{%
\printnames{author}%
\newunit\newblock
\printfield{year}%
\newunit\newblock
\printfield{title}%
\newunit\newblock
\printfield{booktitle}%
\newunit\newblock
\printnames{editor}%
\newunit\newblock
\printfield{volume}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\printlist{publisher}%
\newunit\newblock
\printfield{eid}%
\newunit\newblock
\printfield{pages}%
\newunit\newblock
\printfield{note}%
\finentry}
\DeclareBibliographyDriver{thesis}{%
\printnames{author}%
\newunit\newblock
\printfield{year}%
\newunit\newblock
\printfield{title}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printfield{booktitle}%
\newunit\newblock
\printnames{editor}%
\newunit\newblock
\printfield{volume}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\printlist{publisher}%
\newunit\newblock
\printfield{eid}%
\newunit\newblock
\printfield{pages}%
\finentry}
\begin{filecontents}{\jobname.bib}
@book{ipab730bbib5,
author ={Yedidia J S and Freeman W T and Weiss Y},
year ={2003},
title ={Exploring Artificial Intelligence in the New Millennium},
editor={G Lakemeyer and B Nebel},
location={San Francisco, CA},
publisher={Morgan Kaufmann},
pages={239},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\printbibliography
\nocite{*}
\end{document}
答案1
我耽心
author = {Yedidia J S and Freeman W T and Weiss Y},
根本不支持输入(至少假设耶迪迪亚,弗里曼和魏斯是姓氏,JS,野生型和是的。(英语:作者名字的首字母)。
BibTeX 和 Biber 接受的名称输入解释如下我应该如何在 bib 文件中输入作者姓名?。
输入姓名的正确方法之一是
author = {Yedidia, J. S. and Freeman, W. T. and Weiss, Y.},
另一种选择是
author = {J. S. Yedidia and W. T. Freeman and Y. Weiss},
如果名称输入正确,您可以使用biblatex
以任何您希望的格式设置名称。
您基本上已经拥有了所有要素(如以下最小化代码示例所示)
\documentclass[english]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=numeric, sorting=none, maxbibnames=5, giveninits]{biblatex}
\DeclareNameAlias{default}{family-given}
\renewcommand*{\revsdnamepunct}{}
\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibnamedelimi}{\addnbspace}
% really?
\DeclareDelimFormat{multinamedelim}{\addspace\bibstring{and}\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DefineBibliographyExtras{english}{%
\let\finalandcomma\empty
\let\finalandsemicolon\empty
}
\begin{filecontents}{\jobname.bib}
@book{ipab730bbib5,
author = {Yedidia, J. S. and Freeman, W. T. and Weiss, Y.},
year = {2003},
title = {Exploring Artificial Intelligence in the New Millennium},
editor = {G. Lakemeyer and B. Nebel},
location = {San Francisco, CA},
publisher = {Morgan Kaufmann},
pagetotal = {239},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{ipab730bbib5}
\printbibliography
\end{document}
请注意,这里编辑器被标记为编辑器。
在您的代码中没有“ed”,因为您的参考书目驱动程序只有
\printnames{editor}%
而不是像
\usebibmacro{byeditor+others}%
这也会打印“ed。”等等。
如果你将参考书目驱动程序与standard.bbx
,您会发现标准驱动程序使用了更多高级 bibmacros。如果您不使用这些 bibmacros,您可能会失去一些东西。