Debian Codegraph @

texmf-dist/doc/luatex/barracuda/test/test-ean/005-isbn-test.tex

raw
1 % !TeX program = LuaTeX
2 \nopagenumbers
3 % load package and store it in a global Lua variable
4 \directlua{barracuda = require "barracuda"}
5 \newbox\mybox
6
7 ISBN test:
8 \vskip10pt
9
10 \leavevmode
11 \directlua{barracuda:hbox("ean-isbn", "978-88-8154-348-9", "mybox")}
12 \box\mybox
13 \directlua{barracuda:hbox("ean-isbn", "978 88 8154 348 9", "mybox")}
14 \box\mybox
15
16 \vskip10pt
17 \directlua{barracuda:hbox("ean-isbn+5", "978 88 8154 348 9-80026", "mybox")}%
18 \box\mybox
19
20 \vskip10pt
21 ISBN 10 test, the 10-digits code is automatically converted in an ISBN 13 code:
22 \vskip10pt
23 \directlua{barracuda:hbox("ean-isbn", "1-78474-140-X", "mybox")}%
24 \box\mybox
25
26 \vskip10pt
27 \directlua{barracuda:hbox("ean-isbn+5", "1-78474-140-X 12345", "mybox")}%
28 \box\mybox
29
30 \vskip10pt
31 \directlua{barracuda:hbox("ean-isbn+2", "1-78474-140-X 99", "mybox")}%
32 \box\mybox
33
34 \vskip5pt
35 ISBN Test: the value 'auto' for 'text\_isbn\_enabled' option means that
36 the text above the symbol isn't printed if in the provided code does not
37 have group chars or the length is not 10:
38 \vskip5pt
39 \leavevmode
40 \directlua{barracuda:hbox("ean-isbn", "9788881543489", "mybox")}
41 \box\mybox
42 \directlua{barracuda:hbox("ean-isbn", "978-8881543489", "mybox")}
43 \box\mybox
44
45 \bye