![biblatex のすべてのエントリタイプを区別する (例: mathesis と phdthesis)](https://rvso.com/image/335494/biblatex%20%E3%81%AE%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E3%82%A8%E3%83%B3%E3%83%88%E3%83%AA%E3%82%BF%E3%82%A4%E3%83%97%E3%82%92%E5%8C%BA%E5%88%A5%E3%81%99%E3%82%8B%20(%E4%BE%8B%3A%20mathesis%20%E3%81%A8%20phdthesis).png)
最近、biblatex に切り替えました。これは今のところ素晴らしいのですが、bibtex ほど簡単ではありません。これまで解決できなかった問題に遭遇しました。
私の参考文献には、 とのほかに、いくつかのreports, techreports, mastersthesis
と が含まれています。biblatex のドキュメントに書かれているように、最初の 2 つは にマッピングされ、3 番目と 4 番目は にマッピングされています。この理由は不明ですが、4 つのエントリに異なる書式設定オプションがあるため、これらを組み合わせることはできません。組み合わせは、以下のように配置されているようです。カスタム参考文献スタイル用の 独自のファイルを定義する際に、4 つのエントリすべてに異なる外観も定義しました。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
マッピングされ、とはそれぞれとで にマッピングされることがわかります。つまり、エントリ タイプではなくフィールドを使用してタイプを区別する方法があります。@report
type = {techreport}
@phdthesis
@mastersthesis
@thesis
type = {phdthesis}
type = {mastersthesis}
type
これらの型の出力は十分に類似しているため、それぞれ 1 つのドライバーがあれば十分だと思われます (修士論文または博士論文があるかどうかを自動的に示す文字列を除いて@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}}
どうしても再マッピングを抑制する必要がある場合は、がどのタイプのソースマッピングディレクティブも1つしか受け入れないbiblatex.def
という事実を利用できます。biblatex
\DeclareDriverSourcemap[datatype=bibtex]{
\map{
\step[fieldset=day, null]
}
}
ドキュメントのプリアンブルに を追加すると、デフォルトのマッピングは無視されます。