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!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
"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}