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

The purpose of the mybox environment in the following document is to typeset a box in a blue background. The box may be split by page breaks. The algorithm used is similar to the one found in the boites package:

  • first the text is formatted in a vbox
  • then each line of the vbox is extracted from the vbox and output in a colorbox.

The document:




  % total height of original box
  % split original box in order to retrieve its first line
  \setbox\boxhead\vsplit\boxtail to 0pt
  % fix the height of the first line
  % restore original size

    \fboxsep 0pt
    \splittopskip 0pt
    \baselineskip 0pt
    \lineskiplimit 0pt
    \lineskip 0pt
        \colorbox{blue}{\hbox to \linewidth{\box\boxhead}\hfil}%




When looking with care (the following image shows the document opened in the evince pdf viewer), very thin white rules can be seen between the blue lines in the text formatted by the environment.

sample document

Has anybody any clues on how to eliminate them?

I know there are packages like mdframed that already provides this functionality using a different algorithm. But they do not work with the beamer class or in multicolumn environments, and they cannot be nested.


As pointed by others, this seems to be an issue with the pdf viewer. I tried several viewers (on Linux) and found that some of them shows the thin white rules and others do not.

Good pdf viewers:

  • qpdfview 0.4.9
  • adobe reader 9.5.5
  • okular 0.18.3
  • foxit reader (with wine)

Bad pdf viewers:

  • evince 3.10.3
  • epdfviewer 0.1.8
  • sumatra pdf 2.4 (with wine)
  • pdf-xchange (with wine)
share|improve this question
Which pdf viewer do you use? I do not see any white lines. – Yiannis Lazarides Apr 23 '12 at 2:07
@YiannisLazarides: evince, okular and zathura on Linux. With acroread I do not see the thin white lines. – Romildo Apr 23 '12 at 2:10
It is a problem with the viewer and not the code. – Yiannis Lazarides Apr 23 '12 at 5:05
up vote 4 down vote accepted

This is most likely a feature of the viewer, however you can workaround it by inserting a small negative skip (the smallest fraction of a point that works on your screen) so that the coloured boxes overlap. Depending on your requirements that may be enough or you may want to compensate by increasing the height of the box so

instead of


something like

share|improve this answer

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.