我的问题是,当 @inbook 中的作者和编辑姓名相同时,参考书目中不会显示作者姓名。相反,会显示一个破折号。我已经使用了 dashed=false 选项。我该如何解决这个问题?
谢谢。
梅威瑟:
\documentclass[11pt,a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, top=2.5cm, right=2.5cm, bottom=2.5cm, left=4cm]{geometry}
\usepackage[backend=biber, style=authoryear, date=year, firstinits=true, natbib=true]{biblatex}
\usepackage{csquotes}
\usepackage[turkish]{babel}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@inbook{diamond1984,
author = "Diamond, J.",
title = "Normal extinction of isolated populations.",
booktitle = "In Extinctions",
publisher = "University of Chicago Press",
year = "1984",
editor = "Nitecki, M. H.",
pages="191-246",
location="Chicago",
pagetotal = "354"
}
@inbook{spellerberg1996,
author = "Spellerberg, I. F.",
title = "Themes, terms and concepts.",
booktitle = "Conservation Biology",
publisher = "Longman",
year = "1996",
editor = "Spellerberg, I. F.",
pages="18-35",
location="London",
pagetotal = "242"
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\section{mwe}
{
Test \citep{diamond1984, spellerberg1996}
}
\printbibliography
\end{document}
biblatex.cfg:
\ProvidesFile{biblatex.cfg}
% Put your definitions here.
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat
[article,inbook,book,incollection,inproceedings,patent,thesis,unpublished]
{citetitle}{#1\isdot}
\DeclareFieldFormat
[article,inbook,book,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
\DeclareFieldFormat
[inbook,incollection]
{title}{#1\isdot}
\DeclareFieldFormat{pages}{\ifentrytype{inbook}{\mkbibparens{#1}}{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\AtBeginBibliography{
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\finalnamedelim}{\multinamedelim}
}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\addcolon\space#1}
\DefineBibliographyStrings{english}{%
pages = {s},
references = {Kaynakça},
urlseen = {Erişim Tarihi},
and = {ve},
andothers = {vd\adddot}
}
\renewcommand*{\ppspace}{}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\setunit*{\addcomma\space}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\renewbibmacro*{date+extrayear}{%
\iffieldundef{\thefield{datelabelsource}year}
{}
{%\printtext[parens]{%
\setunit{\addcomma\space}%
\iffieldsequal{year}{\thefield{datelabelsource}year}
{\printdateextralabel}%
{\printfield{labelyear}%
\printfield{extrayear}}}}%}%
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{pagetotal}
\setunit*{\addcomma\space}%
\printlist{location}
\newunit}
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\ifnamesequal{author}{editor}
{\bibnamedash}
{\printnames{editor}}%
\addspace
\mkbibparens{\usebibmacro{editorstrg}}%
\clearname{editor}}
{}}
\renewbibmacro*{maintitle+booktitle}{%
\iffieldundef{maintitle}
{}
{\usebibmacro{maintitle}%
\newunit\newblock
\iffieldundef{volume}
{}
{\printfield{volume}%
\printfield{part}%
\setunit{\addcolon\space}}}%
\usebibmacro{booktitle}%
\printfield{pages}%
\newunit}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{%
\printfield[titlecase]{booktitle}%
\setunit{\space}%
\printfield[titlecase]{booksubtitle}}%
}%
\printfield{booktitleaddon}}
\renewbibmacro{in:}{}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addcomma\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+eid}%
\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{url+urldate}{%
\printfield{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\addcomma\addspace}%
\printurldate}}
\endinput
答案1
因为无论如何都要设置dashed=false
,所以您可以删除宏的定义byeditor+others
,该宏指示biblatex
在作者和编辑者相同时使用破折号:
\documentclass[11pt,a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, top=2.5cm, right=2.5cm, bottom=2.5cm, left=4cm]{geometry}
\usepackage[backend=biber, style=authoryear, date=year, firstinits=true, natbib=true]{biblatex}
\usepackage{csquotes}
\usepackage[turkish]{babel}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
% this should probably be @incollection if the book is an anthology of some kind. You really ought not include full stops in the titles except if they occur in the middle of the title
@inbook{diamond1984,
author = "Diamond, J.",
title = "Normal extinction of isolated populations",
booktitle = "In Extinctions",
publisher = "University of Chicago Press",
year = "1984",
editor = "Nitecki, M. H.",
pages="191-246",
location="Chicago",
pagetotal = "354"
}
@inbook{spellerberg1996,
author = "Spellerberg, I. F.",
title = "Themes, terms and concepts",
booktitle = "Conservation Biology",
publisher = "Longman",
year = "1996",
editor = "Spellerberg, I. F.",
pages="18-35",
location="London",
pagetotal = "242"
}
\end{filecontents*}
% \ProvidesFile{biblatex.cfg}
% Put your definitions here.
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat
[article,inbook,book,incollection,inproceedings,patent,thesis,unpublished]
{citetitle}{#1\isdot}
\DeclareFieldFormat
[article,inbook,book,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
\DeclareFieldFormat
[inbook,incollection]
{title}{#1\isdot}
\DeclareFieldFormat{pages}{\ifentrytype{inbook}{\mkbibparens{#1}}{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\AtBeginBibliography{
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\finalnamedelim}{\multinamedelim}
}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\addcolon\space#1}
\DefineBibliographyStrings{english}{%
pages = {s},
references = {Kaynakça},
urlseen = {Erişim Tarihi},
and = {ve},
andothers = {vd\adddot}
}
\renewcommand*{\ppspace}{}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\setunit*{\addcomma\space}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\renewbibmacro*{date+extrayear}{%
\iffieldundef{\thefield{datelabelsource}year}
{}
{%\printtext[parens]{%
\setunit{\addcomma\space}%
\iffieldsequal{year}{\thefield{datelabelsource}year}
{\printdateextralabel}%
{\printfield{labelyear}%
\printfield{extrayear}}}}%}%
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{pagetotal}
\setunit*{\addcomma\space}%
\printlist{location}
\newunit}
% \renewbibmacro*{byeditor+others}{%
% \ifnameundef{editor}
% {}
% {\ifnamesequal{author}{editor}
% {\bibnamedash}
% {\printnames{editor}}%
% \addspace
% \mkbibparens{\usebibmacro{editorstrg}}%
% \clearname{editor}}
% {}}
\renewbibmacro*{maintitle+booktitle}{%
\iffieldundef{maintitle}
{}
{\usebibmacro{maintitle}%
\newunit\newblock
\iffieldundef{volume}
{}
{\printfield{volume}%
\printfield{part}%
\setunit{\addcolon\space}}}%
\usebibmacro{booktitle}%
\printfield{pages}%
\newunit}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{%
\printfield[titlecase]{booktitle}%
\setunit{\space}%
\printfield[titlecase]{booksubtitle}}%
}%
\printfield{booktitleaddon}}
\renewbibmacro{in:}{}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addcomma\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+eid}%
\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{url+urldate}{%
\printfield{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\addcomma\addspace}%
\printurldate}}
% \endinput
\addbibresource{\jobname.bib}
\begin{document}
\section{mwe}
{
Test \citep{diamond1984, spellerberg1996}
}
\printbibliography
\end{document}
请@inbook
注意不是适用于包含多位作者撰写不同文章的选集等内容。@incollection
在这种情况下,您应该使用。