%% fancyqr-doc.tex
%% Copyright 2026 Florian Sihler
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is Florian Sihler
%
% This work consists of the fancyqr.sty, alongside the `fancyqr-style-*.code` files and the documentation `fancyqr-doc.tex`.
\documentclass[parskip=half,english,numbers=noenddot,footnotes=nomultiple,oneside]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage{microtype}
\usepackage[hidelinks]{hyperref}

\usepackage{lmodern}
\usepackage{array,booktabs}
\usepackage{footnote}
\usepackage{fontawesome}

\usepackage{fancyqr}
\usepackage{xcolor}
\usepackage[tex]{listings}
\usepackage{amssymb}

\lstdefinelanguage{ltx}{
	language={[LaTeX]TeX},
	moretexcs=[1]{fancyqr,qrcode,FancyQrDoNotPrintSquare,FancyQrRoundCut,FancyQrHardCut,FancyQrLoad,FancyQrLoadDefault,fancyqrset,faGithub,FancyQrDoNotPrintRadius}
}
\lstset{basicstyle=\ttfamily,breaklines,texcsstyle=*\color{purple}\bfseries,language=ltx}
\lstMakeShortInline|
\def\ltx#1{\lstinline/#1/}
\interfootnotelinepenalty=10000


\title{The \texttt{fancyqr} package}
\author{%
	\texorpdfstring{Florian Sihler\medskip\\*
		\fancyqr{https://github.com/EagleoutIce/fancyqr}
	}{Florian Sihler}}
\date{Version v2.3 \textendash{} 2026/02/27}

\begin{document}
   \maketitle


	\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.
	You can use the |\fancyqr|-macro just like the normal |\qrcode|.\footnote{\ltx{\\fancyqr[<qr-options>]\{<url>\}}}

	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|.
	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|.

	All of the extra qr-options (you can set all of them with |\fancyqrset{<keys>}|) are showcased in \autoref{tbl:extra-keys}.
	The defaults are set like this:
\begin{lstlisting}
\fancyqrset{image padding=0,gradient=true,
	gradient angle=135,r color=teal,l color=purple}
\end{lstlisting}
	Consider the following example (uses \href{https://www.ctan.org/pkg/fontawesome}{fontawesome} for the symbol, but you can use include images,~\ldots):
\begin{lstlisting}
\fancyqr[image=\huge\faGithub,image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr}
\end{lstlisting}

	\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

\begin{savenotes}
\begin{table}
	\centering\begin{tabular}{>{\ttfamily}ll>{\ttfamily}cp{.5\linewidth}}
		\toprule
		\multicolumn{1}{l}{Option} & Type & \multicolumn{1}{c}{Default} & Explanation \\
		\midrule
		classic         & boolean &   false  & Use the classic qr-code style (black with flat rectangles, this loads the |flat| style).                                \\
		color           & color   &          & Disables the |gradient| and sets the color accordingly.      \\
		compensate      & length  & 0.15pt & Compensating overlap to add to avoid glitches.               \\
		gradient        & boolean &   true   & Toggle the color gradient                                    \\
		gradient angle  & angle   &  135     & Change the gradient angle.                                   \\
		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.} \\
		image padding   & number  &          & Additionally hide blocks (x \& y) around the image.          \\
		image x padding & number  &   0      & Additionally hide blocks (x) around the image.               \\
		image y padding & number  &   0      & Additionally hide blocks (y) around the image.               \\
		l color         & color   & purple   & Set the top left gradient color.                             \\
		left color      & color   &          & Alias for |l color|.                                         \\
		level 			 & L/M/Q/H &   M      & |qrcode| option affecting error correction (low, medium, quartile, high).                                     \\
		padding         & flag    &          & |qrcode| option adding sufficient additional space around the qr-code.                                            \\
		r color         & color   &  teal    & Set the bottom right gradient color.                         \\
		random color    & colors  &          & Allow to set a random color pool to pick from.               \\
		right color     & color   &          & Alias for |r color|.                                         \\
		size            & length  &          & Alias for |qrcode|'s |height| option.                        \\
		tight           & flag    &          & |qrcode| option adding no additional space around the qr-code.                                                    \\
		version         & \([0..40] \in \mathbb{N}\) &   0      & |qrcode| option affecting the size (tries to be as small as possible).                                             \\
		width           & length  &          & Alias for |qrcode|'s |height| option.                        \\
		\bottomrule
	\end{tabular}
	\caption{Overview of special qr-options.}
	\label{tbl:extra-keys}
\end{table}
\end{savenotes}

\end{document}
