| 1 |
# fancyqr |
| 2 |
|
| 3 |
[](https://www.latex-project.org/) [](http://makeapullrequest.com) [](https://www.ctan.org/pkg/fancyqr) [](https://github.com/EagleoutIce/fancyqr/actions/workflows/compile.yaml) |
| 4 |
|
| 5 |
[<img src="https://github.com/EagleoutIce/fancyqr/blob/gh-pages/preview-1.png?raw=true" width="600"/>](qr-example.tex) |
| 6 |
|
| 7 |
A simple package to create fancy qr-codes with the help of the [`qrcode`][qrcode]-package. |
| 8 |
You may use `\fancyqr` just like the normal `\qrcode` (`\fancyqr[<qr-options>]{<url>}`). See the [documentation](https://media.githubusercontent.com/media/EagleoutIce/fancyqr/gh-pages/build/fancyqr-doc.pdf). If you just want to create a simple qr-code, please refer to the [minimal example](qr-minimal.tex). |
| 9 |
|
| 10 |
*fancyqr* is actively developed by *Florian Sihler* (contact me at: <[email protected]>) under the [LPPL Version 1.3c](LICENSE) (please note that this changed on 2026-02-27 from GPL v3, versions **after** v2.2 are licensed with LPPL 1.3c). I am very happy about every contribution (see [CONTRIBUTING.md](CONTRIBUTING.md)). You can find it on CTAN (<https://www.ctan.org/pkg/fancyqr>). |
| 11 |
|
| 12 |
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 [rounding](https://github.com/EagleoutIce/fancyqr/pull/41) to this!). If you choose this option, the default `\FancyQrRoundCut` that rounds cut corners can be changed with `\FancyQrHardCut`. |
| 13 |
At the moment, there are five other styles (`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`. |
| 14 |
|
| 15 |
There are the following extra qr-options (you can set all of them with `\fancyqrset{<keys>}`): |
| 16 |
|
| 17 |
| Option | Type | Default | Explanation | |
| 18 |
| ----------------- | ----------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------ | |
| 19 |
| `classic` | boolean | `false` | Use the classic qr-code style (black with flat rectangles, this loads the `flat` style). | |
| 20 |
| `color` | color | | Disables the `gradient` and sets the qr color accordingly. | |
| 21 |
| `compensate` | length | `0.15pt` | Compensating overlap to add to avoid glitches. | |
| 22 |
| `gradient angle` | angle | `135` | Change the gradient angle. | |
| 23 |
| `gradient` | boolean | true | Toggle the color gradient | |
| 24 |
| `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).[^1] | |
| 25 |
| `image padding` | number | | Additionally hide blocks (x & y) around the image. | |
| 26 |
| `image x padding` | number | `0` | Additionally hide blocks (x) around the image. | |
| 27 |
| `image y padding` | number | `0` | Additionally hide blocks (y) around the image. | |
| 28 |
| `l color` | color | `purple` | Set the top left gradient color. | |
| 29 |
| `left color` | color | | Alias for `l color`. | |
| 30 |
| `level` | L/M/Q/H | `M` | [`qrcode`][qrcode] option affecting error correction (low, medium, quartile, high). | |
| 31 |
| `padding` | flag | | [`qrcode`][qrcode] option adding sufficient additional space around the qr-code. | |
| 32 |
| `r color` | color | `teal` | Set the bottom right gradient color. | |
| 33 |
| `random color` | colors | | Allow to set a random color pool to pick from. | |
| 34 |
| `right color` | color | | Alias for `r color`. | |
| 35 |
| `size` | length | | Alias for [`qrcode`'s][qrcode] `height` option. | |
| 36 |
| `tight` | flag | | [`qrcode`][qrcode] option adding no additional space around the qr-code. | |
| 37 |
| `version` | [0..40] ∈ ℕ | `0` | [`qrcode`][qrcode] option affecting the size (tries to be as small as possible). | |
| 38 |
| `width` | length | | Alias for [`qrcode`'s][qrcode] `height` option. | |
| 39 |
|
| 40 |
The defaults are set like this: |
| 41 |
|
| 42 |
```LateX |
| 43 |
\fancyqrset{image padding=0,gradient=true,gradient angle=135,r color=teal,l color=purple} |
| 44 |
``` |
| 45 |
|
| 46 |
[^1]: The package will automatically calculate the required `\FancyQrDoNotPrintSquare` (you have to ensure that the qr-code still has enough information to be readable). Therefore, the image will not scale with the qr-code. |
| 47 |
|
| 48 |
[qrcode]: https://www.ctan.org/pkg/qrcode |