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.
\documentclass[12pt,a4paper,twoside,openright]{report}
\usepackage{biblatex}
\addbibresource{references.bib}
\DeclareBibliographyCategory{github}
\AtEveryCitekey{%
\ifentrytype{online}{
\iffieldequalstr{url}{github.com}{
\addtocategory{github}{\thefield{entrykey}}%
}
}
}
\begin{document}
\cite{ximpel_react_github}
\cite{ximpel_react_github}
\cite{ximpel_react_github}
\cite{smilStatus}
\cite{smilStatus}
\cite{smilStatus}
\printbibliography[heading=subbibliography, category=github, title={Github repositories}]
\printbibliography[heading=subbibliography, type=online, title={Other online sources}]
\end{document}
Here is the bibliography:
@online{ximpel_react_github,
author = "Melvin Roest",
title = "XIMPEL React",
url = "github.com",
year = "2018",
urldate = "2018-05-04"
}
@online{smilStatus,
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.
keyword=...instead ofcategory=...and should be good. – moewe Apr 05 '18 at 16:43