我想在系列 + 数字周围设置括号。括号前的句号也应该删除。我使用 bibstyle musuos。
\documentclass[a4paper, 12pt]{scrartcl}
\usepackage[ngerman]{babel}
\begin{filecontents}[force]{\jobname.bib}
@Collection{Titel2000,
date = {2000},
editor = {Mustermann, Max},
title = {Titel},
location = {Ort},
number = {1},
series = {Reihe},
}
@InCollection{Titel2001,
author = {Mustermann, Max},
booktitle = {Buchtitel},
date = {2020},
title = {Titel},
editor = {Bauer, Agathe},
location = {Ort},
number = {1},
pages = {100--200},
series = {Reihe},
}
\end{filecontents}
%Bibliographie
\usepackage [backend=biber, style=musuos, doi=false, isbn=false, url=true]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{xpatch}
\DeclareFieldFormat{edition}{%
\ifinteger{#1}
{\textsuperscript{#1}}
{#1\isdot\setunit{\addcomma\space}}}
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{edition}%
\usebibmacro{date}%
\newunit}
\newcommand{\replaceedition}[1]{%
\xpatchbibdriver{#1}
{\printfield{edition}%
\newunit}
{}%
{}
{\typeout{failed to patch driver #1}}
}
\replaceedition{book}
\replaceedition{collection}
\replaceedition{inbook}
\replaceedition{incollection}
\replaceedition{manual}
\newcommand{\mkbibnodate}{n\adddot d\adddot}
\AtEveryCitekey{\iffieldundef{labelyear}{\restorefield{labelyear}{\mkbibnodate}}{}}
\AtEveryBibitem{\iffieldundef{labelyear}{\restorefield{year}{\mkbibnodate}}{}}
\begin{document}
Zitat 1\autocite{Titel2000} und Zitat 2\autocite{Titel2001}
\end{document}
答案1
我们重新定义series+number
bibmacro 来打印括号,我们还指示它将括号前的标点符号更改为空格。
\documentclass[a4paper, 12pt]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[
backend=biber,
style=musuos,
doi=false, isbn=false, url=true,
]{biblatex}
\renewbibmacro*{series+number}{%
\setunit{\addspace}%
\printtext[parens]{%
\printfield{series}%
\setunit*{\addspace}%
\printfield{number}%
\newunit}}
\usepackage{xpatch}
\DeclareFieldFormat{edition}{%
\ifinteger{#1}
{\textsuperscript{#1}}
{#1\isdot\setunit{\addcomma\space}}}
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{edition}%
\usebibmacro{date}%
\newunit}
\newcommand{\replaceedition}[1]{%
\xpatchbibdriver{#1}
{\printfield{edition}%
\newunit}
{}%
{}
{\typeout{failed to patch driver #1}}}
\replaceedition{book}
\replaceedition{collection}
\replaceedition{inbook}
\replaceedition{incollection}
\replaceedition{manual}
\newcommand{\mkbibnodate}{n\adddot d\adddot}
\AtEveryCitekey{\iffieldundef{labelyear}{\restorefield{labelyear}{\mkbibnodate}}{}}
\AtEveryBibitem{\iffieldundef{labelyear}{\restorefield{year}{\mkbibnodate}}{}}
\begin{filecontents}[force]{\jobname.bib}
@Collection{Titel2000,
date = {2000},
editor = {Mustermann, Max},
title = {Titel},
location = {Ort},
number = {1},
series = {Reihe},
}
@InCollection{Titel2001,
author = {Mustermann, Max},
booktitle = {Buchtitel},
date = {2020},
title = {Titel},
editor = {Bauer, Agathe},
location = {Ort},
number = {1},
pages = {100--200},
series = {Reihe},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Zitat 1\autocite{Titel2000} und Zitat 2\autocite{Titel2001}
\end{document}