william007
william007

Reputation: 18543

Is it possible to have subsection like 1.1 in markdown

Markdown will help auto-enumerating the number, for example if I type

1. this is one
   1. this is inner1
   1. this is inner2
1. this is two

It will be shown as

  1. this is one
    1. this is inner1
    2. this is inner2
  2. this is two

Now is it possible to make subsections 1.1, 1.2 etc. using auto-enumerating feature of markdown as follows?

  1. this is one

    1.1 this is inner1

    1.2 this is inner2

  2. this is two

Upvotes: 2

Views: 12978

Answers (3)

Michel Boucey
Michel Boucey

Reputation: 1

Or try dumber to (un)numbering Mardown sections, and add/remove Table(s) of Content. The given ReadMe gives usage of this cli tool.

Upvotes: 0

唐志娟
唐志娟

Reputation: 11

 **Table of Content:**
   <ul>
      <li><a href="#1-animals">1. Animals</a>
        <ul>
          <li><a href="#11-mammals">1.1 Mammals</a>
            <ul>
              <li><a href="#111-terrestrial-mammals">1.1.1 Terrestrial Mammals</a></li>
              <li><a href="#112-marine-mammals">1.1.2 Marine Mammals</a></li>
            </ul>
          </li>
          <li><a href="#12-whales">1.2 Whales</a></li>      
        </ul>
      </li>
    </ul>
    

<!-- Your content goes here -->
<h1 id="animals">1. Animals</h1>
<!-- ... -->
<h2 id="mammals">1.1 Mammals</h2>
<!-- ... -->
<h3 id="terrestrial-mammals">1.1.1 Terrestrial Mammals</h3>
<!-- ... -->
<h3 id="marine-mammals">1.1.2 Marine Mammals</h3>
<!-- ... -->
<h2 id="whales">1.2 Whales</h2>
<!-- ... -->

Preview:

enter image description here

Upvotes: 0

Matt Conflitti
Matt Conflitti

Reputation: 41

This is possible with RMarkdown through a config setting:

Automatically number sections in RMarkdown

It looks like you may not be able to with vanilla Markdown, but there are tools to help:

Are numbered headings in Markdown / Rdiscount possible?

Upvotes: 1

Related Questions