I'm looking to have different 'styles' (not sure if this is the right word) for my section headers depending on whether they're listed in the TOC or the body. That's probably not clear, so let me demonstrate.

In the body, I'd like to see:

Article I. Intro
....
Article II. Methods
....


But in the TOC I'd like to see

I. Intro .......... 5
II. Methods ........10


without the "Article" bit.

Right now, I'm using this to set the section headers:

\renewcommand{\thesection}{Article \Roman{section}.}


I should mention I'm using the article class.

• Welcome to TeX.sx!. Have you considered using the report class for this? – Mario S. E. Apr 30 '13 at 0:24
• Don't change that command as you did. You can use another word to insert in the TOC. Just write \section[to appear in TOC]{to appear in the body}. – Sigur Apr 30 '13 at 0:33
• @Sigur I think what you're suggesting is \section[Intro]{Article I. Intro}. But then the TOC shows 1 Intro ... 5 but the body shows 1 Article I. Intro which is not what I want. I could use /section* but then I need to \addcontentsline all of the time. – EPK Apr 30 '13 at 0:40
• @MarioS.E. I'm unclear on how report would help. Doesn't this just add an extra chapter level? – EPK Apr 30 '13 at 0:45
• @user1591288 You can check the differences here: tex.stackexchange.com/questions/36988/… – Mario S. E. Apr 30 '13 at 0:47

The titlesec package was used to add "Article" before the section number and the dot after the number. The tocloft package was used to add the dot after the number in the table of contents entries and also to increase the space reserved for the number:

\documentclass{article}
\usepackage{titlesec}
\usepackage{tocloft}

\renewcommand\thesection{\Roman{section}}
\titleformat{\section}
{\normalfont\Large\bfseries}{Article~\thesection.}{1em}{}
\renewcommand\cftsecaftersnum{.}

\begin{document}

\tableofcontents
\section{Introduction}
\section{Methods}

\end{document}


• Thank you! Took a little debugging to get the spacing right, but this fixed my problem, and is really simple. – EPK Apr 30 '13 at 2:14

You could use the method described on p. 26f. of "The LaTeX Companion" to generate the following output:

\documentclass{article}
\renewcommand{\thesection}{\Roman{section}}
\makeatletter
%% The "\@seccntformat" command is an auxiliary command
%% (see pp. 26f. of 'The LaTeX Companion,' 2nd. ed.)
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
{\csname the#1\endcsname\ }%   default
{\csname #1@cntformat\endcsname}% enable individual control
}
%% Put everything together by defining the macros
%% '\...@seccntformat', where ... can be 'section',
%% 'subsection', etc.
\newcommand{\section@cntformat}{Article \thesection. }
\makeatother

\begin{document}
\tableofcontents
\section{Intro}
\section{Methods}
\end{document}



• You may also wish to update the ToC entries to print a period after the number. Most likely a redefinition of \numberline using a similar technique or otherwise. – Werner Apr 30 '13 at 1:42
• @Werner - I personally don't think it's good form to provide (unnecessary) periods. However, I'll provide a comment to show how one might add them to the ToC listing, if they're needed. – Mico Apr 30 '13 at 1:44
• Good advice. One could include it for completeness, and reference your own personal style. Whichever you prefer... – Werner Apr 30 '13 at 1:47