Debian Codegraph @

texmf-dist/doc/latex/barcodes/examples.tex

raw
1 %%
2 %% This is file `examples.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% barcodes.dtx (with options: `example')
8 %% As this is a generated file, you may perhaps not want to edit it.
9 %% This file belongs to the barcode package.
10 %% It may be of no great use without the rest of the barcode package.
11 %% \CharacterTable
12 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
13 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
14 %% Digits \0\1\2\3\4\5\6\7\8\9
15 %% Exclamation \! Double quote \" Hash (number) \#
16 %% Dollar \$ Percent \% Ampersand \&
17 %% Acute accent \' Left paren \( Right paren \)
18 %% Asterisk \* Plus \+ Comma \,
19 %% Minus \- Point \. Solidus \/
20 %% Colon \: Semicolon \; Less than \<
21 %% Equals \= Greater than \> Question mark \?
22 %% Commercial at \@ Left bracket \[ Backslash \\
23 %% Right bracket \] Circumflex \^ Underscore \_
24 %% Grave accent \` Left brace \{ Vertical bar \|
25 %% Right brace \} Tilde \~}
26 %%
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 %%
29 %% This file documents look and use of
30 %% the barcodes this package belongs to.
31 %% It may be freely used without any
32 %% further permission.
33 %% You should have received this file as part of
34 %% the barcode package.
35 %%
36 %% Author: Peter Willadt
37 %% Date: 1997-11-29
38 %%
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40 %%
41 %% Note:
42 %% 1. This file has already been run through codean.pl
43 %%
44 %% 2. You need to have the fonts installed, of course.
45 %%
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 %% Fonts
48 %%
49 \font\xlix=wlc39 scaled 2000
50 \font\itf=wlitf scaled 2000
51 \font\cdb=wlcdb scaled 2000
52 \font\eanfont=WLEAN scaled 1200
53 \font\fntcxx=wlc128 scaled \magstep3
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 %% Inputs
56 %%
57 \input code39.tex
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %% Def's
60 %%
61 %% for EAN
62 \def\ean#1{\message{Call codean.pl}}
63 \def\eean#1{\message{Call codean.pl}}
64 \def\isbn#1{\message{Call codean.pl}}
65 \def\embed#1{}
66 \def\EAN#1{\vbox{\hsize=0.4\hsize\vskip10pt\eanfont#1\vskip10pt}}
67 %% for Code 128
68 \def\CXXVIII{\bgroup\fntcxx\let\next\hexchar\next}
69 \def\hexchar#1#2{\if#1@\global\let\next\egroup\else\char"#1#2\fi\next}
70 %%
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 %% Here we go
73 \parindent0pt
74 Hello, this is a test sheet of the barcode fonts.
75
76 At first, we deal with code 39. Code 39 is represented in this package
77 both in form of a native font (Metafont-source) and in form of
78 \TeX{}-macros. code 39 features low-density alphanumeric encoding.
79
80 Here you may see how HELLO looks like in code 39 (the start and stop
81 sign is mapped to @, if you're curious, so in the source to this sheet
82 I have written {\tt@HELLO@} after having selected the proper
83 font). This first example uses the font.
84
85 {\xlix@HELLO@}
86
87 Another approach is to use \TeX{} macros to make up bars. Here is the
88 same HELLO with macros: Please note that for the macro version, you
89 have to use the underbar if you want to have a space coded.
90
91 \begincodethirtynine{HELLO}\endcodethirtynine
92
93 Interleaved two-of-five (ITF for short) features high-density
94 numerical-only encoding. Your code has to have an even number of
95 digits. The start sign is mapped to $+$, the end sign to $-$.
96 So, to code 0123456789, you type {\tt+0123456789-}, and the result
97 looks like this:
98
99 {\itf+0123456789-}
100
101 If you still have not got enough of barcoding, here is codabar. Here
102 you got four sets of start/stop signs that get decoded together with
103 the numbers. The start/stop sign pairs are a/t, b/n, c/*, and d/e. So
104 {\tt a12345t} looks like this:\bigskip
105
106 {\cdb a12345t}
107
108 Now you should have a look at code 128. The bars itself look sometimes
109 disrupted; this is due to the fact that the widest elements are four
110 times as wide as the narrowest. Code 128 enables you to code any 7-bit
111 ascii character. With digits only, it is as efficent as itf. The bad
112 news is the preprocessing required, so you have to read the docs. The
113 following bars mean {\tt Hallo123456}\bigskip
114
115 \CXXVIII 6828414C4C4F630C2238506A@@ % Code128(Hallo123456)
116
117 And, last and perhaps most important, the EAN font. Read {\tt
118 eandoc.tex} to find out how these are coded, here is just the output
119 of the example code mentioned there:
120 \embed{2500000000000}
121
122 \line{
123 \EAN{4 +AcFHaa-KKLKNK+} % or, without checksum: %(4025700001030)
124 \hfil
125 \EAN{4 +AcFHaa-KKLKNK+} %(402570000103)
126 }
127 \line{
128 \EAN{2 +FAaaAa-KKLMNT+} % embedded(123)
129 \hfil
130 \EAN{9 +HiaCaB-LNOOSN+} % ISBN(0201134489)
131 }
132
133 And that's all. Perhaps you may think that this is not a beautiful
134 document---but barcodes aren't beautiful. As long as reading devices
135 do not have \ae{}sthetic feelings, I don't regard this as a problem.
136 \bye
137 \endinput
138 %%
139 %% End of file `examples.tex'.