# How can I put section between 2 horizontal lines

Could anyone tell me how can I put section between 2 horizontal lines.

I tried something similar to the following code but it did not work.

\makeatletter
\renewcommand\section{‎
\hrule
\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\large\scshape}‎‎
\protect ‎\hrule
}
\makeatother


this is a sample picture for ‎‎\section{Experience}‎

-
Should the section be numbered? –  Bernard Jul 22 '14 at 9:08
@Bernard: no only the title is important –  mehralian Jul 22 '14 at 9:35

We can exploit the fact that the final argument of \@startsection in the definition of \section can contain a one parameter macro which will receive the section title (with the number) as argument.

\documentclass{article}

\makeatletter
\renewcommand\section{%
\@startsection{section}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\ruled@title}%
}
\newcommand{\ruled@title}[1]{%
\vbox{\hrule\vskip2pt\hbox{\large\scshape #1}\vskip2pt\hrule}%
}
\makeatother

\setcounter{secnumdepth}{-2}

\begin{document}
\section{experience}

\end{document}


-
Thanks a lot. That solves my problem. –  mehralian Jul 22 '14 at 9:30
Just emphasizing the feature: mine and this one don't support multiple lines of section title. –  kiss my armpit Jul 22 '14 at 15:00

Another simple but not perfect solution.

\documentclass[preview,border=12pt,12pt]{standalone}
\def\Section#1{\section*{\tabular{@{}c@{}}\hline #1\\\hline \endtabular}}
\begin{document}
\Section{PSTricks is fun!}
Bla bla bla
\end{document}


-