1

Is it possible to remove or clear specific fields from specific citations in biblatex without changing the bib file? Clearing specific fields for the entire bibliography can be done in various ways, e.g. \AtEveryBibitem{\clearfield{day}} will clear the day field in the bibliography. But how to do this for a specific citation in the bibliography is the question.

I would rather keep the same bib file and then modify it for this particular paper than maintain multiple bib files, though obviously the latter is possible.

Here's a minimum working example. I'd like to remove the title for only the Sitkei report and keep the title for the Robertson report. I chose two reports so that one can not simply remove titles for reports, as I want to keep the Robertson report's title.

Additionally, I'm also interested in changing fields for specific citations with biblatex only, e.g., in the MWE let's say changing the institution in the Sitkei report to the abbreviation "NASA". If that's possible I'd be interested in learning how.

\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 Answer 1

2

Perhaps this:

\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}

Complete example:

\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}
3
  • Thanks, this works. I was also able to figure out how to replace a field with new text from your example. Jan 29, 2018 at 5:52
  • At the moment, one can't have multiple sourcemaps. This restriction will be gone in biblatex 3.11/Biber 2.11. But right now \rmtitle{A}\rmtitle{B} will only remove 'B'.
    – moewe
    Jan 29, 2018 at 8:12
  • @moewe -- I look forward to that!
    – jon
    Feb 25, 2018 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.