# Put the text of each section inside an environment

I want to put each section's content inside a center environment, that means when I write the code

\section{First}
texts\dots
text text text
\section{Second}
texts\dots
text text text


it will be displayed as

I.1 First
texts...
text text text

I.2 Second
texts...
text text text


How to get this?

-

I would think the easiest way to do this would be to redefine the \section command. It's original definition from book.cls (by seeing your section numbering) is

\newcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}


By adding \raggedright to the font selection, the section formatting will be localized, and we can set the entire document using \centering for a centred alignment.

\documentclass{book}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\makeatletter
\renewcommand{\thechapter}{\Roman{chapter}}% Redefine chapter numbers
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\raggedright\normalfont\Large\bfseries}}
\makeatother
\begin{document}
\centering
\chapter{A chapter}
\section{First section} \lipsum[1]
\section{Second section} \lipsum[2]
\section{Last section} \lipsum[3]
\end{document}


lipsum was used to produce dummy text, lorem ipsum style.

-