正如标题所述,我错过了期刊标题前的“In:”。这是我的代码:
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[german, english]{babel}
\usepackage{abstract}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[bottom]{footmisc}
\renewcommand*\footnoterule{}
\usepackage[
backend=biber,
isbn = false,
doi = false,
url = false,
style = authoryear,
]
{biblatex}
\renewcommand{\postnotedelim}{\addcolon\addspace}
\DeclareFieldFormat{postnote}{#1}
\renewcommand{\labelnamepunct}{\addcolon\addspace}
\AtEveryBibitem{\clearfield{edition}}
\AtEveryBibitem{\clearfield{pagetotal}}
\AtEveryBibitem{\clearfield{series}}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{citetitle}{#1\isdot}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1\isdot}
\DeclareFieldFormat{location}{#1\addslash} %um / zwischen Orte zu setzen
\DeclareFieldFormat{pages}{#1}
\renewcommand{\multinamedelim}{\addspace\&\space}
\renewcommand{\finalnamedelim}{\multinamedelim}
\DefineBibliographyStrings{german}{%
andothers = {et\addabbrvspace al\adddot},
editors = {Hgg\adddot},
}
% kein Komma zwischen Namen und (Hrsg.)
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\makeatletter
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\printdelim{editortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}%
\setunit{\printdelim{nameyeardelim}}}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%
\usebibmacro{date+extrayear}}
\makeatother
%Schriftenreihen in (=)
\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\printtext{=\addspace}%
\printfield{series}%
\setunit*{\addcomma\space}%
\printfield{number}%
\printtext{\addperiod}}
\nopunct}}
\renewbibmacro{in:}{In:}
% Herausgeber vor Titel des Sammelbandes
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}}%
\printunit{\intitlepunct}%
\ifentrytype{incollection}{%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\ifnameundef{translator}
{}
{\printnames{translator}%
\setunit{\addspace}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}}
{\printnames{editor}%
\setunit{\addspace}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}}%
{}%
\newunit\newblock}
%bei Journals die Heftnummer in () nach der Jahreszahlnummer
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\printtext{=\addspace}%
\printfield{series}%
\setunit*{\addcomma\space}%
\printfield{number}%
\printtext{\addperiod}}
\nopunct}}
\renewbibmacro*{in:}{
\ifentrytype{incollection}{%
\DeclareNameAlias{editor}{first-last}
\printtext{In:}
\ifnameundef{editor}
{}
{\printnames{editor}%
\addspace
\usebibmacro{editorstrg}
\setunit{\addcomma\addspace}%
}%
\usebibmacro{maintitle+booktitle}
\clearfield{maintitle}
\clearfield{booktitle}
\clearfield{volume}
\clearfield{part}
\clearname{editor}
}
{}%
}
\bibliography{test.bib}
\begin{document}
\title{Literaturliste}
\author{}
\date{}
\maketitle
\nocite{chomsky_noam_knowledge_1975}
\nocite{lenneberg1969explaining}
\nocite{pfau_roland_manual_2012}
\nocite{senghas2005language}
\pagebreak
\printbibliography
\end{document}
答案1
您有多个(三个)in:
bibmacro 的重新定义,它们的作用各不相同。由于序言是按顺序读取的,因此最后一个定义“获胜”并在整个文档中使用。
根据您的描述,我猜您想要第二次重新定义。
您可以删除第一个重新定义
\renewbibmacro{in:}{In:}
以及最后的重新定义(这也可能导致参考书目中出现不必要的空间)
\renewbibmacro*{in:}{
\ifentrytype{incollection}{%
\DeclareNameAlias{editor}{first-last}
\printtext{In:}
\ifnameundef{editor}
{}
{\printnames{editor}%
\addspace
\usebibmacro{editorstrg}
\setunit{\addcomma\addspace}%
}%
\usebibmacro{maintitle+booktitle}
\clearfield{maintitle}
\clearfield{booktitle}
\clearfield{volume}
\clearfield{part}
\clearname{editor}
}
{}%
}
in:
因此,文档中剩下的唯一重新定义是第二个:
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}}%
\printunit{\intitlepunct}%
\ifentrytype{incollection}{%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\ifnameundef{translator}
{}
{\printnames{translator}%
\setunit{\addspace}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}}
{\printnames{editor}%
\setunit{\addspace}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}}%
{}%
\newunit\newblock}
使用现代版本biblatex
(> = 3.8),您将不需要重新定义bbx:editor
,之前两行就足够了。
您还对 进行了两次重新定义series+number
,但它们的作用相同。但是,由于您明确删除了series
中的字段,因此它们永远不会被使用\AtEveryBibitem
。
我还对其他一些代码进行了现代化改造。
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[german, english]{babel}
\usepackage{abstract}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[bottom]{footmisc}
\renewcommand*\footnoterule{}
\usepackage[
backend=biber,
isbn = false,
doi = false,
url = false,
style = authoryear,
]
{biblatex}
\renewcommand{\postnotedelim}{\addcolon\addspace}
\DeclareFieldFormat{postnote}{#1}
\renewcommand{\labelnamepunct}{\addcolon\addspace}
\AtEveryBibitem{%
\clearfield{edition}%
\clearfield{pagetotal}%
\clearfield{series}%<----- Do you really want this?
}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{citetitle}{#1\isdot}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1\isdot}
\DeclareDelimFormat{multilistdelim}{\addslash}
\DeclareDelimAlias{finallistdelim}{multilistdelim}
\DeclareFieldFormat{pages}{#1}
\DeclareDelimFormat{multinamedelim}{\addspace\&\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DefineBibliographyStrings{german}{%
andothers = {et\addabbrvspace al\adddot},
editors = {Hgg\adddot},
}
% kein Komma zwischen Namen und (Hrsg.)
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
% Herausgeber vor Titel des Sammelbandes
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}}%
\printunit{\intitlepunct}%
\ifentrytype{incollection}{%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\ifnameundef{translator}
{}
{\printnames{translator}%
\setunit{\addspace}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}}
{\printnames{editor}%
\setunit{\addspace}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}}%
{}%
\newunit\newblock}
%bei Journals die Heftnummer in () nach der Jahreszahlnummer
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\printtext{=\addspace}%
\printfield{series}%
\setunit*{\addcomma\space}%
\printfield{number}%
\printtext{\addperiod}}%
\nopunct}}
\bibliography{biblatex-examples.bib}
\begin{document}
\nocite{sigfridsson,worman,companion,aksin,nussbaum,geer,cicero}
\printbibliography
\end{document}