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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 }
share|improve this question

closed as too localized by Seamus, lockstep, Gonzalo Medina, Joseph Wright Aug 22 '11 at 6:00

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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 Aug 8 '11 at 10:01
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 Aug 8 '11 at 10:53
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. – Martin Scharrer Aug 8 '11 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 Aug 9 '11 at 6:20

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}
share|improve this answer

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