Showing keys references with \nocite{*}

biblatexbiblatex-chem

I have a large .bib file containing ~2000 references. It is my online references database that I use constantly in my work.

I want to display in pdf output the keys of references so I don't have to open the .bib file to see the key I need to cite. Much in the same manner as \usepackage{showlabels} does.

Is it possible with biblatex or biblatex-chicago?

Best Answer

biblatex detects showkeys, so the following just works

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}

\usepackage{showkeys}

\usepackage{csquotes}
\usepackage[authordate, backend=biber]{biblatex-chicago}

% just to make the example work
% biblatex-chicago does not support @set
\newbool{bbx@inset}
\DeclareBibliographyDriver{set}{%
  \booltrue{bbx@inset}%
  \entryset{}{}%
  \newunit\newblock
  \usebibmacro{setpageref}%
  \finentry}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}
\nocite{*}

\printbibliography
\end{document}

Bibliography with keys in margin.


If you prefer showlabels you can do manually what biblatex automatically for showkeys

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}

\usepackage{showlabels}

\usepackage{csquotes}
\usepackage[authordate, backend=biber]{biblatex-chicago}

\makeatletter
\AtEveryBibitem{\SL@setlabel{\thefield{entrykey}}}
\AtEveryLositem{\SL@setlabel{\thefield{entrykey}}}
\makeatother

% just to make the example work
% biblatex-chicago does not support @set
\newbool{bbx@inset}
\DeclareBibliographyDriver{set}{%
  \booltrue{bbx@inset}%
  \entryset{}{}%
  \newunit\newblock
  \usebibmacro{setpageref}%
  \finentry}

\addbibresource{biblatex-examples.bib}

\begin{document}
\section{Foo}\label{sec:foo}
Lorem \autocite{sigfridsson}
\nocite{*}
\ref{sec:foo}

\printbibliography
\end{document}

Bibliography with keys shown in margin