Difference between revisions of "Barcodes"
Jump to navigation
Jump to search
(new) |
m (add category) |
||
Line 33: | Line 33: | ||
\luabarcode{9783865419026} | \luabarcode{9783865419026} | ||
</texcode> | </texcode> | ||
+ | |||
+ | [[Category:Graphics]] |
Revision as of 18:55, 7 September 2021
< Graphics
How to create barcodes from within ConTeXt (MkIV/LMTX)?
Zint module
- Download
zint
from https://www.zint.org.uk (Windows, Linux) or install it with Homebrew or MacPorts (MacOS). - MkIV: The
zint
executable must be in yourPATH
. - LMTX: Copy or symlink the zint library into
$TEXROOT/tex/texmf-$ARCH/bin/lib/luametatex/zint
(you must create that path); on Windows, this islibzint.dll
, on Linux and MacOSlibzint.so
(on MacOS the actual file name islibzint.dylib
, but LuaMetaTeX expects.so
). Then runmtxrun --generate
to update the file database.
\usemodule[zint] \barcode[alternative=isbn, text=9783865419026, width=4cm] \barcode[alternative=qr code, text={https://wiki.contextgarden.net}, width=3cm]
Zint can produce about 40 different code types (“alternatives“). Try the name (but lowercase with spaces) or look into the source
Barcodes module
The old module uses PStricks and is deprecated. (Source)
barcode.lua
In 2012, user topskip published a small LuaTeX library on Stack Exchange. It can only create EAN codes.
\loadluafile[barcode] \define[1]\luabarcode{\directlua{generate_barcode_lua("#1")}} \luabarcode{9783865419026}