更改章节位置 Biblatex

更改章节位置 Biblatex

我想将章​​节设置在标题之后(或者如果是 titleaddon,则设置在 titleaddon 之后,或者如果是 subtitle,则设置在 subtitle 之后,或者如果是 subtitle addon,则设置在 subtitle addon 之后),而不是条目的末尾。

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}
\usepackage[
  backend=biber,
  style=ext-authoryear,
  sorting=nyvt,
  datamodel=customstyles,
  maxnames=25,
  innamebeforetitle=true,
  usetranslator=true,
  alldates=terse,
  labeldate=year,
  dashed=false,
  doi=false,
  isbn=false,
  url=false
]{biblatex}
\addbibresource{\jobname.bib}
% no period after addon titles
\renewcommand*{\titleaddonpunct}{\addspace}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
\DeclareFieldAlias{booktitleaddon}{titleaddon}
\DeclareFieldAlias{maintitleaddon}{titleaddon}
\DeclareFieldAlias{journaltitleaddon}{titleaddon}
\DeclareFieldAlias{lawtitleaddon}{titleaddon}
\DeclareFieldAlias{subtitleaddon}{titleaddon}
\begin{filecontents}{\jobname.bib}

@inbook{iKonjaku.2003,
    author = {Mabuchi, Kazuo and Kunisaku, Fumimaro and Inagaki Taichi},
    crossref = {Konjaku.2003},
    chapter = {11.1},
    publisher = {Shogakukan Inc},
    title = {Sh\={o}toku-taishi kono ch\={o} ni shite hajimete bupp\={o} o hirome tamau-go},
    titleaddon = {Die Geschichte von Prinz Sh\={o}toku, dem Ersten, der das Buddha-Dharma an diesem Morgen verbreitete},
    year = {2003}}
    

@book{Konjaku.2003,
    address = {T{\=o}ky{\=o}},
    author = {Mabuchi, Kazuo and Kunisaku, Fumimaro and Inagaki Taichi},
    keywords = {primary},
    number = {1},
    organization = {Japan Knowledge},
    publisher = {Shogakukan Inc},
    series = {Shinpen Nihon koten bungaku zensh\={u} [Neuausgabe Gesamtwerke klassicher japanischer Literatur]},
    title = {Konjaku-monogatari-sh\={u}},
    titleaddon = {Geschichtensammlung von Jetzt und Einst},
    volume = {35},
    year = {2003}}

\end{filecontents}
% Step 3: Add defined file as resource
\begin{document}
 \nocite{*} 
\printbibliography
\end{document}

图像

答案1

该章节由 bibmacro 打印chapter+pages,因此您只需将此 bibmacro 移到相关参考书目驱动程序的定义中(@inbook@incollection@inproceedings保持一致性)。这些驱动程序的定义可以在ext-standard.bbx

\documentclass{scrartcl}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[
  backend=biber,
  style=ext-authoryear,
  sorting=nyvt,
  datamodel=customstyles,
  maxnames=25,
  innamebeforetitle=true,
  usetranslator=true,
  alldates=terse,
  labeldate=year,
  dashed=false,
  doi=false,
  isbn=false,
  url=false
]{biblatex}

\renewcommand*{\titleaddonpunct}{\addspace}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
\DeclareFieldAlias{booktitleaddon}{titleaddon}
\DeclareFieldAlias{maintitleaddon}{titleaddon}
\DeclareFieldAlias{journaltitleaddon}{titleaddon}
\DeclareFieldAlias{lawtitleaddon}{titleaddon}
\DeclareFieldAlias{subtitleaddon}{titleaddon}

\DeclareBibliographyDriver{inbook}{%
  \usebibmacro{introcite:plain}%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \usebibmacro{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{crosscite}{inbook:parent}%
  \newunit\newblock
  \usebibmacro{isbn}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \ifboolexpr{togl {bbx:related} and not test {\iffieldxref{related}}}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{introcite:plain}%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \usebibmacro{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{crosscite}{incollection:parent}%
  \newunit\newblock
  \usebibmacro{isbn}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \ifboolexpr{togl {bbx:related} and not test {\iffieldxref{related}}}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{inproceedings}{%
  \usebibmacro{introcite:plain}%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \usebibmacro{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{crosscite}{inproceedings:parent}%
  \newunit\newblock
  \usebibmacro{isbn}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \ifboolexpr{togl {bbx:related} and not test {\iffieldxref{related}}}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\begin{filecontents}{\jobname.bib}
@inbook{iKonjaku.2003,
  author     = {Mabuchi, Kazuo and Kunisaku, Fumimaro and Inagaki Taichi},
  crossref   = {Konjaku.2003},
  chapter    = {11.1},
  publisher  = {Shogakukan Inc},
  title      = {Sh\={o}toku-taishi kono ch\={o} ni shite hajimete bupp\={o} o hirome tamau-go},
  titleaddon = {Die Geschichte von Prinz Sh\={o}toku, dem Ersten,
                der das Buddha-Dharma an diesem Morgen verbreitete},
  year       = {2003},
}
@book{Konjaku.2003,
  address      = {T{\=o}ky{\=o}},
  author       = {Mabuchi, Kazuo and Kunisaku, Fumimaro and Inagaki Taichi},
  keywords     = {primary},
  number       = {1},
  organization = {Japan Knowledge},
  publisher    = {Shogakukan Inc},
  series       = {Shinpen Nihon koten bungaku zensh\={u}
                  [Neuausgabe Gesamtwerke klassicher japanischer Literatur]},
  title        = {Konjaku-monogatari-sh\={u}},
  titleaddon   = {Geschichtensammlung von Jetzt und Einst},
  volume       = {35},
  year         = {2003},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
 \nocite{*} 
\printbibliography
\end{document}

如果你不想为了移动几行而复制那么多代码,你可以使用xpatch修补驱动程序

\documentclass{scrartcl}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[
  backend=biber,
  style=ext-authoryear,
  sorting=nyvt,
  datamodel=customstyles,
  maxnames=25,
  innamebeforetitle=true,
  usetranslator=true,
  alldates=terse,
  labeldate=year,
  dashed=false,
  doi=false,
  isbn=false,
  url=false
]{biblatex}

\renewcommand*{\titleaddonpunct}{\addspace}
\DeclareFieldFormat{titleaddon}{\mkbibbrackets{#1}}
\DeclareFieldAlias{booktitleaddon}{titleaddon}
\DeclareFieldAlias{maintitleaddon}{titleaddon}
\DeclareFieldAlias{journaltitleaddon}{titleaddon}
\DeclareFieldAlias{lawtitleaddon}{titleaddon}
\DeclareFieldAlias{subtitleaddon}{titleaddon}

\usepackage{xpatch}

\newcommand*{\MoveChapAndPagesInDriver}[1]{%
  \xpatchbibdriver{#1}
    {\newunit\newblock
     \usebibmacro{chapter+pages}}
    {}
    {}
    {\PackageError
       {patch-biblatex}
       {Failed to remove 'chapter+pages' from @#1 driver}
       {}}%
  \xpatchbibdriver{#1}
    {\usebibmacro{in:}}
    {\newunit\newblock
     \usebibmacro{chapter+pages}%
     \usebibmacro{in:}}
    {}
    {\PackageError
       {patch-biblatex}
       {Failed to remove 'chapter+pages' from @#1 driver}
       {}}%
}

\MoveChapAndPagesInDriver{inbook}
\MoveChapAndPagesInDriver{incollection}
\MoveChapAndPagesInDriver{inproceedings}

\begin{filecontents}{\jobname.bib}
@inbook{iKonjaku.2003,
  author     = {Mabuchi, Kazuo and Kunisaku, Fumimaro and Inagaki Taichi},
  crossref   = {Konjaku.2003},
  chapter    = {11.1},
  publisher  = {Shogakukan Inc},
  title      = {Sh\={o}toku-taishi kono ch\={o} ni shite hajimete bupp\={o} o hirome tamau-go},
  titleaddon = {Die Geschichte von Prinz Sh\={o}toku, dem Ersten,
                der das Buddha-Dharma an diesem Morgen verbreitete},
  year       = {2003},
}
@book{Konjaku.2003,
  address      = {T{\=o}ky{\=o}},
  author       = {Mabuchi, Kazuo and Kunisaku, Fumimaro and Inagaki Taichi},
  keywords     = {primary},
  number       = {1},
  organization = {Japan Knowledge},
  publisher    = {Shogakukan Inc},
  series       = {Shinpen Nihon koten bungaku zensh\={u}
                  [Neuausgabe Gesamtwerke klassicher japanischer Literatur]},
  title        = {Konjaku-monogatari-sh\={u}},
  titleaddon   = {Geschichtensammlung von Jetzt und Einst},
  volume       = {35},
  year         = {2003},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
 \nocite{*} 
\printbibliography
\end{document}

结果

Mabuchi,Kazuo,Fumimaro Kunisaku与Inagaki Taichi(2003b)。 “圣德王子的第一部佛法史及其后来的今天”[圣德王子的第一部佛法史及其后来的今天]。卡普。 11.1.出自:今昔物语[当时和将来的历史汇集]。屋宇署35. 新日本古典文学全书[新日本古典文学全书] 1.东京:小学馆

两种情况都是一样的。

相关内容