1

I want to change the section labels so that, instead of writing something like '1 Section', I get 'Section 1'.

I want to keep the numbering.

How can this be done in Latex?

\renewcommand? section*{}? 

Something else?

ssinad
  • 11

2 Answers2

1

like this :

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}

\usepackage{etoolbox}
\usepackage[explicit]{titlesec}

\newcommand{\titcon}[1]
{
  \ifstrempty{#1}
  {}
  { -- #1}
}

\titleformat{\section}{\bfseries\Large}{Section \arabic{section} \titcon{#1}}{6pt}{}

\begin{document}

\section{Test 1}

\section{}

\end{document}

enter image description here

flav
  • 4,714
  • Could you please elaborate on your answer? What does titcon do exactly? – ssinad Feb 25 '16 at 15:46
  • In fact, in your case, titcon is not useful. It is useful when this argument of section is empty – flav Feb 25 '16 at 15:47
  • Also, it would be nice if you cleaned your answer and include the necessary parts and drop the rest. – ssinad Feb 25 '16 at 15:48
0

this :

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}

\usepackage{etoolbox}
\usepackage[explicit]{titlesec}

\titleformat{\section}{\bfseries\Large}{Section \arabic{section} #1}{6pt}{}

\begin{document}

\section{Test 1}

\section{}

\end{document}

enter image description here

flav
  • 4,714