# Replace the 'doi' keyword for all entries in a bibliography with \aiDoiSquare icon from academicons package

I am currently making my CV and using the biblatex/biber combo for bibliography management.

For visual pizazz, I wish to replace the keyword doi for each entry in the generated bibliography with the icon \aiDoiSquare from the academicons package. How can this be achieved?

Here is a MWE (using the article class for now)

\documentclass[a4paper]{article}
\usepackage[backend=biber, style=numeric-comp, sorting=none,
maxbibnames=50, eprint=false]{biblatex}
\usepackage{csquotes}

\begin{document}

Let us cite \cite{sigfridsson} for this doi question.

% Somehow replace the keyword 'doi' in all entries of the generated bibliography
% with the '\aiDoiSquare' icon from the 'academicons' package.
\printbibliography

\end{document}

• – moewe Feb 7 at 19:53

How about using the doi formatting directive?

\documentclass[a4paper]{article}

\usepackage{graphicx} % required for scalebox

\usepackage[backend=biber, style=numeric-comp, sorting=none,
maxbibnames=50, eprint=false]{biblatex}
\usepackage{csquotes}

\DeclareFieldFormat{doi}{%
\ifhyperref

\begin{document}

\nocite{kastenholz,sigfridsson}

% Somehow replace the keyword 'doi' in all entries of the generated bibliography
% with the '\aiDoiSquare' icon from the 'academicons' package.
\printbibliography

\end{document}
% Local Variables:
% TeX-engine: xetex
% End:


• @moewe Yes, already corrected. I missed that, for the lack of other XeLaTeX/LuaLaTeX features in the document, and as I didn't know the academicons package. – gusbrs Feb 7 at 19:59
• @moewe I think the doc does not even compile with pdflatex – Krishna Feb 7 at 19:59
• @gusbrs Is there any way to increase the size of the icon? It is too small for my taste. I tried \big, but it errored out. – Krishna Feb 7 at 19:59
• @Krishna Compile it did, the previous screenshot was really taken from it (no wonder it didn't look good... :-) – gusbrs Feb 7 at 20:00
• @Krishna It does if you press enter a lot. – moewe Feb 7 at 20:00