Julien Rioux <jrioux <at> physics.utoronto.ca> writes:
> Something like this in Document > Settings > Preamble seems to do the trick.
> 
> \let\oldsection\section
> \renewcommand\section{%
> \addtocounter{section}{1}%
> \setcounter{subsection}{0}%
> \oldsection*}

Further exchanges with Kenedy revealed that there are some problems with the
above code if your document relies on both Section and Section*. So for those
searching for a similar question and finding this thread, here's the code that
worked for his document, to put in the preamble:

\let\oldsection\section
\renewcommand\section{%
\@ifstar\unnumberedsection\numberedsection}
\newcommand\numberedsection[1]{%
\addtocounter{section}{1}%
\setcounter{subsection}{0}%
\unnumberedsection{#1}}
\newcommand\unnumberedsection[1]{%
\oldsection*{\centering#1}}

(Kenedy also wanted his section titles to be centered. When this is not desired
simply remove \centering from the above)

--
Julien


Reply via email to