Take the 2-minute tour ×
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.

I want to include the Padding left, top, right and bottom. How can we do in LaTeX?

share|improve this question
3  
Welcome to TeX.sx! Please add a minimal working example (MWE) to give more detail on where this 'padding' is located. –  Joseph Wright Jul 22 '11 at 7:22

2 Answers 2

up vote 6 down vote accepted

If I understand your question correctly, the geometry package could be used:

\usepackage[%
    left=0.50in,%
    right=0.50in,%
    top=1.0in,%
    bottom=1.0in,%
    paperheight=11in,%
    paperwidth=8.5in%
]{geometry}%

Also see xports answer to How can I set up the left/right margin of the page to 1 inch, the top/bottom one to ½ inch?

share|improve this answer
    
Is this margin or padding. Then how to set for (margin - left right top bottom). I am asking for padding, what is the tag? Please reply margin tag and padding tag separately. –  user6830 Jul 22 '11 at 7:31
    
Thanks for your reply. This is for page. In a table how to set padding. –  user6830 Jul 22 '11 at 7:41
1  
Please see this link first: How to add border and padding to contents If you are satisfied with the given link, don't forget to up vote it. :-) –  xport Jul 22 '11 at 7:50
    
Please see Joseph's comment about providing a MWE. –  Peter Grill Jul 22 '11 at 8:23

Note that LaTeX itself doesn't differ between margin and padding, because it actually doesn't now this concepts. They are normally not required for typesetting. Books are simply done differently than websites.

The adjustbox package includes a \marginbox which allows to add a margin (or padding) around a boxed content. There is also a margin option for \adjustbox or the adjustbox environment.

There are three different ways to define the margin/padding:

\marginbox{<all sites>}{<content>}
\marginbox{<left/right> <top/bottom>}{<content>}
\marginbox{<left> <bottom> <right> <top>}{<content>}

Or use \adjustbox or {adjustbox}:

\adjustbox{margin=...}{<content>}
\begin{adjustbox{margin=...}
    <content>
\end{adjustbox}

If you want to set padding, draw a frame/border around it and then add some margin use:

\begin{adjustbox{margin=<l> <b> <r> <t>,frame=<thickness>,margin=<l> <b> <r> <t>}
    <content>
\end{adjustbox}

Here the first margin sets the padding, the second the margin. If you only want equal padding on all four sides you can also use the optional separation (<sep>) argument of the fbox option:

\begin{adjustbox{fbox=<thickness> <sep>,margin=<l> <b> <r> <t>}
    <content>
\end{adjustbox}
share|improve this answer
    
What if I want to set padding around the page body (on all pages), draw a frame/border around it and then add some margin? The geometry package doesn't seem to have an option for this because it doesn't separate padding and margin. -- tex.stackexchange.com/q/122683/3463 –  imz -- Ivan Zakharyaschev Jul 5 '13 at 21:33

Your Answer

 
discard

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.