| 1 |
%% fancyqr-doc.tex |
| 2 |
%% Copyright 2026 Florian Sihler |
| 3 |
% |
| 4 |
% This work may be distributed and/or modified under the |
| 5 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 6 |
% of this license or (at your option) any later version. |
| 7 |
% The latest version of this license is in |
| 8 |
% https://www.latex-project.org/lppl.txt |
| 9 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 10 |
% version 2008 or later. |
| 11 |
% |
| 12 |
% This work has the LPPL maintenance status `maintained'. |
| 13 |
% |
| 14 |
% The Current Maintainer of this work is Florian Sihler |
| 15 |
% |
| 16 |
% This work consists of the fancyqr.sty, alongside the `fancyqr-style-*.code` files and the documentation `fancyqr-doc.tex`. |
| 17 |
\documentclass[parskip=half,english,numbers=noenddot,footnotes=nomultiple,oneside]{scrartcl} |
| 18 |
|
| 19 |
\usepackage[T1]{fontenc} |
| 20 |
\usepackage[utf8]{inputenc} |
| 21 |
\usepackage{babel} |
| 22 |
|
| 23 |
\usepackage{microtype} |
| 24 |
\usepackage[hidelinks]{hyperref} |
| 25 |
|
| 26 |
\usepackage{lmodern} |
| 27 |
\usepackage{array,booktabs} |
| 28 |
\usepackage{footnote} |
| 29 |
\usepackage{fontawesome} |
| 30 |
|
| 31 |
\usepackage{fancyqr} |
| 32 |
\usepackage{xcolor} |
| 33 |
\usepackage[tex]{listings} |
| 34 |
\usepackage{amssymb} |
| 35 |
|
| 36 |
\lstdefinelanguage{ltx}{ |
| 37 |
language={[LaTeX]TeX}, |
| 38 |
moretexcs=[1]{fancyqr,qrcode,FancyQrDoNotPrintSquare,FancyQrRoundCut,FancyQrHardCut,FancyQrLoad,FancyQrLoadDefault,fancyqrset,faGithub,FancyQrDoNotPrintRadius} |
| 39 |
} |
| 40 |
\lstset{basicstyle=\ttfamily,breaklines,texcsstyle=*\color{purple}\bfseries,language=ltx} |
| 41 |
\lstMakeShortInline| |
| 42 |
\def\ltx#1{\lstinline/#1/} |
| 43 |
\interfootnotelinepenalty=10000 |
| 44 |
|
| 45 |
|
| 46 |
\title{The \texttt{fancyqr} package} |
| 47 |
\author{% |
| 48 |
\texorpdfstring{Florian Sihler\medskip\\* |
| 49 |
\fancyqr{https://github.com/EagleoutIce/fancyqr} |
| 50 |
}{Florian Sihler}} |
| 51 |
\date{Version v2.3 \textendash{} 2026/02/27} |
| 52 |
|
| 53 |
\begin{document} |
| 54 |
\maketitle |
| 55 |
|
| 56 |
|
| 57 |
\texttt{fancyqr} is a simple package to create fancy qr-codes with the help of the \textit{\href{https://www.ctan.org/pkg/qrcode}{qrcode}}-package. |
| 58 |
You can use the |\fancyqr|-macro just like the normal |\qrcode|.\footnote{\ltx{\\fancyqr[<qr-options>]\{<url>\}}} |
| 59 |
|
| 60 |
If you do want to hide a center square (e.g, because you want to embed an image) you can use |\FancyQrDoNotPrintSquare{<x>}{<y>}| to hide a rectangle with radius x and y set from the center (with |\FancyQrDoNotPrintRadius{<factor>}| you can apply a \href{https://github.com/EagleoutIce/fancyqr/pull/41}{rounding} to this!). If you choose this option, the default |\FancyQrRoundCut| that rounds cut corners can be changed with |\FancyQrHardCut|. |
| 61 |
At the moment, there are five additional styles for the qr-code: |flat|, |frame|, |blobs|, |glitch|, and |dots|, that you can load (locally) by using |\FancyQrLoad{<name>}|. The default style is named |default| and can be 'reset' by |\FancyQrLoad{default}| or |\FancyQrLoadDefault|. |
| 62 |
|
| 63 |
All of the extra qr-options (you can set all of them with |\fancyqrset{<keys>}|) are showcased in \autoref{tbl:extra-keys}. |
| 64 |
The defaults are set like this: |
| 65 |
\begin{lstlisting} |
| 66 |
\fancyqrset{image padding=0,gradient=true, |
| 67 |
gradient angle=135,r color=teal,l color=purple} |
| 68 |
\end{lstlisting} |
| 69 |
Consider the following example (uses \href{https://www.ctan.org/pkg/fontawesome}{fontawesome} for the symbol, but you can use include images,~\ldots): |
| 70 |
\begin{lstlisting} |
| 71 |
\fancyqr[image=\huge\faGithub,image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr} |
| 72 |
\end{lstlisting} |
| 73 |
|
| 74 |
\parbox[c]{.3\linewidth}{Which produces:}\hfill\parbox[c]{.4\linewidth}{\raggedleft\fancyqr[image=\Huge\faGithub,image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr}}\par |
| 75 |
|
| 76 |
\begin{savenotes} |
| 77 |
\begin{table} |
| 78 |
\centering\begin{tabular}{>{\ttfamily}ll>{\ttfamily}cp{.5\linewidth}} |
| 79 |
\toprule |
| 80 |
\multicolumn{1}{l}{Option} & Type & \multicolumn{1}{c}{Default} & Explanation \\ |
| 81 |
\midrule |
| 82 |
classic & boolean & false & Use the classic qr-code style (black with flat rectangles, this loads the |flat| style). \\ |
| 83 |
color & color & & Disables the |gradient| and sets the color accordingly. \\ |
| 84 |
compensate & length & 0.15pt & Compensating overlap to add to avoid glitches. \\ |
| 85 |
gradient & boolean & true & Toggle the color gradient \\ |
| 86 |
gradient angle & angle & 135 & Change the gradient angle. \\ |
| 87 |
image & \LaTeX & & Automatically center an image (you have to care for the size and maybe adjust the |version| and |level| to keep the qr-code readable).\footnote{The package will automatically calculate the required \ltx{\\FancyQrDoNotPrintSquare} (you have to make sure that the qr-code still has enough information to be readable). Therefore, the image will not scale with the qr-code.} \\ |
| 88 |
image padding & number & & Additionally hide blocks (x \& y) around the image. \\ |
| 89 |
image x padding & number & 0 & Additionally hide blocks (x) around the image. \\ |
| 90 |
image y padding & number & 0 & Additionally hide blocks (y) around the image. \\ |
| 91 |
l color & color & purple & Set the top left gradient color. \\ |
| 92 |
left color & color & & Alias for |l color|. \\ |
| 93 |
level & L/M/Q/H & M & |qrcode| option affecting error correction (low, medium, quartile, high). \\ |
| 94 |
padding & flag & & |qrcode| option adding sufficient additional space around the qr-code. \\ |
| 95 |
r color & color & teal & Set the bottom right gradient color. \\ |
| 96 |
random color & colors & & Allow to set a random color pool to pick from. \\ |
| 97 |
right color & color & & Alias for |r color|. \\ |
| 98 |
size & length & & Alias for |qrcode|'s |height| option. \\ |
| 99 |
tight & flag & & |qrcode| option adding no additional space around the qr-code. \\ |
| 100 |
version & \([0..40] \in \mathbb{N}\) & 0 & |qrcode| option affecting the size (tries to be as small as possible). \\ |
| 101 |
width & length & & Alias for |qrcode|'s |height| option. \\ |
| 102 |
\bottomrule |
| 103 |
\end{tabular} |
| 104 |
\caption{Overview of special qr-options.} |
| 105 |
\label{tbl:extra-keys} |
| 106 |
\end{table} |
| 107 |
\end{savenotes} |
| 108 |
|
| 109 |
\end{document} |