使用 biblatex 删除和更改特定引文的字段

使用 biblatex 删除和更改特定引文的字段

是否可以在不更改 bib 文件的情况下删除或清除 biblatex 中特定引文的特定字段?清除整个参考书目的特定字段可以通过多种方式完成,例如,\AtEveryBibitem{\clearfield{day}}清除参考书目中的日期字段。但问题是如何对参考书目中的特定引文执行此操作。

我宁愿保留相同的 bib 文件,然后针对这篇特定的论文对其进行修改,而不是维护多个 bib 文件,尽管后者显然是可能的。

这是一个最低限度的工作示例。我想只删除 Sitkei 报告的标题并保留 Robertson 报告的标题。我选择了两份报告,这样就不能简单地删除报告的标题,因为我想保留 Robertson 报告的标题。

此外,我还对仅使用 biblatex 更改特定引文的字段感兴趣,例如,在 MWE 中,假设将 Sitkei 报告中的机构更改为缩写“NASA”。如果可能的话,我很想了解如何操作。

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@report{sitkei_contribution_1963,
  location = {{Washington, D.C.}},
  title = {Contribution to the Theory of Jet Atomization},
  url = {https://hdl.handle.net/2027/uiug.30112106740126},
  number = {F-129},
  institution = {{National Aeronautics and Space Administration}},
  type = {{{NASA}} Technical Translation},
  author = {Sitkei, Gy{\"o}rgy},
  translator = {Reiss, S.},
  date = {1963-10},
  issn = {0499-9355},
  pagetotal = {32}
}

@report{robertson_study_1965,
  location = {{Urbana, IL}},
  title = {A Study of Turbulent Flow in Rough Pipes},
  url = {http://www.dtic.mil/docs/citations/AD0625037},
  number = {279},
  institution = {{University of Illinois}},
  type = {T.\&{{A}}.{{M}}. Report},
  author = {Robertson, James M. and Burkhart, Thomas Henry and Martin, John David},
  date = {1965},
  addendum = {OCLC: \href{http://www.worldcat.org/title/study-of-turbulent-flow-in-rough-pipes/oclc/11063056}{11063056}.},
  pagetotal = {142}
}
\end{filecontents}

\usepackage[style=numeric,backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{sitkei_contribution_1963,robertson_study_1965}

\printbibliography

\end{document}

答案1

也许是这样的:

\newcommand\rmtitle[1]{
  \DeclareSourcemap{
    \maps[datatype=bibtex]{
      \map[overwrite]{
        \step[fieldsource=entrykey, match={#1}, final]
        \step[fieldset=title, null]
      }
    }
  }
}

\rmtitle{sitkei}
% compare
% \rmtitle{sitkei|robertson}

完整示例:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@report{sitkei_contribution_1963,
  location = {{Washington, D.C.}},
  title = {Contribution to the Theory of Jet Atomization},
  url = {https://hdl.handle.net/2027/uiug.30112106740126},
  number = {F-129},
  institution = {{National Aeronautics and Space Administration}},
  type = {{{NASA}} Technical Translation},
  author = {Sitkei, Gy{\"o}rgy},
  translator = {Reiss, S.},
  date = {1963-10},
  issn = {0499-9355},
  pagetotal = {32}
}

@report{robertson_study_1965,
  location = {{Urbana, IL}},
  title = {A Study of Turbulent Flow in Rough Pipes},
  url = {http://www.dtic.mil/docs/citations/AD0625037},
  number = {279},
  institution = {{University of Illinois}},
  type = {T.\&{{A}}.{{M}}. Report},
  author = {Robertson, James M. and Burkhart, Thomas Henry and Martin, John David},
  date = {1965},
  addendum = {OCLC: \href{http://www.worldcat.org/title/study-of-turbulent-flow-in-rough-pipes/oclc/11063056}{11063056}.},
  pagetotal = {142}
}
\end{filecontents}

\usepackage[style=numeric,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{hyperref}

\newcommand\rmtitle[1]{
  \DeclareSourcemap{
    \maps[datatype=bibtex]{
      \map[overwrite]{
        \step[fieldsource=entrykey, match={#1}, final]
        \step[fieldset=title, null]
      }
    }
  }
}

\rmtitle{sitkei}
% compare
% \rmtitle{sitkei|robertson}

\begin{document}
\nocite{sitkei_contribution_1963,robertson_study_1965}

\printbibliography

\end{document}

相关内容