biblatex - 以文字形式显示卷数和期数,并在其前面加逗号

biblatex - 以文字形式显示卷数和期数,并在其前面加逗号

因此,当前的产品如下所示:

Gillies, A. (1933),《赫尔德与歌德世界文学思想的准备》,载于:英国歌德学会出版物 9(2),第 46-67 页。

不过,根据指导方针,我必须制作这个:

Gillies, A. (1933),《赫尔德与歌德世界文学思想的准备》,载于:《英国歌德学会出版物》,第 9 卷,第 2 期,第 46-67 页。

(“卷”和“期”也可以。)

以下是 MWE:

\documentclass[
12pt,
a4paper
]
{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
%\usepackage[english]{babel}

\usepackage{hyperref}
\usepackage[
language=auto,
style=authoryear,
backend=bibtex,
hyperref=true,
isbn=false,
doi=false,
citereset=chapter,
maxcitenames=3,
dashed=false,
sorting=nyt,
natbib=true, %faking natbib-commands
firstinits=true,
terseinits=false
maxbibnames=99,
%autopunct=true,
uniquename=init
]{biblatex}
\usepackage{xpatch}

\renewcommand*{\newunitpunct}{\addcomma\space} 

\begin{filecontents*}{lit.bib}

@Article{gillies,
  hyphenation     = {british},
  author      = {Gillies, Alexander},
  title       = {Herder and the Preparation of Goethe's Idea of World Literature},
  journaltitle    = {Publications of the English Goethe Society},
  volume      = {9},
    issue = {2},
  date        = {1933},
  pages       = {46--67},
  annotation      = {An \texttt{article} entry with a \texttt{series} and a \texttt{volume} field.
            Note that format of the \texttt{series} field in the database file}
}
\end{filecontents*}

\addbibresource{lit.bib}

\begin{document}
\chapter{First Chapter}
\begin{itemize}
    \item For the case of multiple editors, these are just some words.\footcite[See][p. xi]{gillies}.
\end{itemize}
\printbibliography
\end{document}

答案1

下面的代码实现了您想要的自定义。代码很多(但大部分是默认代码的重复),纯粹是因为我想让它更健壮一些。它并不完美(我没时间,做了一些改动),但它应该可以工作。

笔记number:正如解决方案所示,仅当系列字段紧接在前面时,字段前的逗号和空格incollection才会出现(但应该始终如此)

编辑:如果 incollection 引用应该按原样打印,则需要注释掉下面代码中标记的行 - 这样,的表示形式number将保持不变

\documentclass[
12pt,
a4paper
]
{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
%\usepackage[english]{babel}

\usepackage{hyperref}
\usepackage[
language=auto,
style=authoryear,
backend=bibtex,
hyperref=true,
isbn=false,
doi=false,
citereset=chapter,
maxcitenames=3,
dashed=false,
sorting=nyt,
natbib=true, %faking natbib-commands
firstinits=true,
terseinits=false
maxbibnames=99,
%autopunct=true,
uniquename=init
]{biblatex}
\usepackage{xpatch}

\renewcommand*{\newunitpunct}{\addcomma\space} 

\begin{filecontents*}{lit.bib}
@InCollection{brandt,
  options     = {useprefix=false},
  hyphenation     = {german},
  indexsorttitle  = {Nordischen Lander von der Mitte des 11. Jahrhunderts bis 1448},
  author      = {von Brandt, Ahasver and Hoffmann, Erich},
  editor      = {Ferdinand Seibt},
  indextitle      = {Nordischen L{\"a}nder von der Mitte des 11.~Jahrhunderts bis 1448, Die},
  title       = {Die nordischen L{\"a}nder von der Mitte des 11.~Jahrhunderts bis 1448},
  shorttitle      = {Die nordischen L{\"a}nder},
  booktitle   = {Europa im Hoch- und Sp{\"a}tmittelalter},
  series      = {Handbuch der europ{\"a}ischen Geschichte},
  number      = {2},
  publisher   = {Klett-Cotta},
  location    = {Stuttgart},
  date        = {1987},
  pages       = {884--917},
  annotation      = {An \texttt{incollection} entry with a \texttt{series} and a \texttt{number}.
            Note the format of the printed name and compare the \texttt{useprefix} option in
            the \texttt{options} field as well as \texttt{vangennep}. Also note the
            \texttt{indextitle, and \texttt{indexsorttitle} fields}}
}
@Article{gillies,
  hyphenation     = {british},
  author      = {Gillies, Alexander},
  title       = {Herder and the Preparation of Goethe's Idea of World Literature},
  journaltitle    = {Publications of the English Goethe Society},
  volume      = {9},
    issue = {2},
  date        = {1933},
  pages       = {46--67},
  annotation      = {An \texttt{article} entry with a \texttt{series} and a \texttt{volume} field.
            Note that format of the \texttt{series} field in the database file}
}
\end{filecontents*}

\addbibresource{lit.bib}

%taken from standard.bbx
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addcomma\space}% THIS LINE CHANGED to add comma
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

%taken from standard.bbx
\renewbibmacro*{issue+date}{%
  \printtext{%   REMOVED parenthesis here
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
       \usebibmacro{date}}}%
  \newunit}

%modified from english.lbx
\DefineBibliographyStrings{english}{%
    issue  = {\lowercase{i}ss\adddot}, % avoid capitalization after dots.
}

%modified from biblatex.def
%starred version removes entry specific formatting
\DeclareFieldFormat*{volume}{\bibstring{volume}~#1\space}
\DeclareFieldFormat*{issue}{\bibstring{issue}~#1}
\DeclareFieldFormat*{number}{\bibstring{number}~#1} %comment to leave number as before
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1}\addcomma\space}
\DeclareFieldFormat{series}{{#1}\addcomma\space} %comment to leave number as before


\begin{document}
\chapter{First Chapter}
\begin{itemize}
    \item For the case of multiple editors, these are just some words.\footcite[See][p. xi]{gillies}.
    \item Something for the other thing.\footcite{brandt}
\end{itemize}
\printbibliography
\end{document}

如果你想要用“vol.”代替“no.”,一个简单的解决方法是替换

\DefineBibliographyStrings{english}{%
    issue  = {\lowercase{i}ss\adddot}, % avoid capitalization after dots.
}

\DefineBibliographyStrings{english}{%
    number = {\lowercase{v}ol\adddot}, % avoid capitalization after dots.
    issue  = {\lowercase{i}ss\adddot}, % avoid capitalization after dots.
}

相关内容