Generalnumbring in sections/subsection

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Jchen066
Posts: 13
Joined: Tue Aug 28, 2018 12:50 am

numbring in sections/subsection

Post by Jchen066 »

hi there,

Try to create something like the attachment.

1. The Section and subsection create the title with automatic numbering. How can I turn it off.
2. Is there a way to provide automatic numbering for the examples under each section. For example, the first example in first section will be automatically numbered as 1.1 after the wording "Example", and second example in the same section will be given 1.2. The numbering will continue as long as it within the section regardless which subsection they are. If it come to the second section, the example will start from 2.1, 2.2 etc

Thanks
sam
Attachments
section.PNG
section.PNG (140.19 KiB) Viewed 9365 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

numbring in sections/subsection

Post by Stefan Kottwitz »

Hi Sam!

You can turn off numbering by \setcounter{secnumdepth}{0}.

You can number examples per section automatically, however without a section number it's very strange. You get examples 2.1 and 2.2 but there's nothing ever that has a 2 as a reference. I would think about it again.

Stefan
LaTeX.org admin
Jchen066
Posts: 13
Joined: Tue Aug 28, 2018 12:50 am

numbring in sections/subsection

Post by Jchen066 »

Stefan Kottwitz wrote:Hi Sam!

You can turn off numbering by \setcounter{secnumdepth}{0}.

You can number examples per section automatically, however without a section number it's very strange. You get examples 2.1 and 2.2 but there's nothing ever that has a 2 as a reference. I would think about it again.

Stefan

Thanks for your advice.

It will be great if you can show me how to do the numbering for the examples. The numbering will be based the section and ranking of the example. And if I move the example around and the numbering will be updated automatically

Sam
Post Reply