3

This question is a follow-up to how to \cite without an entry in the bibliography?.

I have an entry in my .bib file that I'd like to cite in my current document, but I don't want it to appear in my bibliography. I can tell biblatex to skip an entry in the bibliography by setting OPTIONS = "skipbib = true", but this will make biblatex skip this entry every single time I cite this entry in every document I produce. I just want to skip it this one time in my current document.

So the question is, what can I put in my preamble of my current document so that I add OPTIONS = "skipbib = true" to the lennon1970 entry?

\documentclass{article}
\usepackage[style = authoryear-comp]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1970,
    AUTHOR = "John Lennon",
    TITLE = "My life with the Beatles",
    YEAR = "1970",
    OPTIONS = "skipbib = true"}
@BOOK{lennon1971,
    AUTHOR = "John Lennon",
    TITLE = "Moving on",
    YEAR = "1971"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citeauthor{lennon1970} published a book called \citetitle{lennon1970} in \citeyear{lennon1970}, cf. \cite{lennon1971} for more details.
\printbibliography
\end{document}

enter image description here

Sverre
  • 20,729

1 Answers1

3

You can achieve the same result by using a \DeclareSourcemap for each specific document. Just include

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{
      \step[fieldsource=entrykey, match=\regexp{lennon1970}, fieldset=options,  fieldvalue={skipbib=true}]
    }
  }
}

to dynamically load the options="skipbib=true" for the desired bibtex entries.

Guido
  • 30,740
  • Yikes. I was afraid the solution would involve \DeclareSourcemap. The problem is that the \DeclareSourcemap command can only be used once, and I'm already using it in the .sty file I load as the style sheet for this type of documents ... :-/ – Sverre Nov 18 '14 at 21:20
  • 2
    In the style you can use \DeclareStyleSourcemap, and you should able to use both (untested:-) – Guido Nov 18 '14 at 21:24
  • Tested - and it works! :) – Sverre Nov 18 '14 at 21:32
  • 2
    Other alternatives are: (1) add keywords to the bibtex entries and then notkeyword in \printbibliography (2) defines bibchecks and the check option. – Guido Nov 18 '14 at 21:38