How do I do this? Programming TeX is still a bit too tough for me. I want all the @online entries that have github.com as their domain names to have their own category so I can add them separately in the reference list.

I know I can do it semi-automatically with keywords, but I want to try to do it automatically.

I got the following working, provided the url had github.com as value and not the complete link. I am not totally sure if this is a MWE since I had to comment a lot of things out.






\printbibliography[heading=subbibliography, category=github, title={Github repositories}]
\printbibliography[heading=subbibliography, type=online, title={Other online sources}]

Here is the bibliography:

    author = "Melvin Roest",
    title = "XIMPEL React",
    url = "github.com",
    year = "2018",
    urldate = "2018-05-04"
    author = "W3C",
    title = "SMIL Current Status - W3C",
    url = "https://www.w3.org/standards/techs/smil#w3c_all",
    year = "2017",
    urldate = "2017-09-29"

\AtEveryCitekey already gave problems when you cited the same in-text citation multiple times. Moreover, it doesn't match to the substring.

I couldn't solve these problems after 1 to 2 hours of Googling.

There was a simlar(ish question, but it had to do with source maps and I don't think source maps were appropriate here. I did try it with source maps though.

  • 1
    I'd say source mappings are the right tool here. You can use source maps to set a keyword based on the domain name. Then you can use keyword=... instead of category=... and should be good. – moewe Apr 5 '18 at 16:43
  • Thanks for pointing me in the right direction! It worked. – Melvin Roest Apr 5 '18 at 16:54

I'm in a hurry but want to answer my own question, because thanks to moewe's help the following worked. It is not the most robust code, but it works!

      \step[fieldsource=url, match=\regexp{github.com}]
      \step[fieldset=keywords, fieldvalue={$1}]

In the document:

\printbibliography[heading=subbibliography, keyword=github.com, title={Github repositories}]
\printbibliography[heading=subbibliography, type=online, notkeyword=github.com, title={Other online sources}]

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.