我正在设置我的参考书目,但遇到了一个小问题。我使用的是 bibstyle authoryear
,它在 (year) 后面提供了一个“。”。因此,“in”会自动写成“In:”。这太丑了……
我尝试用“,”替换那个“。”,并使用小写“in”。否则,我还尝试删除 in 后面的“:”。
总的来说,我希望看到类似
MHONE,Guy(1992)。 “政治......马拉维”,MHONE,Guy(编辑)。马拉维在...
以下是 MWE:
\documentclass[a4paper,12pt]{book}
% these is the full list of the packages I use if ever the is conflict...
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage[french]{babel} % my french setting
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage[pdftex]{graphicx}
\usepackage[top=2.5cm, bottom=2.5cm, right=1.5cm, left=1.5cm, headheight = 20pt]{geometry}
\usepackage{pifont}
\usepackage{xspace}
\usepackage{setspace}
\usepackage{mathptmx}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[titletoc]{appendix}
\usepackage[hidelinks]{hyperref}
\usepackage{tocloft}
\usepackage{calc}
\usepackage{tocbibind}
\usepackage{pdfpages}
\usepackage{emptypage}
\usepackage{bookmark}
\usepackage{quoting}
\quotingsetup{vskip=0em}
\usepackage[font=footnotesize,labelfont=bf]{caption}
\usepackage{microtype}
%************************************************
% *
% MISE EN PAGE DE LÀ BIBLIOGRAPHIE *
% *
%************************************************
\usepackage[backend=biber,language=auto,sorting=nyt,bibstyle=authoryear,citestyle=authortitle-icomp]{biblatex}
%commandes de citation journal & revue
\renewbibmacro*{date}{\printdate}
\DeclareCiteCommand{\citejournal}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{journal}
\setunit{\addspace}
\usebibmacro{date}
\setunit{\addspace}
\usebibmacro{title}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcitejournal}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{journal}
\setunit{\addspace}
\usebibmacro{date}
\setunit{\addspace}
\usebibmacro{title}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citerevue}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{title}
\setunit{\addspace}
\usebibmacro{journal+issuetitle}
\setunit{\addspace}
\usebibmacro{date}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footciterevue}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{title}
\setunit{\addspace}
\usebibmacro{journal+issuetitle}
\setunit{\addspace}
\usebibmacro{date}}
{\multicitedelim}
{\usebibmacro{postnote}}
% Put editor string in parentheses
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
% Obtenir le nom de l'éditeur pour les @incollection entre le 'in' et le titre
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}\intitlepunct}%
\ifentrytype{article}{}{}%
\ifentrytype{incollection}{%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}}%
\setunit{\addspace}
\newunit\newblock}
% mettre entre parenthèses le numéro de la revue dans un volume en comportant plusieurs
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit*{\addnbspace}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
%new toggle pour sources primaires
\newtoggle{blx@bibdriver@article:journalyear}%new toggle to set which driver is to use
\togglefalse{blx@bibdriver@article:journalyear}
%redefine author-macro so it only prints the year in the default bibdriver
\renewbibmacro*{author}{%also modified
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\usebibmacro{bbx:savehash}%
\printnames{author}%
\iffieldundef{authortype}
{\setunit{\addspace}}
{\setunit{\addcomma\space}}}%
\iffieldundef{authortype}
{}
{\usebibmacro{authorstrg}%
\setunit{\addspace}}}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\addspace}}%
\iftoggle{blx@bibdriver@article:journalyear}{}{%added
\usebibmacro{date+extrayear}}}%modified
%new bibdriver for article in the second bibliography
\newbibmacro*{article:journalyear}{%modified bibdriver for article
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{date}
\newunit
\usebibmacro{title}%
\newunit
\usebibmacro{author/translator+others}%
\newunit
\usebibmacro{note+pages}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
%redeclare the existing bibdriver for article
\DeclareBibliographyDriver{article}{%from standard.bbx
\iftoggle{blx@bibdriver@article:journalyear}{\usebibmacro{article:journalyear}}{%added
\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}}
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{mhone_crossroads_1992,
title = {The Political Economy of Malawi - An Overview},
chapter = {1},
author = {Guy Mhone},
year = {1992},
booktitle = {Malawi At The Crossroads. The Post-Colonial Political Economy},
editor = {Guy Mone},
publisher = {\textsc{SAPES} Books},
address = {Harare},
pages = {1--34},
keywords = {malawi_histoire},
},
\end{filecontents}
\bibliography{\jobname}
\begin{document}
\nocite{*}
\printbibliography[keyword=malawi_histoire,heading=subbibliography,title={Malawi: histoire sociale}]
\end{document}
答案1
更改您的重新定义in:
如下并修改\intitlepunt
\renewcommand*{\intitlepunct}{\addspace}
% Obtenir le nom de l'éditeur pour les @incollection entre le 'in' et le titre
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}}%
\printunit{\intitlepunct}%
\ifentrytype{incollection}{%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}}%
{}%
\newunit\newblock}
您可以使用激进的解决方案,将所有句号替换为逗号
\renewcommand*{\newunitpunct}{\addcomma\space}
\setunit{\addcomma\space}
或者在已经很长的定义中添加一行(第一行:)in:
% Obtenir le nom de l'éditeur pour les @incollection entre le 'in' et le titre
\renewbibmacro*{in:}{%
\setunit{\addcomma\space}%
\printtext{\bibstring{in}}%
\printunit{\intitlepunct}%
\ifentrytype{incollection}{%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}}%
{}%
\newunit\newblock}