1

I am using the solution as posted in this answer:
https://tex.stackexchange.com/a/21891/8569
The important snippet is:

\addtocategory{important}{walley00}\nocite{walley00}
\addtocategory{important}{walley91}\nocite{walley91}
\printbibliography[title={Important},category=important]

Instead, I would prefer a new command like this:

\addtocategoryNoCi{important}{walley00,walley91}
\printbibliography[title={Important},category=important]

The effect should be the same. So, I guess I just need to define a new/custom command that accepts a comma separated list of bibtex keys as input, but I need some help with that...

matth
  • 12,381
  • 1
    Would you care to expand on what you are actually trying to achieve, instead of this particular technical problem? I do believe there may well be other ways to do it, if your scenario is similar to the question you linked to. – gusbrs Apr 19 '18 at 14:06
  • Oh, you are sorted already, I see! – gusbrs Apr 19 '18 at 14:07

1 Answers1

5

Since both \addtocategory and \nocite can accept comma-separated values, you can use

\newcommand*{\addtocategoryNoCi}[1]{\addtocategory{important}{#1}\nocite{#1}}

If you want to give the category as argument, you'll want

\newcommand*{\addtocategoryNoCi}[2]{\addtocategory{#1}{#2}\nocite{#2}}

If one of the two commands could not accept a list of comma-separated values, you could have went with

\makeatletter
\newcommand*{\addtocategoryNoCi@i}[2]{\addtocategory{#1}{#2}\nocite{#2}}
\newcommand*{\addtocategoryNoCi}[1]{%
  \forcsvlist{\addtocategoryNoCi@i{#1}}}
\makeatother
moewe
  • 175,683