Formatting – title with underline and box around paragraph

Can you help me please with formatting?

I like this format:

How can I define this title with grey underline (width of all page)? Font is sans serif (Arial). And how can I make grey box around some paragraph?

-
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Kurt Oct 23 '12 at 16:32
Do the titles refer to things like a \section? Or should it just be a title that is bold with a horizontal rule below it. What about the paragraph box: should it be breakable across the page boundary or not? –  Werner Oct 23 '12 at 17:01
@Kurt: Thanks for info :). –  Petra Oct 23 '12 at 17:06
@Werner: Yes, title refer to \section*. Box please in width of page. –  Petra Oct 23 '12 at 17:08

You can use the titlesec package to customize the formatting for the sectional unit headings; the mdframed or the framed packages give you the possibility to get framed text; a little example:

\documentclass{article}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{mdframed}
\usepackage{lipsum}% just to generate text for the example

\colorlet{mycolor}{gray!50}

\titleformat{\section}
{\normalfont\sffamily\Large\fontfamily{phv}\selectfont}
{\thesection.}{.5em}{}[\vspace{.2ex}\color{mycolor}\titlerule]

\newmdenv[linecolor=mycolor,skipabove=\topsep,skipbelow=\topsep,
leftmargin=-5pt,rightmargin=-5pt,
innerleftmargin=5pt,innerrightmargin=5pt]{mybox}

\begin{document}

\section*{Title}

\lipsum[2]
\begin{mybox}
\lipsum[2]
\end{mybox}

\end{document}


I wasn't sure about the desired width for the frame, so here's another option:

\documentclass{article}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{mdframed}
\usepackage{lipsum}% just to generate text for the example

\colorlet{mycolor}{gray!50}

\titleformat{\section}
{\normalfont\sffamily\Large\fontfamily{phv}\selectfont}
{\thesection.}{.5em}{}[\vspace{.2ex}\color{mycolor}\titlerule]

\newmdenv[linecolor=mycolor,skipabove=\topsep,skipbelow=\topsep]{mybox}

\begin{document}

\section*{Title}

\lipsum[2]
\begin{mybox}
\lipsum[2]
\end{mybox}

\end{document}


-
Yes, that's it. Thank you :). –  Petra Oct 23 '12 at 17:23