3

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}
\usepackage{academicons}    

\addbibresource{biblatex-examples.bib}

\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}
4

How about using the doi formatting directive?

\documentclass[a4paper]{article}

\usepackage{academicons}
\usepackage{graphicx} % required for scalebox

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

\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{doi}{%
  \raisebox{-1.5pt}{\scalebox{1.4}{\aiDoiSquare}}\addcolon\space
  \ifhyperref
    {\href{https://doi.org/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}

\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:

enter image description here

  • @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.