3

I need to numerate the paragraphs of my document, divided by section, without the number of paragraph changed with the new defined by section, I hope that this example will better explain what I have just described. I am using lyx, any solution that can create that type of document is well accepted.

  1. First Section

    1 first paragraph

    2 second paragraph

  2. First Section

    3 third paragraph

    4 forth paragraph

I managed to write that code but the paragraph still reset its number, here is my try.

enter image description here

enter image description here

7
  • do you have subsections or by "paragraph" do you mean the next level of heading down from section? Feb 1, 2017 at 21:20
  • i mean that what i have inside the two sections (if it is a subsection it does not matter) must follow a common numbering as you can see from the example. Thank you. Feb 1, 2017 at 21:23
  • yes but the natural thing to do for the version shown would be to use \subsection for your paragraphs and define subsection not to be reset by \section. but if you have subsections that do reset and want the next level down not to reset then that would be subsubsection. Feb 1, 2017 at 21:27
  • Ok I understand, so is it possible to made what i want with subsection and subsubsection? Feb 1, 2017 at 21:33
  • sorry I really don't know lyx, (a lyx user can probably see your question and help) perhaps that code is inserted into a tex group (which would not work. you could put those lines into abc.sty and then tell lyx to use \usepackage{abc} i assume you can tell it which packages to load? Feb 1, 2017 at 22:30

1 Answer 1

4

enter image description here

\documentclass{article}

\usepackage{remreset}
\makeatletter
\@removefromreset{subsection}{section}
\renewcommand\thesubsection{\arabic{subsection}}
\makeatother

\begin{document}

\section{aaa}
\subsection{}
xxxx
\subsection{}
xxxx
\section{bbb}
\subsection{}
xxxx
\subsection{}
xxxx

\end{document}

or....

enter image description here

\documentclass{article}

\usepackage{enumitem}
\begin{document}

\section{aaa}

\begin{enumerate}
\item xxxx
\item xxxx
\end{enumerate}

\section{bbb}

\begin{enumerate}[resume]

\item xxxx
\item xxxx
\end{enumerate}

\end{document}
5
  • There's chngcntr that does it better.
    – egreg
    Feb 1, 2017 at 21:55
  • @egreg feel free to write a competing answer:-) Feb 1, 2017 at 22:07
  • ok but how can i manage to implement the first with lyx, i try with texcode but it does not work because i have the section numbered with the poin like 1.1, 1.2 and 2.1, 2.1. i would like to obtain section like 1,2,3,4 separted by 1 and 2 Feb 1, 2017 at 22:12
  • @GuidoMuscioni you need to get the lines that I put in the preamble into the preamble generated by lyx. i have no idea how to do that in lyx (I do not have the system installed) but I understand it has a way to insert tex code Feb 1, 2017 at 22:18
  • @DavidCarlisle I have edit the question, any advice? Feb 1, 2017 at 22:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .