使用符合 ICD-206 标准的条目类型定制 biblatex 引文

使用符合 ICD-206 标准的条目类型定制 biblatex 引文

背景

我正在写一篇 Turabian 风格的论文,并使用biblatex-芝加哥包用于我的引文和参考书目生成。引文都是脚注,但未分类的消息来源以芝加哥风格引用,机密消息来源必须遵循ICD 206D.3.a.(6).(a)-(i) 为来源参考引文 (SRC)。这意味着有额外的字段,并且未分类和分类引文之间的顺序不同。

来源参考引文 (SRC) 顺序:

  1. 表示 SRC 分类的部分标记;IE (U) 或 (S)
  2. 信息来源的身份证明(作者、制作人、所有者、出版社)
  3. 明确的来源识别符或文件编号
  4. 标有文件标题分类的部分
  5. 文件标题,包括卷号和发行号(如果适用)
  6. 出版或访问日期
  7. 页码(如果适用)
  8. 对从源中提取的信息进行分类
  9. 源文档的总体分类
  10. 源描述符部分标记(如果适用)
  11. 来源描述声明(如果适用)

我认为它是如何运作的

我能想到三种方法来实现这一点。

  1. 使用其中一个@categories并将信息放在错误的部分只是为了在引用中获得正确的顺序。

  2. 在条目中使用关键字.bib来提示 biblatex 以不同的方式排列条目。

  3. 创建一个名为的新条目类型@src,该类型具有我需要的类别并对其进行正确排序。

选项 1 只是使用@misc字段notes来输入我自己的长字符串。

refs.bib

@misc{sourceReference1,
  author = {{(U) Smith, John}},
  notes  = {{12345678; (U) The Title...; 17 March 2022; Unclassified; Super Secret}},
}

@article{chicagoReference1,
  title       = {Has the ODNI Improved US Intelligence Analysis?},
  author      = {Gentry, John A},
  year        = {2015},
  publisher   = {Taylor \& Francis}
}

这将接近,产生如下结果:

  1. (U) 史密斯,约翰。12345678;(U)标题......;2022 年 3 月 17 日;未分类;超级机密

  2. John A. Gentry,《国家情报总监办公室是否改进了美国情报分析?》(Taylor & Francis,2015 年)

理想情况下,如果可能的话,选项 3 是最干净的。例如:

refs.bib:

@src{sourceReference1,
  src_class   = {U},              % Classification of the entire SRC
  originator  = {Smith, John},    % Originator, author, producer, owner, etc
  identifier  = {12345678},       % Unambiguous source identifier
  title_class = {U},              % Classification of the title
  title       = {The Title...},   % Title of the document
  date        = {2022-03-17},     % Date of publication
  page        = {},               % Page number, if applicable
  info_class  = {Unclassified},   % Classification of the information extracted
  doc_class   = {Super Secret},   % Classification of the source document
  descriptor  = {},               % Source descriptor, if applicable
  keywords    = {classified}      % To separate out in the bibliography
}

@article{chicagoReference1,
  title       = {Has the ODNI Improved US Intelligence Analysis?},
  author      = {Gentry, John A},
  year        = {2015},
  publisher   = {Taylor \& Francis}
}

master.tex:

\documentclass{turabian-researchpaper}

\usepackage[utf8]{inputenc}
\usepackage[pass,letterpaper]{geometry}
\usepackage{setspace}
\usepackage{biblatex-chicago}
    \addbibresource{refs.bib}

\begin{document}

This is a test.
\footcite{SourceReference1}.    %This won't work because a @SRC is made up right now
This is also a test. 
\footcite{chicagoReference1}

\clearpage
\printbibliography

\end{document}

这应该产生两个脚注:

  1. (U) 史密斯,约翰;12345678;(U) 标题......;2022 年 3 月 17 日;未分类;超级机密

  2. John A. Gentry,《国家情报总监办公室是否改进了美国情报分析?》(Taylor & Francis,2015 年)

第一个脚注的顺序与另一个脚注不同,因为另一个脚注是标准的 biblatex-chicago 样式。为了方便起见,我在 .bib 文件中按顺序排列了“@src”信息。在实际参考书目中,我会使用关键字将它们分开,我知道如何单独做到这一点。

关于如何或者是否有可能实现这一点,有什么想法吗?

谢谢你!

答案1

如何使用 BibLaTeX/Biber 创建全新的数据类型?中有一个定义新条目类型的指南biblatex

原则上,该指南适用于所有biblatex风格,但是整合将新类型融入到样式中,使一切工作无缝衔接,这可能是一个挑战,特别是对于像这样的复杂样式biblatex-chicago

下面的代码似乎可以正常工作biblatex-chicago

使用代码的主要障碍是如何使用 BibLaTeX/Biber 创建全新的数据类型?直接的是,biblatex-chicago引用也需要特定的驱动程序,因此每个驱动程序都\DeclareBibliographyDriver{<new type>}需要相应的\DeclareBibliographyDriver{cite:<new type>}引用。

\begin{filecontents}{stackexchange.dbx}
\DeclareDatamodelEntrytypes{stackexchange}
\DeclareDatamodelFields[type=field,datatype=literal]{
  sitekey,
  sitetopic,
}
\DeclareDatamodelFields[type=list,datatype=name]{
  askp,
  ansp,
}
\DeclareDatamodelFields[type=field, datatype=date, skipout]{
  askdate,
  ansdate,
  askeditdate,
  anseditdate}
\DeclareDatamodelFields[type=field, datatype=verbatim]{
  askid,
  askpid,
  anspid,
  ansid,
}
\DeclareDatamodelEntryfields[stackexchange]{
  sitekey,
  sitetopic,
  askid,
  askp,
  askpid,
  ansp,
  anspid,
  ansid,
  askyear,
  askmonth,
  askday,
  ansyear,
  ansmonth,
  ansday,
  askedityear,
  askeditmonth,
  askeditday,
  ansedityear,
  anseditmonth,
  anseditday,
  title}
\end{filecontents}
\documentclass[english]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[datamodel=stackexchange,backend=biber]{biblatex-chicago}
\usepackage{hyperref}



\begin{filecontents*}{english-stack.lbx}
  \ProvidesFile{english-stack.lbx}[2014/05/07 english with additions for stackexchange]
  \InheritBibliographyExtras{english}
  \NewBibliographyString{asked,answered,edited}
  \DeclareBibliographyStrings{%
    inherit   = {english},
    asked     = {{asked}{asked}},
    answered  = {{answered}{answered}},
    edited    = {{edited}{edited}},
  }
\end{filecontents*}
\DeclareLanguageMapping{english}{english-stack}

\DeclareFieldFormat[stackexchange]{title}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat{askpid}{%
  \mkbibparens{\ifhyperref
    {\href{http://tex.stackexchange.com/users/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}}

\DeclareFieldFormat{anspid}{%
  \mkbibparens{\ifhyperref
    {\href{http://tex.stackexchange.com/users/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}}

\DeclareFieldFormat{askid}{%
  \mkbibparens{\ifhyperref
    {\href{http://tex.stackexchange.com/q/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}}

\DeclareFieldFormat{ansid}{%
  \mkbibparens{\ifhyperref
    {\href{http://tex.stackexchange.com/a/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}}

\newbibmacro*{stackexchangequestion}{%
  \printfield{title}%
  \setunit{\addspace}%
  \printfield{askid}%
}

\newbibmacro*{stackexchangeask}{%
  \bibstring{asked}%
  \setunit{\addspace}%
  \printaskdate%
  \iffieldundef{askedityear}%
    {}
    {\printtext[parens]{%
       \bibstring{edited}%
       \setunit{\addspace}%
       \printaskeditdate}}%
  \setunit{\addspace}%
  \bibstring{byauthor}%
  \setunit{\addspace}%
  \printnames{askp}%
  \setunit{\addspace}%
  \printfield{askpid}%
}

\newbibmacro*{stackexchangeans}{%
  \bibstring{answered}%
  \setunit{\addspace}%
  \printansdate%
  \iffieldundef{ansedityear}
    {}
    {\printtext[parens]{%
       \bibstring{edited}%
       \setunit{\addspace}%
       \printanseditdate}}%
  \setunit{\addspace}%
  \bibstring{byauthor}%
  \setunit{\addspace}%
  \printnames{ansp}%
  \setunit{\addspace}%
  \printfield{anspid}%
}

\newbibmacro*{stackexchangesite}{%
  \printfield{sitetopic}}

\DeclareBibliographyDriver{stackexchange}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{stackexchangequestion}%
  \newunit\newblock
  \usebibmacro{stackexchangeask}%
  \newunit\newblock
  \usebibmacro{stackexchangeans}%
  \newunit\newblock
  \usebibmacro{stackexchangesite}%
  \newunit\newblock
  \usebibmacro{finentry}}



\DeclareBibliographyDriver{cite:stackexchange}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{stackexchangequestion}%
  \newunit\newblock
  \usebibmacro{stackexchangeask}%
  \newunit\newblock
  \usebibmacro{stackexchangeans}%
  \newunit\newblock
  \usebibmacro{stackexchangesite}%
  \newunit\newblock
  \usebibmacro{finentry}}


\begin{filecontents*}{\jobname.bib}
@stackexchange{se:l3help,
  sitetopic = {tex},
  title   = {What can \textit{I} do to help the \LaTeX3 Project},
  askdate = {2012-02-26},
  askid   = {45838},
  askp    = {Brent Longorough},
  askpid  = {344},
  ansp    = {Frank Mittelbach},
  anspid  = {10109},
  ansdate = {2012-03-01},
  ansid   = {46427},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem\autocite{se:l3help}
ipsum\autocite{sigfridsson}
Lorem\autocite{se:l3help}
ipsum\autocite{sigfridsson}
\printbibliography
\end{document}

正如评论中所提到的,\DeclareBibliographyAlias{cite:stackexchange}{stackexchange}如果它们相同的话,这可能比复制整个驱动程序定义更便宜,但我相信芝加哥风格的引用和参考之间存在细微的差别,所以你可能必须有两个独立的声明。

相关内容