7

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

lockstep
  • 250,273
user6830
  • 1,307

2 Answers2

8

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?

Peter Grill
  • 223,288
6

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}
Martin Scharrer
  • 262,582
  • 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. -- http://tex.stackexchange.com/q/122683/3463 – imz -- Ivan Zakharyaschev Jul 05 '13 at 21:33