TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make sticky labels with LaTeX. I thought this would be pretty simple because of LaTeX's nice support of absolute units, but it turned out to be quite difficult. This is the specification of the label paper:

  • Left and right margin: 0mm
  • Upper and lower margin: 8mm
  • Label height: 25mm
  • Label width: 52mm
  • Inner label margin: 2mm

That's 11 rows and 4 columns of labels. The label will contain just text. Here's what I've got to so far:






\newcommand{\labeltext}{\textbf{M\&M} er en sød vin lavet på hyben plukket ved Vemmingbund Strand i Sønderjylland. Vinen produceres.}

\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]
\labeltext & \labeltext & \labeltext & \labeltext \vfill \\%[\mylabelheight]

This is almost correct. However, the table cells don't expand their height to fit the paper (this is, bottom row should touch the bottom margin).

Also, I can't figure out how to get an upper and lower margin of 2mm inside each cell. I tried using \vspace{2mm}, but that produces a much larger space than requested.

I tried posting a picture of the result, but I'm not allowed to at the moment. Sorry.

Thanks in advance!

share|improve this question
You can include the image with the button; just remove the ! in front of the string you get (![text][1]). A user with enough rep will put back the ! for you. You should also have a look at the labels package. – egreg Sep 24 '12 at 21:46
I heartily second @egreg 's suggestion: take a look at the labels package. – Brent.Longborough Sep 24 '12 at 22:08
@egreg: I'll do that next time, thanks! I looked at the labels package, but from what I understood from the manual, it only works for ond brand of labels (unless I modified the code itself, which I didn't have the courage to do). – Dan Sep 25 '12 at 7:56
up vote 5 down vote accepted

Don't take this too seriously. But, hey, it works!

Idea borrowed (or stolen?) from the TeXbook, Exercise 21.8.





  \textbf{M\&M} er en sød vin lavet på hyben plukket ved Vemmingbund
  Strand i Sønderjylland. Vinen produceres.}



    \vbox to 25mm{
      \hsize=52mm \leftskip=2mm \rightskip=2mm

\hbox to\hsize{\cleaders\vbox to \vsize{\cleaders\copy\danbox\vfil}\hfil}


enter image description here

The idea is to repeat a box as many times as needed. First of all we build it (with low level commands, in order to have maximum control) and store it in a save bin; by setting \fboxsep to -\fboxrule we ensure that the frame will not add to the height and width of the box. The box itself has a width of 52mm and a height of 25mm (the \vfill at the end will avoid any additional depth due to characters with descenders, as there's no text at the bottom, but glue).

Now the fun begins.

  1. With \hbox to \hsize we tell TeX to build a box as wide as the page.

  2. \cleaders<material>\hfill will fill the width with copies of <material>, pushing them close to each other and adding space to both sides to finish the filling.

  3. Our <material> will be exactly 52mm wide, so four columns, with 1mm of white space on both sides (A4 paper is 210mm wide).

  4. Now we specify the <material>: it's a \vbox to \vsize{...} so it will fill all the page height.

  5. For filling it we do exactly the same: \cleaders\copy\danbox\vfil (we must use \copy rather than \usebox that would start horizontal mode). A4 paper is 297mm high, so eleven rows will be accommodated, leaving 11mm on both ends.

That's it. :)

share|improve this answer
Now it's me who is glad of still having one vote left. – Gonzalo Medina Sep 24 '12 at 22:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.