From 19de762b4dff70b0b8ead478b4681b72d2f89853 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 7 Aug 2007 00:24:50 +0000 Subject: barcodes from CTAN git-svn-id: svn://tug.org/texlive/trunk@4706 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/barcodes/barcodes.sty | 152 ++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/barcodes/barcodes.sty (limited to 'Master/texmf-dist/tex/latex/barcodes') diff --git a/Master/texmf-dist/tex/latex/barcodes/barcodes.sty b/Master/texmf-dist/tex/latex/barcodes/barcodes.sty new file mode 100644 index 00000000000..beb2b3a6e27 --- /dev/null +++ b/Master/texmf-dist/tex/latex/barcodes/barcodes.sty @@ -0,0 +1,152 @@ +%% +%% This is file `barcodes.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% barcodes.dtx (with options: `bcsty') +%% As this is a generated file, you may perhaps not want to edit it. +%% This file belongs to the barcode package. +%% It may be of no great use without the rest of the barcode package. +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Options for using barcodes %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% documented in bcfaq.tex %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% itf stuff +%% general +\font\xlix=wlc39 scaled 2000 +\font\fntxciii=wlc93 scaled 2000 +\font\itf=wlitf scaled 2000 +\font\cdb=wlcdb scaled 2000 +\font\eanfont=wlean scaled 1200 +\font\fntcxx=wlc128 scaled \magstep3 +%% barcodes with depth +\def\bcbox#1{\lower3pt\hbox{\itf +#1-}} +%% barcodes made taller +\newbox\bsavebox +\newdimen\bcboxdepth +\bcboxdepth=4pt +\def\bdbox#1{\setbox\bsavebox\hbox{\itf +#1-} +\vbox{\hsize=\wd\bsavebox\offinterlineskip% +\copy\bsavebox% +\vskip-\ht\bsavebox\vskip\bcboxdepth% +\box\bsavebox\vskip-\bcboxdepth}} +\def\bebox#1{\setbox\bsavebox\hbox{\itf +#1-} +\vbox{\hsize=\wd\bsavebox\offinterlineskip% +\copy\bsavebox% +\copy\bsavebox% +\vskip-\ht\bsavebox\vskip\bcboxdepth% +\box\bsavebox\vskip-\bcboxdepth}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Code 128 stuff +\font\fntcxx=wlc128 scaled \magstep3 +\def\XCIII#1{\bgroup\fntxciii #1} +\def\CXXVIII{\bgroup\fntcxx\let\next\hexchar\next} +\def\cxxviii{\message{OOPS, use codean.pl}} +\def\hexchar#1#2{\if#1@ + \global\let\next\egroup + \else\char"#1#2\fi\next} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Code 11 stuff +\font\codxifnt=wlc11 scaled\magstep2 +%% relies on counters \cha and \chb defined below +\newif\ifcodexichecksumk +\codexichecksumkfalse +\makeatletter +\def\check@xichar{% +\ifcodexichecksumk% +{\count0=\cha\count1=\count0\divide\count1by11% + \multiply\count1by11\advance\count0by-\count1% + \ifnum10=\count0-\else\relax\the\count0\fi% + \global\advance\chb by\count0\global\advance\cha by\chb% +}\fi +\chb=\cha\divide\chb by11% +\multiply\chb by11\advance\cha by-\chb% +\ifnum10=\cha-\else\the\cha\fi% +} +\def\csumxi#1{% +\if @#1% +\let\next\check@xichar% +\else \if-#1\advance\chb by10% +\else\advance\chb by#1% +\fi% +\advance\cha by\chb% +#1% +\fi% +\next% +} +\makeatother +\def\codxi#1{{ +\codxifnt +\cha=0\chb=0% +@\let\next\csumxi\expandafter\expandafter\expandafter\csumxi#1@@ +}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\font\codtnfnt=wlc39 scaled\magstep2 +\def\codxxxix#1{{\codtnfnt @#1@}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EAN stuff +%% this code comes from Kalvis M. Jansons +%% eMail: +%% +\font\eanfont=WLEAN scaled 2000 +\def\ean#1{\vbox{\vskip20pt\eanfont#1\vskip20pt}} +\newcount\num +\def\a#1{\num=#1 \advance\num by `A \char\num} +\def\b#1{\num=#1 \advance\num by `a \char\num} +\def\c#1{\num=#1 \advance\num by `K \char\num} +\def\C#1#2#3#4#5#6{\c#1\c#2\c#3\c#4\c#5\c#6} +\def\A#1#2#3#4#5#6#7{\ifcase #7 +{\a#1\a#2\a#3\a#4\a#5\a#6}% +\or {\a#1\a#2\b#3\a#4\b#5\b#6}% +\or {\a#1\a#2\b#3\b#4\a#5\b#6}% +\or {\a#1\a#2\b#3\b#4\b#5\a#6}% +\or {\a#1\b#2\a#3\a#4\b#5\b#6}% +\or {\a#1\b#2\b#3\a#4\a#5\b#6}% +\or {\a#1\b#2\b#3\b#4\a#5\a#6}% +\or {\a#1\b#2\a#3\b#4\a#5\b#6}% +\or {\a#1\b#2\a#3\b#4\b#5\a#6}% +\or {\a#1\b#2\b#3\a#4\b#5\a#6}% +\fi} +\newcount\cha +\newcount\chb +\makeatletter +\long\def\for{\@for} +\makeatother +\gdef\mysix#1#2#3#4#5#6{,#1#2,#3#4,#5#6} +\gdef\mywork#1#2{\advance\cha by #1 \advance\chb by #2} +\gdef\barch#1.#2.#3.{ +\xdef\mylist{0#1\mysix#2\mysix#3} +\cha=0 +\chb=0 +\for \x:=\mylist\do{\expandafter\mywork\x} +\multiply\cha by 3 +\advance\chb by \cha +\cha=\chb +\divide\cha by 10 +\multiply\cha by -10 +\advance\chb by \cha} +\def\bar#1.#2.#3.{\barch#1.#2.#3. +\ifnum\chb>0 #1#2#3 has a bad check sum!\\[20pt] +\else \ean{#1 +\A#2#1-\C#3+}\fi} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `barcodes.sty'. -- cgit v1.2.3