tags:

views:

273

answers:

3

I am using the article class with the code:

\documentclass[12pt]{article}

\begin{document}
\section{Foo}
This is an example of foo.
\section{Bar}
This is an example of bar.
\end{document}

This produces:

1 Foo

2 Bar

What I want is a period after the section number:

  1. Foo

  2. Bar

I cannot change away from the article class. How would I accomplish this?

A: 

Not sure, since I have still no latex in my, reformatted, pc but it should be something like:

\def\thesection {\arabic{section}.}

You should put it in preamble of document. Absolutely not sure about correctness (no way to try it now).

Jack
Nope, this adds the period after a \ref{} as well.
Will Robertson
+1  A: 
\renewcommand{\thesection}{\arabic{section}.}
Alex Brasetvik
You do **NOT** want to do this! Definitely not the right answer: `\documentclass{article} \begin{document} \renewcommand\thesection{\arabic{section}.} \section{foo}\label{foo} this is section~\ref{foo}.\end{document}`
Will Robertson
it worked, kind of. I wrote another line of code to remove the "." from the subsection command. Using just this line of code with the subsection command got me 2..1 Bar. I changed it though. it's hacky, but it worked.
Mica
+5  A: 

Use the titlesec package and put in the preamble:

\titlelabel{\thetitle.\quad}
Cirno de Bergerac
This is the right way to do it. I highly recommend titlesec.
Will Robertson