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

If, for example, you only want to draw the top and bottom border of a box, or perhaps the left and bottom only, is there a simple package to do this or must one resort to using tables or heavy-weight drawing tools like tikz?

share|improve this question
up vote 17 down vote accepted

The mdframed package has what you want. Here is a MWE that demonstrates the borders you described in three new environments.

There are many other options available- see the documentation for more details and examples.



% all 4 borders

% just top and bottom

% just left and bottom


\subsection*{all four borders}

\subsection*{top and bottom}

\subsection*{left and bottom}
share|improve this answer

Your Answer


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.