5

In my PhD thesis, if the chapter is already published I need to state that "This chapter has been published as:......".

It's quite convenient to do it with \fullcite{} command. But then the problem is this \fullcite{} also end up in the per-chapter bibliography, which doesn't make sense for the reader.

Is there a way to specify that one citation should not be in the bibliography? (Like the opposite of \nocite)

MWE (my real .bib file is my whole library):

    \documentclass{book}
    \usepackage[style=authoryear-comp]{biblatex}
    \addbibresource{\jobname.bib}
    \usepackage{filecontents}

    \begin{filecontents}{\jobname.bib}
    @book{key1,
      author = {Myself, Me.},
      year = {2001},
      title = {Title1},
      publisher = {Publisher1},
    }
    @book{key2,
        author = {Author, B.},
        year = {2002},
        title = {Title2},
        publisher = {Publisher2},
    }
    \end{filecontents}

    \begin{document}
    \chapter{A}
    This chapter has been published as :\\ 
    %(This \fullcite should not be in the reference list)
    \fullcite{key1}

    \section{section1}
    In text cite: \cite{key2}
    \printbibliography[segment=\therefsegment,heading=subbibliography]

    \end{document}
  • The quickest way would probably be to add a keyword to this items entry in your .bib-file and use the optionnotkeyword=<insert keyword> for \printbibliography. – kmbkrkn Nov 30 '17 at 15:34
  • 2
    Have a look at Exclude \fullcite{…} citation from bibliography – moewe Nov 30 '17 at 15:48
  • @moewe, as posed the question is interesting. Paul Stanley's answer offer methods to remove one (or a set) of specified entries from the bibliography. But the question here is to omit one citation from it. Suppose that one uses fullcite once, and for this citation it should not go to the bibliography, as requested by the OP. But later, the same entry is cited as textcite or parencite or whatever, and for this citation it should go to the bibliography. – gusbrs Nov 30 '17 at 16:23
  • @gusbrs my answer uses a new refsection and handles your issues (I think). – StrongBad Nov 30 '17 at 17:58
2

This is another approach, which creates a command \DontIncludeNextCite with a self explanatory name and which will not affect other potential citations of the same bibentry. That is, this excludes the particular citation from the bibliography, but not the bibentry if it is cited elsewhere. It also allows you to work with refsegments (or refsections if adapted). Furthermore, it can be used with any cite command, not just \fullcite.

\documentclass{book}

\usepackage{filecontents}
\usepackage[style=authoryear-comp,refsegment=chapter]{biblatex}
\usepackage{etoolbox}

\newtoggle{includeentry}
\toggletrue{includeentry}

\DeclareBibliographyCategory{entriesinbib1,entriesinbib2,entriesinbib3} % you need as many as the number of refsegments in your document

\AtEveryCitekey{%
    \iftoggle{includeentry}{%
        \addtocategory{entriesinbib\therefsegment}{\thefield{entrykey}}}%
        {}%
    }

\newcommand{\DontIncludeNextCite}{\AtNextCite{\togglefalse{includeentry}}}

\begin{filecontents}{\jobname.bib}
@book{key1,
  author = {Myself, Me.},
  year = {2001},
  title = {Title1},
  publisher = {Publisher1},
}
@book{key2,
    author = {Author, B.},
    year = {2002},
    title = {Title2},
    publisher = {Publisher2},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\chapter{A}

This chapter has been published as: \DontIncludeNextCite\fullcite{key1}. % This cite will not include key1 in the bibliography 

In text cite \parencite{key2}.

Another cite \parencite{key1}. % But this one will

\printbibliography[category=entriesinbib1,heading=subbibliography]

\chapter{B}

Now, in a second refsegment.

This chapter has been published as :\\ 
\DontIncludeNextCite\fullcite{key1}. % This cite will not include key1 in the bibliography 

In text cite \parencite{key2}.

\printbibliography[category=entriesinbib2,heading=subbibliography]

\chapter{C}

Now, in a third refsegment.

This chapter has been published as :\\ 
\DontIncludeNextCite\fullcite{key1}. % This cite will not include key1 in the bibliography 

In text cite \parencite{key2}.

Another cite \parencite{key1}. % But this one will

\printbibliography[category=entriesinbib3,heading=subbibliography]

\end{document}
  • @StrongBad, another approach. – gusbrs Dec 1 '17 at 0:02
  • Handy approach, turns out\DeclareBibliographyCategory does not accept comma-separated list, and need to declare category one by one, then it works. Inspired by you, I came up with a similar approach: I declared one category for each of my own paper, say \DeclareBibliographyCategory{mypaper1} \addtocategory{mypaper1}{key1}and for that chapter I used the notcategory=mypaper1 filter, it works better than notkeyword filter. And in following chapters I can cite mypaper1 without problem. Seems the most straight-forward approach for my specific case. – victorino Dec 1 '17 at 10:01
  • Also I doesn't have to mess with refsegment anymore which always give me pain:) – victorino Dec 1 '17 at 10:10
3

As you are already using multiple refsection environments to get a per chapter bibliography and the fullcite reference you want to avoid is located in a predictable location I would create a new macro something like:

\newcommand{\prevPub}[1]{%
    \begin{refsection}%
    This chapter has been published as :\\%
    \fullcite{#1}%
    \end{refsection}%
}

such that your MWE looks like

   \documentclass{book}
    \usepackage[style=authoryear-comp]{biblatex}
    \addbibresource{\jobname.bib}
    \usepackage{filecontents}

    \begin{filecontents}{\jobname.bib}
    @book{key1,
      author = {Myself, Me.},
      year = {2001},
      title = {Title1},
      publisher = {Publisher1},
    }
    @book{key2,
        author = {Author, B.},
        year = {2002},
        title = {Title2},
        publisher = {Publisher2},
    }
    \end{filecontents}

\newcommand{\prevPub}[1]{%
    \begin{refsection}%
    This chapter has been published as :\\%
    \fullcite{#1}%
    \end{refsection}%
}
    \begin{document}
    \chapter{A}
    \prevPub{key1}

    \section{section1}
    In text cite: \cite{key2}
    \printbibliography[segment=\therefsegment,heading=subbibliography]

    \end{document}
  • 1
    StrongBad, that's an interesting idea (+1). But if refsections are used in the document, wouldn't this result in nested refsections? (not allowed according to the documentation). Besides, it seems the OP is using refsegment to divide the bibliography per chapter. This definition would result in a refsection within a refsegment, woudn't it? – gusbrs Nov 30 '17 at 18:11
  • 1
    @gusbrs my answer works, it is not like I have RTFM ;) I didn't know you cannot nest refsegment. If that is true and this fails in the real case, you just have to open and close the segment at the right time and choose the correct segments to print the bibliography for. I still like the idea of using refsegment as opposed to changing the bib file. – StrongBad Nov 30 '17 at 18:16
  • Thank you @StrongBad . This is actually better since my .bib file is auto-updated by Zotero. To use notkeyword I need to break the auto-update to have custom keywords. But what @gusbrs said was also true, refsegment=chapter option gives Nested refsection error (apology for forgetting to put it in the MWE). So I removed refsegment=chapter, used your macro, then enclose the whole chapter in a \begin{refsegment} environment. – victorino Nov 30 '17 at 22:14
  • @LuoQi you might just be able to change my refsection to a refsegment or just start the chapter refsection later. – StrongBad Nov 30 '17 at 22:33
2

Biblatex gives you the possibility to print a bibliography either without all items with a certain keyword in their entry in the .bib-file or only with the items with this keyword. The syntax for this is \printbibliography[notkeyword=<keyword>] or \printbibliography[keyword=<keyword>]. You should adapt your file as follows:

\documentclass{book}
\usepackage[style=authoryear-comp]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{key1,
  author = {Myself, Me.},
  year = {2001},
  title = {Title1},
  publisher = {Publisher1},
  keyword = {donotinclude}
}
@book{key2,
    author = {Author, B.},
    year = {2002},
    title = {Title2},
    publisher = {Publisher2},
}
\end{filecontents}

\begin{document}
\chapter{A}
This chapter has been published as :\\ 
%(This \fullcite should not be in the reference list)
\fullcite{key1}

\section{section1}
In text cite: \cite{key2}
\printbibliography[segment=\therefsegment,heading=subbibliography,notkeyword=donotinclude]

\end{document}
  • Thank you, this works for me by adding a keyword to my bib file by hand. Strangely it doesn't work in the MWE, perhaps something wrong with filecontents? – victorino Nov 30 '17 at 17:10
  • @LuoQi did you delete \jobname.bib between runs so the new bib file gets written? – StrongBad Nov 30 '17 at 18:26

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.