区分 biblatex 中的所有条目类型(例如 mathesis 与 phdthesis)

区分 biblatex 中的所有条目类型(例如 mathesis 与 phdthesis)

我最近改用了 biblatex,到目前为止它还不错,但不如 bibtex 容易使用。我遇到了一个问题,到目前为止无法解决:

我的参考书目包含reports, techreports, mastersthesis和,phdthesis,此外还有一些articlesbooks。正如 biblatex 文档中所写,前两个映射为@reports,第三和第四个映射为@thesis。这背后的原因似乎不清楚,因为我对这四个条目有不同的格式选项,所以无法将它们组合起来。组合似乎安排在下方。biblatex.def\DeclareDriverSourceMap 我自己定义自*.bbx定义参考书目样式的文件时,我还为所有四个条目定义了不同的外观。

\DeclareBibliographyDriver{report}{ ...
...
\DeclareBibliographyDriver{phdthesis}{...

但 biblatex 仍然引用biblatex.def并忽略了我的条目。我如何才能抑制或更新部分中的命令\DeclareDriverSourceMap?首选方案是在文件中添加一些代码*.bbx,如果没有其他可能,则前言也会消失。但对于我的 MWE,在前言中重新声明似乎是不可能的。


以下是 MWE:

\begin{filecontents*}{Beispielbibliographie.bib}
@PHDTHESIS{Mus15,
  Title                    = {Doktorarbeit ABC},
  Author                   = {Wax Mustermann},
  School                   = {XY Universität},
  Year                     = {2015},
  Note                     = {ISBN unbekannt},
}
@MASTERSTHESIS{Mus10,
  Title                    = {Bachelorarbeit DEF},
  Author                   = {Martina Musterfrau},
  School                   = {XY Universität},
  Year                     = {2010},
  Note                     = {Max Mustermann},
  Type                     = {unveröffentlichte Bachelorarbeit},
}
@ARTICLE{Gan11,
  Title                    = {GHI},
  Author                   = {T. Gantenbein},
  Journal                  = {Journal für Beispiele},
  Year                     = {2011},
  Number                   = {8},
  Pages                    = {1001-1010},
  Volume                   = {43},
}
\end{filecontents*}

\begin{filecontents}{Beispiel.bbx}
\ProvidesFile{Beispiel.bbx}

\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{labelalpha,sorting=anyt}

\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelalphawidth]{%
        \printfield{prefixnumber}%
    \printfield{labelalpha}%
        \printfield{extraalpha}}}
     {\setlength{\labelwidth}{\labelalphawidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{##1\hss}}
  {\endlist}
  {\item}

\defbibenvironment{shorthand}
  {\list
     {\printfield[shorthandwidth]{shorthand}}
     {\setlength{\labelwidth}{\shorthandwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}%
      \renewcommand*{\makelabel}[1]{##1\hss}}}
  {\endlist}
  {\item}

\renewcommand*{\labelnamepunct}{\addcolon\addspace}
\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1\isdot}

\DeclareBibliographyDriver{mastersthesis}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit\newblock
  \printfield{school}%
  \newunit\newblock
  \printfield{type}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \printfield{year}%
  \newunit\newblock
  {}%
}

\DeclareBibliographyDriver{phdthesis}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit\newblock
  \printfield{school}%
  \newunit\newblock
  \printfield{year}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  {}%
}
\endinput
\end{filecontents}


\documentclass[12pt,halfparskip,BCOR0pt,DIV12]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lipsum}

\DeclareDriverSourcemap[datatype=bibtex]{
  \map{
    \step[fieldset=day, null]
  }
}

\usepackage[backend=bibtex, bibstyle=Beispiel, citestyle=alphabetic, firstinits=true, isbn=false, doi=false, url=false, maxbibnames=99]{biblatex}
\bibliography{Beispielbibliographie.bib}


\begin{document}

\lipsum[1] \cite{Gan11,Mus10,Mus15}
\lipsum[2]

\printbibliography[title=Literaturverzeichnis]

\end{document}

答案1

您会发现@techreports 被映射到@reporttype = {techreport}@phdthesis@mastersthesis都分别被映射到@thesistype = {phdthesis}type = {mastersthesis}因此,有一种方法可以区分类型,只是不是通过条目类型,而是通过字段type

我本来认为这些类型的输出足够相似,每个类型有一个驱动程序就足够了(除了已经自动指示我们是否有硕士或博士论文的字符串之外@mastersthesis,和的预期输出之间到底有@phdtehsis什么区别?),当然这取决于您寻求的确切输出,但您可以使用来检查类型\iffieldequalstr{type}{techreport}{Ohh, a @techreport}{just a normal @report}

例如

\DeclareBibliographyDriver{report}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit\newblock
  \printtext{\iffieldequalstr{type}{techreport}{Ohh, a @techreport}{just a normal @report}}
  \newunit\newblock
  \usebibmacro{finentry}}

如果你一定要抑制重映射,你可以利用只能接受一个任何类型的源映射指令biblatex.def这一事实。因此,如果你添加biblatex

\DeclareDriverSourcemap[datatype=bibtex]{
  \map{
    \step[fieldset=day, null]
  }
}

对于文档的前言,默认映射将被忽略。

相关内容