10

How can I create a QR-code by using and citing an url from a bibliography-entry with \citeurl?

\documentclass{scrartcl}
\usepackage{filecontents}
\usepackage{qrcode}

\begin{filecontents}{\jobname.bib}
@article{test,
author = {A. Author},
title = {My Title},
url = {http://tex.stackexchange.de},
}

\end{filecontents}
\usepackage[           
  backend=biber,
  style=archaeologie,
]{biblatex} 
\addbibresource{\jobname.bib}

\begin{document}
  \qrcode{\citeurl{test}} %<---- it does’t work
  \citeurl{test} %<--- it works
\printbibliography
\end{document}
lukascbossert
  • 3,015
  • 1
  • 16
  • 37

1 Answers1

11

Looks like an expansion issue. \citeurl does not simply dump the url, it does a lot of formatting as well. From within biblatex you can use \thefield{url} to access the raw URL, so that you can define a new command

\DeclareCiteCommand{\citeqrurl}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\qrcode{\thefield{url}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
moewe
  • 175,683