Biblatex 自定义分隔符

Biblatex 自定义分隔符

我想要使​​用 biblatex 来创建一个如下所示的书目样式:

作者。标题、编辑、地点年份

我设法拼凑了一些内容,但仍有两个问题我无法解决:

  • 如果 .bbl 文件中有其他信息,它们将在参考书目中列出(这可以通过不让 Citavi 输出这些字段来解决,但我希望能够在 latex 中控制它,而不必每次决定更改它时都重新导出 .bbl)。我已经在 biblatex 中找到了控制某些部分(例如 ISBN)的一些选项,但没有全面的概述。
  • 如果类型是 phdthesis,最后一个逗号(位置和年份之间)仍会出现: 在此处输入图片描述

以下是 MWE:

    \documentclass[]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}


\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @book{Cicero.1999,
        author = {Cicero},
        year = {1999},
        title = {On the commonwealth; and, On the laws},
        address = {Cambridge and New York},
        editor = {Zetzel, J. E. G.},
        keywords = {primary}
    }
    @phdthesis{Rae.1991,
        author = {{Rae L. M.}},
        year = {1991},
        title = {A study of the versification of the African carmina Latina epigraphica},
        address = {Vancouver},
        type = {Diss.},
        keywords = {secondary}
    }
\end{filecontents}


\usepackage[bibstyle=authortitle,
            block=space,    
            isbn=false,             
            ]{biblatex}
\addbibresource{\jobname.bib}


\defbibheading{bibliography}[Bibliographie]{\section*{#1}}
\AtBeginBibliography{%
    \renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}}
\DeclareFieldFormat[article]{journaltitle}{#1}
\DeclareFieldFormat[article]{title}{\textit{#1}}
\DeclareFieldFormat[thesis]{title}{\textit{#1}}
\DeclareFieldFormat[thesis]{type}{(#1)}
\DeclareFieldFormat[article]{pages}{#1} %removing pp. before pages

\renewcommand\multilistdelim{\addslash} %delim between multiple 3+ Publ./Locations
\renewcommand\finallistdelim{\addslash} %delim between 2 Publ./Locations
\renewcommand\newunitpunct{\addcomma\space} %delim after Units
\renewcommand\labelnamepunct{\adddot\space} %delim after autor

\renewbibmacro*{publisher+location+date}{
    \printlist{location}
    \iflistundef{publisher}
    {\setunit*{\space}}
    {\setunit*{\space}}
    \printlist{publisher}
    \setunit*{\space}
    \usebibmacro{date}
    \newunit}

\renewbibmacro*{location+date}{
    \printlist{location}
    \setunit*{\space}
    \usebibmacro{date}
    \newunit}


\begin{document}
    \nocite{*}
        \printbibheading
        \printbibliography[keyword=primary,heading=
            subbibliography,%
            title={Primary}]
        \printbibliography[keyword=secondary,heading=
            subbibliography,%
            title={Secondary}]
\end{document}

到目前为止,我对我的解决方案并不满意(即使是起作用的部分,也感觉非常混乱)并且非常感谢一些指点。

答案1

感谢您出色的 MWE。与许多关于修改风格的首篇帖子相比,您的表现还不错biblatex

但到目前为止,您所做的还存在一些问题。我已注意到这些问题,并添加了您所需的额外内容。

  1. 不要在作者周围加括号,例如author = {{Rae L. M.}}。我猜你这样做是因为你不想要逗号。但最好在 bib 文件中以标准格式提供作者并修改\revsdnamepunct。如果你没有在引文中按你想要的方式打印姓名,可以更改其他设置。
  2. 您不需要明确设置论文类型指责。您可以使用 以类型字段格式请求参考书目中的缩写字符串\bibsstring
  3. 最好使用\mkbibemph而不是\emph\mkbibparens而不是()。它们的行为更聪明一些。
  4. 当您更改 bibmacros 的定义时,请确保在每行末尾都包含 % 符号,否则您将得到不需要的空格。
  5. 要删除 phdthesis 中日期前的逗号,您需要修改institution+location+date宏。
  6. 您可以使用宏中的\clearfield\clearlist和来清除不需要的字段。例如。在手册中检查您的字段是列表还是名称,或者只是普通字段。\clearname\AtEveryBibitem\AtEveryBibitem{\clearfield{note}}biblatex
  7. biblatex更喜欢date一年location以上address
  8. 您可以使用\renewcaptionname更改定义\refname参考书目
  9. 最后,除非我们在驱动程序中替换\newunitwith,否则 (Diss.) 后面会插入一个逗号。您可以通过加载包并使用\setunit*{\addspace}thesisxpatch\xpatchbibdriver

以下是我如何使用您的 MWE 的示例:

\documentclass{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Cicero.1999,
  author   = {Cicero},
  date     = {1999},
  title    = {On the commonwealth; and, On the laws},
  location = {Cambridge and New York},
  editor   = {Zetzel, J. E. G.},
  keywords = {primary}
}
@phdthesis{Rae.1991,
  author   = {Rae, L. M.},
  date     = {1991},
  title    = {A study of the versification of the African carmina Latina epigraphica},
  location = {Vancouver},
  keywords = {secondary}
}
\end{filecontents}

\usepackage[bibstyle=authortitle,block=space,isbn=false]{biblatex}
\addbibresource{\jobname.bib}

\renewcaptionname{ngerman}{\refname}{Bibliographie}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}
\DeclareFieldFormat[article]{journaltitle}{#1}
\DeclareFieldFormat[article,thesis]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[thesis]{type}{\mkbibparens{\bibsstring{#1}}}
\DeclareFieldFormat[article]{pages}{#1} %removing pp. before pages

\renewcommand\multilistdelim{\addslash} %delim between multiple 3+ Publ./Locations
\renewcommand\finallistdelim{\addslash} %delim between 2 Publ./Locations
\renewcommand\newunitpunct{\addcomma\space} %punct after Units
\renewcommand\labelnamepunct{\adddot\space} %punct after autor
\renewcommand\revsdnamepunct{} %punct after family name

\renewbibmacro*{publisher+location+date}{
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{publisher}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{institution+location+date}{%
  \printlist{location}%
  \iflistundef{institution}
    {\setunit*{\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{institution}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{location+date}{
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit}

\usepackage{xpatch}
\xpatchbibdriver{thesis}
  {\printfield{type}% replace this
   \newunit}
  {\printfield{type}% with this
   \setunit*{\addspace}}
  {}
  {}

\begin{document}
\nocite{*}
\printbibheading
\printbibliography[keyword=primary,heading=subbibliography,title={Primary}]
\printbibliography[keyword=secondary,heading=subbibliography,title={Secondary}]
\end{document}

在此处输入图片描述

相关内容