Hello all!
I was wondering if anybody know how to change to way sections/subsections etc. are being numbered. I would like to make LaTeX format, say, "\section{Stuff}" into "Stuff 1" instead of "1 Stuff".
Thank you!
Page Layout ⇒ "Section 1" instead of "1 Section"
"Section 1" instead of "1 Section"
You could have a look at the titlesec package, you are able to change the label format, but I guess with this package you won´t be able to change the order between label (2.1 for example) and title.


"Section 1" instead of "1 Section"
Using titlesec (as suggested by corderin) does allow to achieve the desired result. Take a look at the following example:
Remark: use with caution; this solution is highly volatile 
Code: Select all
\documentclass{book}
\usepackage[nobottomtitles*]{titlesec}
\usepackage{ifthen}
\usepackage{lipsum}% just to generate some text
\titleformat{\section}[runin]
{\normalfont\Large\bfseries}
{}{0pt}{}%
[\ifthenelse{\equal{\thesection}{0}}{\\\vspace*{0pt}}{\space\thesection\\}]
\titlespacing{\section}
{0pt}{*2}{0pt}
\begin{document}
\tableofcontents
\chapter{Dummy chapter}
\section{A test section}
\lipsum[1-2]
\section{Another test section}
\lipsum[1-2]
\end{document}

1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: "Section 1" instead of "1 Section"
Thank you so much for the example, gmedina. This is just what I've been looking for!
Re: "Section 1" instead of "1 Section"
The only problem I have found with this wonderful code of gmedina are the TOC entries, I have been trying to get the same line as for the section titles using the titletoc package, but it seems a bit difficult.
Maybe gmedina can achieve solve that matter too!
With titletoc you can put some code after the TOC entry, but I have seen it puts this code just rigth after the whole entry, this is, after the page...
Maybe gmedina can achieve solve that matter too!
With titletoc you can put some code after the TOC entry, but I have seen it puts this code just rigth after the whole entry, this is, after the page...

"Section 1" instead of "1 Section"
A possible solution using titletoc:corderin wrote:The only problem I have found with this wonderful code of gmedina are the TOC entries, I have been trying to get the same line as for the section titles using the titletoc package, but it seems a bit difficult.
Maybe gmedina can achieve solve that matter too!...
Code: Select all
\documentclass{book}
\usepackage[nobottomtitles*]{titlesec}
\usepackage{titletoc}
\usepackage{ifthen}
\usepackage{lipsum}% just to generate some text
\titleformat{\section}[runin]
{\normalfont\Large\bfseries}
{}{0pt}{}%
[\ifthenelse{\equal{\thesection}{0}}{\\\vspace*{0pt}}{\space\thesection\\}]
\titlespacing{\section}
{0pt}{*2}{0pt}
\titlecontents{section}
[1.5em]
{}{}
{\hspace*{-2.3em}}
{\space\contentslabel{0pt}\hfill\contentspage}
\begin{document}
\tableofcontents
\chapter{Dummy chapter}
\section{A test section}
\lipsum[1-4]
\section{Another test section}
\lipsum[1-2]
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
"Section 1" instead of "1 Section"
Gmedina I have been a time trying to solve this and I couldn´t, the result is achieved, and modifiying the last line as follows you get the separation dots between title and page in the TOC!
Code: Select all
\titlecontents{section}
[1.5em]
{}{}
{\hspace*{-2.3em}}
{\space\contentslabel{0pt}\titlerule*[1pc]{.}\contentspage}