3

I'm having troubles with sections number...Each section continues the numeration of the precedent one, although a new chapter has started.

here is a MWE

\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{remreset,siunitx,array,textgreek,booktabs,etoolbox,geometry}
\usepackage{graphicx,wrapfig,lscape,rotating,amsmath}
\geometry{letterpaper}
\sisetup{text-micro=\textmu}

\title{\Huge\textbf{Title}}
\author{di \textbf{Author}}
\date{date}

\makeatletter
  \renewcommand \thesection {\@arabic\c@section}
  \@removefromreset{section}{chapter}
\makeatother

\begin{document}
\maketitle 

\chapter*{C1}
\section{S1.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

\section{S1.2}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah   blah blah blah
\chapter*{C2}
\section{S2.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
\section{S2.2}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 

\chapter*{C3}
\section{S3.1}
blah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah 

How can I solve this problem?

Mengops
  • 571

2 Answers2

3

If all you want is to remove the “Chapter n” part, the workaround is very simple: just change \@makechapterhead not to produce it and the easiest way is to use the same command used when \chapter* is found.

\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{siunitx,array,textgreek,booktabs,etoolbox,geometry}
\usepackage{graphicx,wrapfig,lscape,rotating,amsmath}

\sisetup{text-micro=\textmu}

\makeatletter
\let\@makechapterhead\@makeschapterhead
\makeatother

\title{\Huge\textbf{Title}}
\author{di \textbf{Author}}
\date{date}

\begin{document}

\chapter{C1}
\section{S1.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

\section{S1.2}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah   blah blah blah
\chapter{C2}
\section{S2.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
\section{S2.2}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 

\chapter{C3}
\section{S3.1}
blah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah 

\end{document}

enter image description here

egreg
  • 1,121,712
2

Quick and dirty redefinition of \chapter* 'works', it resets the section counter within and uses the usual chapter* style anyway.

\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{remreset,siunitx,array,textgreek,booktabs,etoolbox}
\usepackage{geometry}
\usepackage{graphicx,wrapfig,lscape,rotating,amsmath}
\geometry{letterpaper}
\sisetup{text-micro=\textmu}

\title{\Huge\textbf{Title}}
\author{di \textbf{Author}}
\date{date}


\let\LaTeXStandardChapter\chapter

\makeatletter
\renewcommand{\chapter}{%
\@ifstar{\improvedstarredchapter}{\LaTeXStandardChapter}%
}%

\newcommand{\improvedstarredchapter}[1]{%
\setcounter{section}{0}%
\LaTeXStandardChapter*{#1}%
}%

\makeatother


\makeatletter
  \renewcommand \thesection {\@arabic\c@section}
\makeatother



\begin{document}
\maketitle 

\chapter*{C1}
\section{S1.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

\section{S1.2}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah   blah blah blah
\chapter*{C2}
\section{S2.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
\section{S2.2}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 

\chapter*{C3}
\section{S3.1}
blah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah 

\end{document}