我的书目需要显示年份后面的版本,如下@collection
所示@incollection
:
Kuckartz,U.(2018⁴):定性内容分析:方法、实践、计算机辅助设计。魏因海姆:Beltz
Ryen, A. (2016⁴):研究伦理与定性研究。收录于:Silverman, D. (ed.):定性研究。洛杉矶:Sage,31-46。
我已经找到了几篇处理类似问题的帖子并尝试进行改编,例如:
我设法将版本号作为上标放在年份后面和括号内。但是,年份前后都有一个空格。
MWE 使用来自两个链接帖子的改编代码:
\documentclass[]{scrartcl}
\usepackage{filecontents}
\usepackage[
backend=biber,
style=ext-authoryear,
innamebeforetitle=true,
sorting=nyt,
giveninits=true,
citestyle= authoryear-icomp,
ibidpage=true,
maxbibnames=99,
maxcitenames=2,
uniquelist=false,
isbn=false,
doi=true,
dashed=false
]{biblatex}
%Edition as superscript
\renewbibmacro*{edition}{}
\DeclareFieldFormat{superedition}{\textsuperscript{#1}}
\newbibmacro*{superedition}{%
\iffieldnums{edition}
{\printfield[superedition]{edition}}
{\printfield{edition}%
\setunit{\addspace}}}
%Year^Edition within parentheses
\renewbibmacro*{date+extradate}{
\iffieldundef{labelyear}
{}
{\printtext[parens]{
\iflabeldateisdate
{\printdateextra}
{\printlabeldateextra}
\iffieldnum{edition}
{\printfield[superedition]{edition}%
\global\clearfield{edition}}
{}}}}
\begin{filecontents}{\jobname.bib}
@book{kuckartz_qualitative_2018,
location = {Weinheim},
edition = {4},
title = {Qualitative Inhaltsanalyse: Methoden, Praxis, Computerunterstützung},
publisher = {Beltz},
author = {Kuckartz, Udo},
date = {2018},}
@incollection{ryen_research_2016,
location = {Los Angeles},
edition = {4},
title = {Research ethics and qualitative research},
pages = {31--46},
booktitle = {Qualitative research},
publisher = {Sage},
author = {Ryen, Anne},
editor = {Silverman, David},
date = {2016},}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
我已经删除了所有其他修改,以查看其中是否有一个是导致出现额外空格的原因,但我仍然得到了 YEAR 之前和之后的空格。我觉得我应该修改一些内容,\pubdatedelim
但我可能错了,因为我尝试过的所有方法都没有奏效。
如果对答案有帮助,下面也是完整的代码,包括参考书目的其他修改:
\documentclass[]{scrartcl}
\usepackage{filecontents}
\usepackage[
backend=biber,
style=ext-authoryear,
innamebeforetitle=true,
sorting=nyt,
giveninits=true,
citestyle= authoryear-icomp,
ibidpage=true,
maxbibnames=99,
maxcitenames=2,
uniquelist=false,
isbn=false,
doi=true,
dashed=false
]{biblatex}
%%% Modifications that work as intended %%%%
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}} %Small caps for author/editor last name
\DeclareFieldFormat*{title}{#1} %Title without emphasis
\DeclareFieldFormat*{booktitle}{#1} %Booktitle without emphasis
\DeclareFieldFormat*{journaltitle}{#1} %Journaltitle without emphasis
\DeclareDelimFormat[bib,biblist,parencite]{multinamedelim}{\addsemicolon\space} % use semicolon to seperate authors in bibliography and citation in text
\DeclareDelimFormat[bib,biblist,parencite]{finalnamedelim}{\space\&\space} % use & to seperate last author/editor in bibliography
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space} % use colon to seperate (Year) and Title
\DeclareDelimFormat[textcite, parencite]{postnotedelim}{\addcolon\space} % use colon to seperate Year and page in citation
%%% Authors and Editors as Family-Given, except last author/editor:
\DeclareNameFormat{family-given/given-family/last}{%
\ifboolexpr{test {\ifnumless{\value{listcount}}{\value{listtotal}}} or test {\ifnumequal{\value{listcount}}{1}}}
{\ifgiveninits
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}%
\ifboolexpe{%
test {\ifdefvoid\namepartgiven}
and
test {\ifdefvoid\namepartprefix}}
{}
{\usebibmacro{name:revsdelim}}}
{\ifgiveninits
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}%
\usebibmacro{name:andothers}}
\DeclareNameAlias{sortname}{family-given/given-family/last}
\DeclareNameAlias{ineditor}{sortname}
%%%% Volume (Issue) for @article
\renewcommand*{\volnumdelim}{\space} %Removes dot between volume and issue
\DeclareFieldFormat[article]{number}{(#1)} %Parentheses around Issue
%%% Remove p. and pp.
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat{volcitepages}{\mknormrange{#1}}
\DeclareFieldFormat{multipostnote}{\mknormrange{#1}}
%Substitute Ed by with (ed.)
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}
%%% Edition as superscript -- space before and after YEAR is yet to be removed %%%
%Edition as superscript
\renewbibmacro*{edition}{}
\DeclareFieldFormat{superedition}{\textsuperscript{#1}}
\newbibmacro*{superedition}{%
\iffieldnums{edition}
{\printfield[superedition]{edition}}
{\printfield{edition}%
\setunit{\addspace}}}
%Year^Edition within parentheses
\renewbibmacro*{date+extradate}{
\iffieldundef{labelyear}
{}
{\printtext[parens]{
\iflabeldateisdate
{\printdateextra}
{\printlabeldateextra}
\iffieldnum{edition}
{\printfield[superedition]{edition}%
\global\clearfield{edition}}
{}}}}
\begin{filecontents}{\jobname.bib}
@book{kuckartz_qualitative_2018,
location = {Weinheim},
edition = {4},
title = {Qualitative Inhaltsanalyse: Methoden, Praxis, Computerunterstützung},
publisher = {Beltz},
author = {Kuckartz, Udo},
date = {2018},}
@incollection{ryen_research_2016,
location = {Los Angeles},
edition = {4},
title = {Research ethics and qualitative research},
pages = {31--46},
booktitle = {Qualitative research},
publisher = {Sage},
author = {Ryen, Anne},
editor = {Silverman, David},
date = {2016},}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
您正在自己将空白引入到代码中。
尝试这个:
%Year^Edition within parentheses
\renewbibmacro*{date+extradate}
{\iffieldundef{labelyear}{}%
{\printtext[parens]%
{\iflabeldateisdate{\printdateextra}%
{\printlabeldateextra}\iffieldnum{edition}%
{\printfield[superedition]{edition}%
\global\clearfield{edition}}{}%
}
}
}
注意每行末尾的注释符号。
PS:应该是的\nocite{*}
。