Page Layout ⇒ "Section 1" instead of "1 Section"
"Section 1" instead of "1 Section"
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!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
"Section 1" instead of "1 Section"

"Section 1" instead of "1 Section"
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}

Re: "Section 1" instead of "1 Section"
Re: "Section 1" instead of "1 Section"
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}
"Section 1" instead of "1 Section"
Code: Select all
\titlecontents{section}
[1.5em]
{}{}
{\hspace*{-2.3em}}
{\space\contentslabel{0pt}\titlerule*[1pc]{.}\contentspage}