TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

What's going on here that the first and last \fbox are not getting drawn correctly when immediately following \noindent?








It's barely noticeable: but now that I see it, it annoys me.

enter image description here

share|improve this question
that is a problem with your viewer and the current magnification. – Herbert Dec 6 '12 at 20:43
I don't think it's the viewer. The same misalignment shows up when I print the document. It also shows up when I e-mail the pdf to a different computer with a different operating system. – A.Ellett Dec 6 '12 at 20:47
then give more informations! An image is not enough because I cannot see anything different when running the example. – Herbert Dec 6 '12 at 20:49
I can't see it. Can you add info about OS, TeX distribution, compilation procedure and previewer/printer driver? – egreg Dec 6 '12 at 20:50
I'm using Max OSX, pdfTeX Version 3.1415926-2.3-1.40.12 (TeX Live 2011), using Mac's preview. I first use latex, then dvips with the switch Pwww and then finally ps2pdf. – A.Ellett Dec 6 '12 at 21:03
up vote 7 down vote accepted

It is an rounding error of dvips:

543 575 a % moveto
Fa(A)p % draw `A'
605 575 4 108 v % x y width height rule
515 443 123 4 v % x y width height rule % horizontal rule
515 602 4 161 v % x y width height rule % left vertical rule
633 602 V % x y (previous width) (previous height) rule % right vertical rule
515 604 123 4 v % x y width height rule % horizontal rule

The horizontal rules start at 515 with width 123 to 638. The rule thickness is 4, thus the right vertical rule should start at 634. but it is starting at 633.

You can use a higher resolution to get a more accurate result, e.g.

dvips -D8000

or better

dvips -Ppdf

that uses -D8000 and also includes the header alt-rule.pro:

%%BeginProcSet: alt-rule.pro 0 0
% Patch by TVZ
% Makes dvips files draw rules with stroke rather than fill.
% Makes narrow rules more predictable at low resolutions
% after distilling to PDF.
% May have unknown consequences for very thick rules.
% Tested only with dvips 5.85(k).

Result with dvips -Ppdf:


share|improve this answer
Thank you. Now it works. – A.Ellett Dec 7 '12 at 1:58
The dvi resolution should not exceed 2636 dpi (dvips -D2636), if the PS contains material to be distilled into XObjects which are later used as appearances in PDF annotations. See: tex.stackexchange.com/a/127836. 2400 dpi is far enough to solve the rounding errors discussed here. – AlexG Aug 20 '13 at 9:20

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.