summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hvqrurl
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-29 03:01:04 +0000
committerNorbert Preining <norbert@preining.info>2024-01-29 03:01:04 +0000
commit6c43653052d016d5913aabb728c484f0e62b4754 (patch)
tree86463762682ace059db9efb216a1a4f0ad773688 /macros/latex/contrib/hvqrurl
parent7084e3008c8fc947579f46c6b8a08dfd180e72ef (diff)
CTAN sync 202401290301
Diffstat (limited to 'macros/latex/contrib/hvqrurl')
-rw-r--r--macros/latex/contrib/hvqrurl/Changes1
-rw-r--r--macros/latex/contrib/hvqrurl/doc/hvqrurl.pdfbin107212 -> 113426 bytes
-rw-r--r--macros/latex/contrib/hvqrurl/doc/hvqrurl.tex17
-rw-r--r--macros/latex/contrib/hvqrurl/latex/hvqrurl.sty14
4 files changed, 27 insertions, 5 deletions
diff --git a/macros/latex/contrib/hvqrurl/Changes b/macros/latex/contrib/hvqrurl/Changes
index 7dcfb5b15a..c4b25d48e5 100644
--- a/macros/latex/contrib/hvqrurl/Changes
+++ b/macros/latex/contrib/hvqrurl/Changes
@@ -1,4 +1,5 @@
hvqrurl.sty:
+0.05 2024-01-28 - added optional argument for alternative link text
0.04 2024-01-18 - fix for wrong text
0.03 2023-10-29 - fix for # in an url
0.02 2021-05-18 - added optional argument qrreverse to the set
diff --git a/macros/latex/contrib/hvqrurl/doc/hvqrurl.pdf b/macros/latex/contrib/hvqrurl/doc/hvqrurl.pdf
index c2a087895c..513df9f516 100644
--- a/macros/latex/contrib/hvqrurl/doc/hvqrurl.pdf
+++ b/macros/latex/contrib/hvqrurl/doc/hvqrurl.pdf
Binary files differ
diff --git a/macros/latex/contrib/hvqrurl/doc/hvqrurl.tex b/macros/latex/contrib/hvqrurl/doc/hvqrurl.tex
index a67122f6bd..e60a7a2511 100644
--- a/macros/latex/contrib/hvqrurl/doc/hvqrurl.tex
+++ b/macros/latex/contrib/hvqrurl/doc/hvqrurl.tex
@@ -1,4 +1,4 @@
-%% $Id: hvqrurl.tex 837 2024-01-18 07:43:31Z herbert $
+%% $Id: hvqrurl.tex 848 2024-01-28 11:57:35Z herbert $
\listfiles
\errorcontextlines=100
\documentclass[twoside=on,usegeometry]{scrartcl}
@@ -159,6 +159,21 @@ With the optional argument \Lkeyword{qrreverse} it can be placed in the left or
This one (\hvqrurl[qrreverse]{https://latex.texnik.de}) is in the other margin.
\end{lstlisting}
+\subsection{Alternative link text}
+By default the QR code is set with the given text. If the link is too long, one
+can use a short link with the optional argument \Lkeyword{linktext} for the text and
+the long link for the qrcode, like
+this one: \hvqrurl[linktext=https://www.uni-bonn.de]%
+{https://www.uni-bonn.de/de/studium/studienangebot/studiengaenge-a-z/kunstgeschichte-bazf?set_language=de}.
+
+\begin{lstlisting}
+By default the QR code is set with the given text. If the link is too long, one
+can use a short link with the optional argument \Lkeyword{linktext} for the text and
+the long link for the qrcode, like
+this one: \hvqrurl[linktext=https://www.uni-bonn.de]%
+{https://www.uni-bonn.de/de/studium/studienangebot/studiengaenge-a-z/kunstgeschichte-bazf?set_language=de}.
+\end{lstlisting}
+
\printindex
diff --git a/macros/latex/contrib/hvqrurl/latex/hvqrurl.sty b/macros/latex/contrib/hvqrurl/latex/hvqrurl.sty
index e016534270..604a7ce87f 100644
--- a/macros/latex/contrib/hvqrurl/latex/hvqrurl.sty
+++ b/macros/latex/contrib/hvqrurl/latex/hvqrurl.sty
@@ -1,4 +1,4 @@
-%% $Id: hvqrurl.sty 837 2024-01-18 07:43:31Z herbert $
+%% $Id: hvqrurl.sty 848 2024-01-28 11:57:35Z herbert $
%%
%% This file is distributed under the terms of the LaTeX Project Public
%% License from CTAN archives in directory macros/latex/base/lppl.txt.
@@ -7,7 +7,7 @@
% Copyright 2019,21,23,24 Herbert Voss hvoss@tug.org
%%
\ProvidesPackage{hvqrurl}[%
- 2024/01/18 v.0.04 (Herbert Voss) Supports qr images into the margin (hv)]
+ 2024/01/28 v.0.05 (Herbert Voss) Supports qr images into the margin (hv)]
%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{url}
@@ -24,9 +24,11 @@
\define@key{hvqr}{qrcolor}[black]{\colorlet{qr@url@qrcolor}{#1}}
\define@key{hvqr}{qrlevel}[M]{\def\qr@url@qrlevel{#1}}
\define@key{hvqr}{qrlink}[link]{\def\qr@url@qrlink{#1}}
+\define@key{hvqr}{linktext}[]{\def\qr@url@linktext{#1}}
\define@boolkey{hvqr}[hv@]{qrreverse}[true]{}
-\setkeys{hvqr}{qrheight,qrcolor=black,qradjust,qrlevel,qrlink=link,qrreverse=false}% the default setting
+\setkeys{hvqr}{qrheight,qrcolor=black,qradjust,qrlevel,qrlink=link,
+ qrreverse=false,linktext={}}% the default setting
\newcommand*\hvqrset[1]{\setkeys{hvqr}{#1}}
@@ -41,7 +43,11 @@
\expandafter\qrset\expandafter{\qr@url@qrlink,height=\qr@url@qrheight,level=\qr@url@qrlevel}%
\ifhv@qrreverse\reversemarginpar\fi
\if@tempswa
- \edef\hv@foo{\detokenize\expandafter{#2}}%
+ \ifx\relax\qr@url@linktext\relax % alternative link text??
+ \edef\hv@foo{\detokenize\expandafter{#2}}%
+ \else
+ \edef\hv@foo{\detokenize\expandafter{\qr@url@linktext}}%
+ \fi
\expandafter\url\expandafter{\hv@foo}%
\fi
\edef\reserved@a{\noexpand\marginnote{\noexpand\color{qr@url@qrcolor}\noexpand\qrcode{%