使用 biblatex 创建访谈书目类型

使用 biblatex 创建访谈书目类型

对于我的论文,我需要引用我自己进行的采访,并将其显示在参考书目中。在我的 .bib 文件中,我创建了一个名为 Interview 的新条目类型。

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@interview{homer,
  interviewee  = {Homer Simpson},
  interviewer = {Bart Simpson},
  date        = {2018-07-25},
  address     = {springfield},
keywords     = {interview},
}


\end{filecontents*}


\documentclass{article}

\usepackage[style=verbose]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
How to cite an interview. \cite{homer}

\printbibliography
\end{document}

参考书目条目应如下所示:Simpson,Homer。访谈 B. Simpson,1999 年 8 月 21 日,斯普林菲尔德。

此外,应始终按照上述说明进行引用。

我怎样才能使用 biblatex 做到这一点?

编辑:我花了几个小时研究 moewe 的链接和 biblatex 手册,但仍然没有得到我想要的结果(或者更准确地说,我只是得到了错误)。

我添加了迄今为止的代码:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@interview{homer,
    interviewee  = {Homer Simpson},
    interviewer = {Bart Simpson},
    date        = {2018-07-25},
    address     = {springfield},
    keywords     = {interview},
}

\end{filecontents*}
\begin{filecontents}{interview.dbx}
\DeclareDatamodelEntrytypes{interview}
\DeclareDatamodelFields[type=list,datatype=name]{
  interviewer,
  interviewee,
  address,
}
 \DeclareDatamodelFields[type=field, datatype=date, skipout]{
      date}

\DeclareDatamodelEntryfields[stackexchange]{
  interviewer,
  interviewee,
  address,
  }
\end{filecontents}
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[datamodel=interview,backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}

\begin{filecontents*}{authortitle.lbx}
  \ProvidesFile{authortitle.lbx}
  \InheritBibliographyExtras{ngerman}
  \NewBibliographyString{interviewee, interviewer, address, date,}
  \DeclareBibliographyStrings{%
    interviewee   = {{interviewee}},
    interviewer     = {{interviewer}{interviewer}},
    date  = {{date}{date}},
    address    = {{address}{address}},
  }
\end{filecontents*}
\DeclareLanguageMapping{ngerman}{authortitle}

\DeclareFieldFormat{interviewee}{\mkbibemph{#1}\isdot}

\DeclareFieldFormat{interviewer}{\setunit*{\addcomma\space}}

\DeclareFieldFormat{date}{\setunit*{\addcomma\space}}

\DeclareFieldFormat{address}{\mkbibemph{#1}\isdot}

\begin{document}
\nocite{*}
\cite{homer}

\printbibliography
\end{document}

答案1

如何使用 BibLaTeX/Biber 创建全新的数据类型?包含有关如何设置新条目类型的完整指南。它的内容很全面,但如果您花点时间看完它,大多数事情都应该可以正常工作。(当然,如果该答案中有任何不清楚的地方,我相信作者很乐意在评论中听到它。)

缺少的主要内容是参考书目驱动程序(新条目类型的输出最重要的部分)。文件.lbx有点偏离,有些内容\DeclareFieldFormats没有意义(要么是因为\DeclareFieldFormat它用于名称字段,但它并不适用,要么是因为它们被重新定义为仅打印标点符号)。

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@interview{homer,
  interviewee = {Homer Simpson},
  interviewer = {Bart Simpson},
  date        = {2018-07-25},
  address     = {Springfield},
}
\end{filecontents*}
\begin{filecontents}{interview.dbx}
\DeclareDatamodelEntrytypes{interview}
\DeclareDatamodelFields[type=list,datatype=name]{
  interviewer,
  interviewee,
}

\DeclareDatamodelEntryfields[interview]{
  addendum,
  doi,
  eprint,
  eprintclass,
  eprinttype,
  interviewer,
  interviewee,
  location,
  note,
  pubstate,
}
\end{filecontents}
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[datamodel=interview,backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}

\NewBibliographyString{interview}
\DefineBibliographyStrings{german}{%
  interview   = {Interview},
}

\DeclareNameAlias{interviewee}{author}

\DeclareBibliographyDriver{interview}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \printnames{interviewee}%
  \newunit\newblock
  \bibstring{interview}%
  \setunit{\addspace}%
  \printnames{interviewer}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{location+date}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\begin{document}
\cite{homer}

\printbibliography
\end{document}

荷马·辛普森。采访巴特·辛普森。斯普林菲尔德,2018 年 7 月 25 日。

相关内容