![區分 biblatex 中的所有條目類型(例如數學與博士論文)](https://rvso.com/image/335494/%E5%8D%80%E5%88%86%20biblatex%20%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E6%A2%9D%E7%9B%AE%E9%A1%9E%E5%9E%8B%EF%BC%88%E4%BE%8B%E5%A6%82%E6%95%B8%E5%AD%B8%E8%88%87%E5%8D%9A%E5%A3%AB%E8%AB%96%E6%96%87%EF%BC%89.png)
我最近切換到 biblatex,到目前為止它很棒,但不如 bibtex 那麼容易。我遇到了一個問題,到目前為止我無法解決:
我的參考書目除了一些和之外還包含reports, techreports, mastersthesis
和。正如 biblatex 文件中所寫,前兩個映射為,第三個和第四個映射為。這背後的原因似乎不清楚,而且由於我對四個條目有不同的格式選項,因此不可能將它們組合起來。這個組合似乎安排在下面當 我自己為自訂參考書目樣式定義自己的文件時,我還為所有四個條目定義了不同的外觀。phdthesis,
articles
books
@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
您會發現@techreport
s 被映射到@report
with type = {techreport}
, while@phdthesis
和@mastersthesis
兩者分別被映射到@thesis
withtype = {phdthesis}
和type = {mastersthesis}
。所以有一種方法可以區分類型,只是不是透過條目類型,而是透過欄位type
。
我以為這些類型的輸出足夠相似,因此每個都有一個驅動程式就足夠了(@mastersthesis
除了@phdtehsis
已經自動指示我們是否有 MA 或博士論文?),當然這取決於您尋求的確切輸出,但您可以使用來檢查類型\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]
}
}
到文件的前言部分,預設映射將被忽略。