im wondering if i can create a hyperlink that automaticaly uses the bib file stored tag 'url' somehow? Just to prevent mistakes in linking to a reference and to a websource in the same text like:
mwe:
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=nature, url=true]{biblatex}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@online{UseCase20,
title = {{Use-Case 2.0 ebook}},
journal = {Ivar Jacobson International},
year = {2014},
month = {Jul},
note = {[Online; accessed 25. Dec. 2018]},
url = {https://www.ivarjacobson.com/publications/white-papers/use-case-ebook}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\href{https://www.ivarjacobson.com/publications/white-papers/use-case-ebook}{sometext} \footcite{UseCase20}
\printbibliography
\end{document}
i wold like to something like this work:
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=nature, url=true]{biblatex}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@online{UseCase20,
title = {{Use-Case 2.0 ebook}},
journal = {Ivar Jacobson International},
year = {2014},
month = {Jul},
note = {[Online; accessed 25. Dec. 2018]},
url = {https://www.ivarjacobson.com/publications/white-papers/use-case-ebook}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\href{\citeurl{UseCase20}}{sometext} \footcite{UseCase20}
\printbibliography
\end{document}
but unfortunately this breaks at l.18;
\href{\citeurl{UseCase20}}{sometext}
EDIT:
MWE with all tests:
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=nature, url=true]{biblatex}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@online{UseCase20,
title = {{Use-Case 2.0 ebook}},
journal = {Ivar Jacobson International},
year = {2014},
month = {Jul},
note = {[Online; accessed 25. Dec. 2018]},
url = {https://www.ivarjacobson.com/publications/white-papers/use-case-ebook}
}
\end{filecontents}
\addbibresource{\jobname.bib}
%https://tex.stackexchange.com/a/413372/118709
\DeclareCiteCommand{\citelink}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\iffieldundef{postnote}
{\href{\thefield{url}}{\printfield{title}}}
{\href{\thefield{url}}{\thefield{postnote}}}}
{\multicitedelim}
{}
% https://tex.stackexchange.com/a/412927/118709
\DeclareCiteCommand{\citeqrurl}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\qrcode{\thefield{url}}}
{\multicitedelim}
{\usebibmacro{postnote}}
% https://tex.stackexchange.com/a/413519/118709
\DeclareCiteCommand{\geturl}
{\boolfalse{citetracker}\boolfalse{pagetracker}}
{\iffieldundef{postnote}
{\xdef\biburl{\thefield{url}}}
{%
\edef\geturlTmpCmd{\csfield{postnote}}%
\expandafter\xdef\geturlTmpCmd{\thefield{url}}%
}%
}
{}
{}
\begin{document}
~\\
\citelink{sometext}{UseCase20}\footcite{UseCase20}\\
~\\
\citeqrurl{sometext}{UseCase20}\footcite{UseCase20}\\
~\\
\geturl{UseCase20}
%The \href{\biburl}{UseCase}\footcite{UseCase20}\\.
\printbibliography
\end{document}
\citeurlcan't be used as argument to\href, you need to define your own macro, cf. https://tex.stackexchange.com/q/413365/35864 and https://tex.stackexchange.com/q/412924/35864. – moewe Dec 25 '18 at 09:01\citelinkwould have been\citelink[sometext]{UseCase20}.\citeqrurlas implemented in the linked answer was intended for a different use case and would have to be tweaked for yours. The last solution worked for me as well (even though I find it much less elegant for this use case). – moewe Dec 25 '18 at 09:39