yfzhao20 / Typora-markdown

试验性的存储库,用于存放Typora折腾过的css样式和其他

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

没有一级标题时,二级标题编号无法正常编号

Shawn-Guo-CN opened this issue · comments

下面这段源代码,编译出的结果,所有二级标题的编号都是1。

## Task Description
- Good Points:
   1. Your task description is good.
- Bad points:
   1. You may need explain why the problem is modelled as a (binary)/(trinary) classification problem.
   2. But you could have done a better job at motivating the project for this particular dataset.

## Motivation of the Project/Dataset

- Good Points:
  1. You motivate the task, sentiment analysis, quite well.
  2. You mention the significance of this task.

- Bad Points:
  1. You may want to motivate the task, sentiment analysis, itself.
  2. You barely explain why to analyse this dataset in the first place.

如果插入一级标题之后,就能正确编号。

确实,这是一个老问题。而且如果直接开始使用三级标题,会发现第一位数字变成了0。

目前暂时没有找到更好的解决方法,可以添加一个空的一级标题试试。

会在进一步学习css之后试着改进它。

但是会引入新的问题:如果一级标题和二级标题都没有,那么还是会乱😂

但是会引入新的问题:如果一级标题和二级标题都没有,那么还是会乱😂

重置计数器的时候应该把比它级别小的标题的计数器都重置一次吧,这样逻辑好像更完整一些,当时没有考虑到。

h1 {
    counter-reset: h2 0 h3 0 h4 0 h5 0 h6 0
}

h2 {
    counter-reset: h3 0 h4 0 h5 0 h6 0
}

h3 {
    counter-reset: h4 0 h5 0 h6 0
}

h4 {
    counter-reset: h5 0 h6 0
}

h5 {
    counter-reset: h6 0
}

不知道你描述的是不是这个问题。

不过可能并非是这个问题……上面那个通过全局reset已经做到了,要说的是下面这个:

image

这是因为没有一级标题时,二级标题还能从头编号;但是如果连二级标题都没有,那么前面的二级标题号永远都是0,所以前面一直有一个0.

似乎除非css有if语法,否则不太好解决……但是似乎没有人上来就用三级标题吧😂

不过可能并非是这个问题……上面那个通过全局reset已经做到了,要说的是下面这个:

image

这是因为没有一级标题时,二级标题还能从头编号;但是如果连二级标题都没有,那么前面的二级标题号永远都是0,所以前面一直有一个0.

似乎除非css有if语法,否则不太好解决……但是似乎没有人上来就用三级标题吧😂

可能是我自己的使用场景问题吧,我经常把md用来做快速笔记,不会按照一二三级的顺序写标题。

使用二级或者三级标题是因为,标题字体本身不会特别大,对于正文没有特别突出。