TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

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

text text text
text text text

it will be displayed as

I.1 First
text text text

I.2 Second
text text text

How to get this?

share|improve this question
up vote 4 down vote accepted

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}%

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.

Left-aligned section; centred text

\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\renewcommand{\thechapter}{\Roman{chapter}}% Redefine chapter numbers
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
\chapter{A chapter}
\section{First section} \lipsum[1]
\section{Second section} \lipsum[2]
\section{Last section} \lipsum[3]

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

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.