I would like to be able to draw a box that shows up on in the PDF but does not print, just like the boxes around links that are made using the hyperref package.

I would like to put a minipage environment with multiple paragraphs inside the box.

3 Answers 3


Here's a solution using the pdfcomment package that Martin mentioned.


  • doesn't link anywhere
  • doesn't change the cursor to the hand pointer when pointing at the text.


  • will most likely only work with Adobe Reader (doesn't work with GhostView and Sumatra)
  • you have to find the coordinates for the rectangle manually ("To avoid the method ’trail [sic] and error’ you can load the PDF file with the Ghostscript viewer, which is capable of showing the cursor position in it’s status line.", pdfcomment documentation)
  • will or will not print the box depending on the user's setting in the print window; "print document" (doesn't print box) or "print document and markup" (prints box).
  • changes the cursor when pointing at the box/border; box is clickable and becomes "selected" when clicked

As for the coordinates:

You can use the option line for defining the coordinates of lines in certain PDF annotations, e. g. in the form {x1 y1 x2 y2}. The origin is in the bottom left page corner. The given numbers will be interpreted as Postscript points (LaTeX unit: bp (big points)), as usual in PDF documents.

(pdfcomment documentation)




\pdflinecomment[type=polyline,lineend={/None},% = line with >2 "corners", no arrowhead
line={120 720 120 570 480 570 480 720 120 720},% adapt to your document
color=green,linewidth=1.5pt% adapt to your liking


enter image description here


The border is a PDF annotation and as I saw in the hyperref code part of the hyperlink. Adding it without a link is seems to be not possible using existing LaTeX packages. The related pdfcomments package also provides some annotations but also no border only AFAIK. It might be possible using some direct PDF code using \pdfliteral, but you would need to know the PDF commands for this.

However you can add the border by placing it in a \hyperref or \href, but both do not allow paragraphs as content and generate a very tight border. You could use the v0.5 or higher of the adjustbox package (relative new) to box the minipage first which avoids the paragraph issue, add a margin if wanted and feed it to a \hyperref which e.g. simply points to the current page. The border color can be configured as described in the hyperref manual.









it needs \endgraf instead of \par



\TBox{\blindtext \endgraf\blindtext}


enter image description here

  • simple and elegant. Aug 29, 2011 at 20:34
  • This doesn't work with normal paragraphs. Paragraph ended before \href@split was complete Aug 29, 2011 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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