Can you please help me to process biblatex entries. I want to...
- Print separate bibliographies for online and offline entries
- Both
@onlineentries and@miscentries with a url-field should go into the 'online' category. All other entries should go into the 'offline' category. - I want don't want to display the
urlandurldateof offline entries.
I have tried combining answers from the following webpages:
- url field for certain reference types with biblatex
- separating two types of articles from bibtex using
\printbibliography
When should I use \AtEveryCitekey and when should I use \AtEveryBibitem? Can I issue multiple \AtEvery*** commands, or will one command replace the other?
Here is my minimal (not fully) working example. I can always either get the categorization or the clearing of fields to work, but not both:
\documentclass{article}
\usepackage{biblatex}
\DeclareBibliographyCategory{online}
\DeclareBibliographyCategory{offline}
\AtEveryCitekey{%
\ifboolexpr{%
test {\ifentrytype{online}}
or
( test {\ifentrytype{misc}}
and not test {\iffieldundef{url}}
)
}
{ \addtocategory{online}{\thefield{entrykey}}\clearfield{url}\clearfield{urldate} }
{ \addtocategory{offline}{\thefield{entrykey}} }
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{c1,
author = "Authors1",
title = "{Title of article}",
collaboration = "Collaboration",
year = "2012",
url = "http://www.sciencedirect.com/",
urldate = "2012-07-12",
}
@online{c2,
author = "Authors2",
title = "{Title of website}",
year = "2011",
url = "http://www.gmx.at/",
urldate = "2012-06-10",
}
@misc{c3,
author = "Authors3",
title = "{Title of video}",
year = "2012",
howpublished = "Youtube video",
url = "http://youtube.com/watch/123",
urldate = "2012-06-06",
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{c1,c2,c3}
\printbibliography[category=offline,title={Offline Articles}]
\printbibliography[category=online,title={Online Articles}]
\end{document}
