[NTG-context] Printing labels with ConTeXt
Willi Egger
w.egger at boede.nl
Wed May 31 21:56:01 CEST 2006
Hi Renaud,
Renaud AUBIN wrote:
> Hi all,
>
> I need to print labels on this kind of paper:
> - A4 page with 24 labels (70mm x 36mm)
> - 3 columns and 8 rows
> - 4.5mm top margin, 4.5mm bottom margin
>
> I use:
>
> \definepapersize[DECAdry-70x36][width=70mm,height=36mm]
> \setuppapersize[DECAdry-70x36][A4]
> \setuppaper[nx=3,ny=8]
> \setuparranging[XY]
>
> I just need to know how to reserve a vertical white space (4.5mm)
> from the top of the A4 page and put all my labels side-by-side
> (vertically and horizontally).
>
> Renaud
>
I hope that the following solution, which I use for making adres-labels
kan give you the answer: The key for reserving the white space is the
veroffset= option.
Cheers
Willi
% Adres labels format 45 by 100mm
% Context file
% filename: testetiket.tex
% Willi Egger
% may 2006
% The carrying sheet is too thin to be pulled through the laser-printer
when labels have been taken off.
% Therefore one needs to start using the label-sheet "bottum-up".
\setupbodyfont[rm,12pt]
\definepapersize[Etiket][height=42.3mm,width=105mm]
\setuppapersize [Etiket][A4,portrait]
\setuppaper
[topspace=0mm,
backspace=0mm,
dx=.5mm,
dy=0mm,
nx=2,
ny=7,
margin=0,
width=210mm,
height=297mm]
\setuplayout
[%
% veroffset=4.5mm,
% horoffset=4.5mm,
topspace=4mm,
backspace=6mm,
margin=0mm,
width=96mm,
height=34mm,
header=0mm,
footer=0mm]
\setuparranging[XY]
\definelayer[Etiket][width=\textwidth, height=\textheight]
\setupframedtexts[frame=off,width=\textwidth,align=right]
\startbuffer[Sender]
\framed[frame=off,bottomframe=on,rulethickness=1pt,width=\textwidth,align=right]{%
Sender, street, ZIP town}
\stopbuffer
\def\Printlabel{3} %Last available label
\def\Addresses{14} %Number of labels per sheet.
\startbuffer[Adr\Printlabel]
\framedtext{%
\startlines
Name
Street
ZIP Town
Country
\stoplines}
\stopbuffer
\showframe
\starttext
\dostepwiserecurse{1}{\Addresses}{1}{%
\ifnum\recurselevel=\Printlabel
{\setlayer
[Etiket]
[preset=lefttop,location={right,bottom}]
{\switchtobodyfont[5pt]\getbuffer[Sender]}
\setlayer
[Etiket]
[preset=leftbottom,location={right,top},y=-3mm,x=-3mm]
{\switchtobodyfont[10pt]\getbuffer[Adr\recurselevel]}}
\else
{\setlayer
[Etiket]
[preset=lefttop,location={right,bottom}]
{\strut}}
\fi
\placelayer[Etiket]}
\stoptext
More information about the ntg-context
mailing list