# Changing the style of a single section

I'm trying to change the format of a single section in my document.

The section is the introduction of my document, and therefore, I don't want it to be numbered.

I tried to define a new command

\newcommand{\ssection}[1]{%
\section[#1]{\centering\normalfont\scshape #1}}


it works, however, I can't suppress the numbering.

-
is there any reason you can't just use \section*? –  barbara beeton Jun 2 '12 at 14:35
I don't see why the section shouldn't be numbered, but I can understand if one wants it; however the heading should be in the same style as the others. So \section* with \addcontentsline should be all you need. –  egreg Jun 5 '12 at 9:12

With the help of the titlesec package you can define a command containing the format for special section(s) and another one for regular section(s) and change the formatting as required:

\documentclass{article}
\usepackage{titlesec}

\newcommand\specialsection{%
\titleformat*{\section}{\centering\scshape\Large}
}
\newcommand\regularsection{%
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
}

\begin{document}

\specialsection
\section*{Introduction}

\regularsection
\section{A Test Section}
\section{Another Test Section}

\end{document}


-

You can use \section* to set an unnumbered section. However, this also removes it from the ToC. To reinsert it, use \addcontentsline{toc}{section}{<name>}, like in the following minimal example:

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\tableofcontents
\lipsum[1-10]
\section{Another section} \lipsum[11-20]
\section{Yet another section} \lipsum[21-30]
\end{document}


The same would hold for other document classes (like book and report).

lipsum was used to generate dummy text, Lorem Ipsum style.

-
The question is not only about suppressing the section numbering; the section formatting also has to be changed. –  Gonzalo Medina Jun 5 '12 at 14:50
@GonzaloMedina: "Formatting" may be ambiguously used here. Depending on the users, \section* "formats" \section differently. –  Werner Jun 5 '12 at 15:54
True, but if you look at the code snippet in the question, you'll see an attempt to center the title and a font change. –  Gonzalo Medina Jun 5 '12 at 15:57
@GonzaloMedina: Oh... –  Werner Jun 5 '12 at 15:58