How can I set a different padding value for each side? I want a result that corresponds with this HTML/CSS configuration:

    div {
      background: #444;
      color: white;

    div.padded {
      padding-top: 60px;
      padding-right: 10px;
      padding-bottom: 15px;
      padding-left: 152px;
  <div class="padded">
    Top: 10px; bottom: 0px<br>
    Left: 5em; right: 0px

What is the exact paragraph style to set in LaTeX?

\renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt}

\font\brbrdivpadded="Times New Roman":color=ffffff at 12pt
\font\brdivpadded="Times New Roman":color=ffffff at 12pt
\font\divpadded="Times New Roman":color=ffffff at 12pt

\divpadded{Padded }\divpadded{Top: 10px; bottom: 0px }\divpadded{Left: 5em; right: 0px }
  • 6
    I think you need to read The not so short introduction to LaTeX. It's clear from this question that you don't really understand how LaTeX works.
    – Seamus
    Commented Aug 8, 2011 at 10:01
  • 6
    Can you show us some attempt you've made in achieving this configuration? Is there something in particular you're struggling with? This Q&A site is about solving problems, not about having other people do your work (even though sometimes it seems tex.sx users will do anything as long as it is about TeX). If you don't know at all how to go about changing this, I second Seamus' recommendation to read some introductory text on LaTeX.
    – doncherry
    Commented Aug 8, 2011 at 10:53
  • 1
    The upcoming version of adjustbox provides a \marginbox{<llx> <lly> <urx> <usry>}{..} macro which can be used to add the padding. Also have a look on the mdframed or the older framed package. But LaTeX and HTML/CSS work under complete different principles, so a little more context would help understanding your needs. Commented Aug 8, 2011 at 10:54
  • For code blocks, every line needs to be preceded by four spaces. The easiest way to do this is to select the code and press the {} button.
    – Jake
    Commented Aug 9, 2011 at 6:20

1 Answer 1


I give you a template that simulates your HTML but it is not so similar. :-) Adjust it gradually while you are learning TeX and getting familiar with it.

enter image description here


\pagecolor{Yellow!50}% page color
\color{Maroon}% text color

\usepackage{lipsum}%dummy text

\usepackage[demo]{graphicx}% import graphics

\section{Introduction to \LaTeX}
\caption{Dummy Figure}

\section{Introduction to PSTricks}

Not the answer you're looking for? Browse other questions tagged .