From 97f5151099967e6c823d640a90d87bca92c44035 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 29 Oct 2019 03:00:39 +0000 Subject: CTAN sync 201910290300 --- usergrps/dante/dtk/dtk-url.sty | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'usergrps/dante/dtk/dtk-url.sty') diff --git a/usergrps/dante/dtk/dtk-url.sty b/usergrps/dante/dtk/dtk-url.sty index 9ccccaee3b..b4d37a4ffc 100644 --- a/usergrps/dante/dtk/dtk-url.sty +++ b/usergrps/dante/dtk/dtk-url.sty @@ -2,7 +2,7 @@ %% %% LaTeX Class for ``Die TeXnische Komoedie''. %% -%% Copyright (C) 2015- +%% Copyright (C) 2015-2019 %% Rolf Niepraschk, Herbert Voss %% %% It may be distributed and/or modified under the @@ -14,10 +14,22 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dtk-url}[2019/07/29 v1.3 Urls for DTK (HO,hv)] -%% 1.1, 1.2, 1.3 hv +\ProvidesPackage{dtk-url}[2019/10/28 v1.4 Urls (qrcode) for DTK (HO,hv,rn)] \RequirePackage{url}[2006/04/12] +\RequirePackage{xcolor} +\RequirePackage{xkeyval} + +\newlength\dtk@url@qrheight +\newlength\dtk@url@qradjust +\providecommand*\dtk@url@qrlevel{} +\define@key{dtk}{qrheight}[1cm]{\setlength\dtk@url@qrheight{#1}} +\define@key{dtk}{qradjust}[-1.5\normalbaselineskip]{\setlength\dtk@url@qradjust{#1}} +\define@key{dtk}{qrcolor}[black]{\colorlet{dtk@url@qrcolor}{#1}} +\define@key{dtk}{qrlevel}[M]{\renewcommand*\dtk@url@qrlevel{#1}} + +\setkeys{dtk}{qrheight,qrcolor,qradjust,qrlevel}% the default setting + % Konfiguration: \newcommand*{\DTK@UrlSetup}{\urlstyle{tt}} @@ -180,4 +192,23 @@ {\@percentchar#1}% }% } + +\RequirePackage{qrcode} + +\newcommand*\qrurl{% + \providecommand*\qr@blank{0} + \@ifstar{\@tempswafalse}{\@tempswatrue}% + \qr@url +} +\newcommand*\qr@url[2][]{% + \begingroup + \if$#1$\else\setkeys{dtk}{#1}\fi + \qrset{height=\dtk@url@qrheight,level=\dtk@url@qrlevel}% + \if@tempswa\url{#2}\fi + \edef\reserved@a{\noexpand\marginnote{\noexpand\color{dtk@url@qrcolor}\noexpand\qrcode{% + \detokenize\expandafter{#2}}}[\dtk@url@qradjust]}% + \reserved@a + \endgroup +} + \endinput -- cgit v1.2.3