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}
0

1 Answer 1

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}}
0

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.