3

BibLaTeX allows the creation of entry sets which consists of a series of references, e.g.

@set{set1,
    entryset = {member1, member2}
}

However, when citing these using \cite{set1}, all the references appear as a single item in the final bibliography. Is there an option to show each member of the set as individual items? Essentially, I want to achieve the same effect as \cite{member1,member2}, but by citing the set name instead of the individual members.

5
  • 1
    Welcome to TeX.SX!! It is better to post a full minimal working example that starts with a \documentclass command, has a minimal preamble and then \begin{document}...\end{document}. Unless the problem is a compilation error, the code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much ore likely that they will! It would certainly help if you gave more detail about what your problem is and what you want to achieve and if you are using biblatex, bibtex, ...
    – user30471
    Commented Feb 23, 2016 at 11:37
  • From the manual's description: An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography. (113) With BibTeX as backend, citing any member of the set will include all of them. But that is considered a limitation rather than a feature. It sounds to me as if this is an XY problem. A minimal example would help people suggest alternative strategies. (Maybe you want related or something like that? Hard to say.)
    – cfr
    Commented Feb 23, 2016 at 12:10
  • 1
    You can do \newcommand{\myreflist}{key1,key2,...} and used \cite{\myreflist}. I think there are biblatex commands that would allow you to construct the key list from the key for the entry set too. Commented Feb 23, 2016 at 13:09
  • @AndrewSwann Your approach sounds like a good answer to me, would you mind jotting it down in the answer section? The problem with trying to recover the item list from a set is that once the set is defined citations of the members trigger the set citation and thus the compact output in the bibliography.
    – moewe
    Commented Feb 23, 2016 at 14:41
  • @moewe OK - Done. Commented Feb 23, 2016 at 15:38

2 Answers 2

1

From the comments it turns out that entry sets are not the relevant concept, and you are just looking for a shorthand to list several references. Simple LaTeX macros are sufficient for this. Just define

\newcommand{\myreflist}{key1,key2,...}

and then you can use \cite{\myreflist}, etc., as you wish to cite these entries.

Here is an example demonstrating that features such citation sorting still work.

Sample output

\documentclass{article}

\usepackage[sortcites=true]{biblatex}
\addbibresource{biblatex-examples.bib}

\newcommand{\myreflist}{westfahl:space,glashow,baez/article}

\begin{document}

Here some citations \cite{\myreflist}.

\printbibliography

\end{document}
2
  • Thank you very much. I think I did not state my question clear enough. I like the concept of entry sets and always use entry sets to group references. With entry sets the group information is saved in the bib file. So I don't need to remember and repeat inputing these information again and again in each individual Tex file. Commented Feb 23, 2016 at 17:02
  • \newcommand does give me the correct format, but not the way I want to achieve. If I use \newcommand, that means I need input the group information again (by listing key1, key2, ...). These information is already in the bib file (by defined entry sets). If all the entries in an entry set must be listed as a single item, is there an alternative way to manage reference grouping in reference database file? Commented Feb 23, 2016 at 17:02
0

You can use the usebib package by @egreg for this purpose. The package documentation has pretty much all the explanation needed, namely the following steps, which should be added to the preamble in sequence:

  1. include \usepackage{usebib} (after loading hyperref);
  2. enable the entryset key using \newbibfield{entryset};
  3. point it to the bib file using \bibinput{filename} without the .bib extension;
  4. then you can access the value of the entryset key using \usebibentry{cite_key}{entryset}.

Altogether, you get what you want via \cite{\usebibentry{set1}{entryset}. Of course, if desired, you can also define a simple newcommand which shortens this, such as

\newcommand{\citeset}[1]{\cite{\usebibentry{#1}{entryset}}}

then you can just use \citeset{set1}. Below is a minimal working example.


test.bib

@misc{foo1,
    author = {Foo, F. and Bar, B.},
    year = {2021},
    title = {Foo 1},
}
@misc{foo2,
    author = {Foo, F. and Bar, B.},
    year = {2021},
    title = {Foo 2},
}
@set{foo,
    entryset = {foo1, foo2}
}

test.tex

\documentclass{article}

\usepackage{biblatex}
\addbibresource{test.bib}

\usepackage{usebib}
\newbibfield{entryset}
\bibinput{test}

\begin{document}

This is the entryset key: \usebibentry{foo}{entryset}

Here we cite foo as individual references.\autocite{\usebibentry{foo}{entryset}}

\printbibliography
\end{document}

Result

Citing a set as separate references

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .