I build a minipage with some background picture:


% somewhere in the document:

   Some content

Now I want to have some padding at each side (top, down, left, right) inside the minipage so that the content does not overlap with the styled border part of the background image. How can I do that?

  • The code will give an error, because the mandatory argument to \begin{minipage} is missing. Can you show a complete example? – egreg Jan 26 '14 at 15:15
  • @egreg: \begin{minipage} inherits the argument from the environment dsaBoxLandscape that has an optional argument and the arguments for minipage. – Heiko Oberdiek Jan 26 '14 at 16:39
  • @HeikoOberdiek That's why I asked for a complete example. – egreg Jan 26 '14 at 16:54
  • @JohnKormylo: That question is about drawing a border around an lrbox. I already have a border, it's part of my background image. I just want to add spacing to the content of the box so that it doesn't overlap to the border of the background image. @egreg: I'll add more code later, I don't have it here right now. – flyx Jan 27 '14 at 6:47

I've added the padding in the size of \fboxsep. The draft option is to show just a frame instead of the image, the string duck.jpg is just the file name I used for the example.

The padding is outside the left margin, remove the \hspace{-\fboxsep} and add \hspace{\fboxsep} before \usebox if you want to push right the inner box instead.

I removed the useless \sbox{\langscapeSafebox}{\usebox{\langscapeSafebox}} that simply resets the box to itself.

\usepackage{lipsum} % just for the example
\usepackage[draft]{graphicx} % draft is just for the example




Some content

and some other



enter image description here

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.