Text FormattingCentering a section of text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Centering a section of text

Post by thedoctor818 »

I am trying to center a section of text. I have successfully done this earlier in my text using the following:

\begin{center}
\section*{text}
\end{center}

The prob is that when I try to apply this successively, later on in the same text using the same method, it fails. I get the following error: Somethings wrong - perhaps a missing \item.

Any help would be appreciated, as I am fairly new at using tex.
-Michael D

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Centering a section of text

Post by Stefan Kottwitz »

Hi,

I would not use a center environment around \section. Have a look at this topic, your problem was discussed there. Try \centering, concerning centered section titles have a look at the titlesec example further in that topic.

Stefan
LaTeX.org admin
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Re: Centering a section of text

Post by thedoctor818 »

Thanks, Stefan that did the job. Thanks so much!!!

-Michael
-Michael D
Post Reply