Debian Codegraph @

texmf-dist/doc/latex/gs1/GS_set_code_digit_seq.tex

raw
1 %%
2 %% This is file `GS_set_code_digit_seq.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% GS1.dtx (with options: `test,GS.set.code.digit.seq')
8 %%
9 %% EXPERIMENTAL CODE
10 %%
11 %% This Work depends on the correct version of expl3 release. If
12 %% you'll update expl3 you may need a update of this this Work too.
13 %%
14 %% Do not distribute this file without also distributing the
15 %% source files specified above.
16 %%
17 %% Do not distribute modified version of this file.
18 %%
19 %% File: GS1.dtx Copyright (C) 2012-2017 Markus Kohm
20 %%
21 %% It may be distributed and/or modified under the conditions of the
22 %% LaTeX Project Public License (LPPL), either version 1.3c of this
23 %% license or (at your option) any later version. The latest version
24 %% of this license is in the file
25 %%
26 %% http://www.latex-project.org/lppl.txt
27 %%
28 %% This file is part of the "GS1 bundle" (The Work in LPPL)
29 %% and all files in that bundle must be distributed together.
30 %%
31 %% The released version of this bundle is available from CTAN.
32 %%
33 %% -------------------------------------------------------------------------
34 \RequirePackage{expl3}[2017/05/29]
35 \GetIdInfo$Id: GS1.dtx 23 2021-06-17 07:00:36Z mjk $
36 {GS1 code handler and barcode generator}
37 \documentclass{article}
38 \usepackage{GS1}
39 \ExplSyntaxOn
40 \msg_new:nnn { GS1/test } { function }
41 {
42 Something~is~wrong~with~function~#1
43 \msg_line_context:~~of~\c_sys_jobname_str.tex.
44 }
45 \ExplSyntaxOff
46 \begin{document}
47 \ExplSyntaxOn
48 \seq_new:N \l_testa_seq
49 \seq_new:N \l_testb_seq
50
51 \GS_set_code_digit_seq:Nn \l_testa_seq {ISBN 978-3-86541-459-5}
52 Sequence~for~ISBN~978-3-86541-459-5~is:~
53 \seq_use:Nnnn \l_testa_seq { ,~ } { ,~} { ,~ }
54
55 \GS_set_code_digit_seq:Nn \l_testb_seq {9783865414595}
56 \seq_map_inline:Nn \l_testa_seq
57 {
58 \seq_pop_left:NN \l_testb_seq \l_tmpa_tl
59 \tl_set:Nn \l_tmpb_tl { #1 }
60 \tl_if_eq:NNF \l_tmpa_tl \l_tmpb_tl
61 {
62 \tl_show:N l_testa_seq
63 \tl_show:N l_testb_seq
64 \msg_fatal:nnn { GS1/test } { function } { \GS_set_code_digit_seq:Nn }
65 }
66 }
67
68 \GS_set_code_digit_seq:Nn \l_testa_seq {ISBN 978-3-86541-459-5}
69 \seq_set_split:Nnn \l_testb_seq {,} {9,7,8,3,8,6,5,4,1,4,5,9,5}
70 \seq_map_inline:Nn \l_testa_seq
71 {
72 \seq_pop_left:NN \l_testb_seq \l_tmpa_tl
73 \tl_set:Nn \l_tmpb_tl { #1 }
74 \tl_if_eq:NNF \l_tmpa_tl \l_tmpb_tl
75 {
76 \tl_show:N \l_testa_seq
77 \tl_show:N \l_testb_seq
78 \msg_fatal:nnn { GS1/test } { function } { \GS_set_code_digit_seq:Nn }
79 }
80 }
81
82 \ExplSyntaxOff
83 \end{document}
84 %%
85 %%
86 %% End of file `GS_set_code_digit_seq.tex'.