Skip to content

Instantly share code, notes, and snippets.

@moewew
Last active March 17, 2018 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moewew/48eed49cbd1596d73ef8ebc720fc29c3 to your computer and use it in GitHub Desktop.
Save moewew/48eed49cbd1596d73ef8ebc720fc29c3 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{biblatex}
\makeatletter
\newrobustcmd*{\ProvideBibliographyCategory}[1]{%
\ifcsundef{blx@catg@#1}
{\global\cslet{blx@catg@#1}\@empty
\listgadd\blx@categories{#1}}
{}}
\AtEveryCitekey{%
\ifcsstring{blx@delimcontext}{fullcite}
{}
{\ProvideBibliographyCategory{inbib\therefsection}%
\addtocategory{inbib\therefsection}{\thefield{entrykey}}}}
\defbibcheck{inbib}{%
\edef\mytmp{\ifentrycategory{\thefield{entrykey}}{inbib\therefsection}}%
\mytmp
{}
{\skipentry}}
\makeatother
\addbibresource{biblatex-examples.bib}
\begin{document}
Chemists deserve numbers: \cite{cotton}. But historians get a full citation in the text and are excluded from the bibliography: \fullcite{reese}.
\printbibliography[check=inbib, title=\therefsection]
\newrefsection
Chemists deserve numbers: \cite{cotton}. But historians get a full citation in the text and are excluded from the bibliography: \fullcite{reese}.
But may reach the bibliography if cited with a standard cite command: \cite{reese}.
\printbibliography[check=inbib, title=\therefsection]
\newrefsection
Chemists deserve numbers: \cite{cotton}. But historians get a full citation in the text and are excluded from the bibliography: \fullcite{reese}.
\printbibliography[check=inbib, title=\therefsection]
\printbibliography[check=inbib, section=1, title={1 (manual)}]
\printbibliography[check=inbib, section=2, title={2 (manual)}]
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment