仅供学习,转载请注明出处

打开文件 - 偏好设置 - 打开主题文件夹

设置css样式

创建一个空文件,命名为base.user.css

里面粘贴如下内容保存后重启Typora,输入标题时会自动出现序号。

/** initialize css counter */
#write {
counter-reset: h1
}
h1 {
counter-reset: h2
}
h2 {
counter-reset: h3
}
h3 {
counter-reset: h4
}
h4 {
counter-reset: h5
}
h5 {
counter-reset: h6
}
/** put counter result into headings */
#write h1:before {
counter-increment: h1;
content: counter(h1) ". "
}
#write h2:before {
counter-increment: h2;
content: counter(h1) "." counter(h2) ". "
}
#write h3:before,
h3.md-focus.md-heading:before /** override the default style for focused headings */ {
counter-increment: h3;
content: counter(h1) "." counter(h2) "." counter(h3) ". "
}
#write h4:before,
h4.md-focus.md-heading:before {
counter-increment: h4;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "
}
#write h5:before,
h5.md-focus.md-heading:before {
counter-increment: h5;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "}
#write h6:before,
h6.md-focus.md-heading:before {
counter-increment: h6;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ".
"}
/** override the default style for focused headings */
#write>h3.md-focus:before,
#write>h4.md-focus:before,
#write>h5.md-focus:before,
#write>h6.md-focus:before,
h3.md-focus:before,
h4.md-focus:before,
h5.md-focus:before,
h6.md-focus:before {
color: inherit;
border: inherit;
border-radius: inherit;
position: inherit;
left:initial;
float: none;
top:initial;
font-size: inherit;
padding-left: inherit;
padding-right: inherit;
vertical-align: inherit;
font-weight: inherit;
line-height: inherit;
}

效果如下:

另外,如果需要去除序号后面 . 号的版本

/** initialize css counter */
#write {
counter-reset: h1
}
h1 {
counter-reset: h2
}
h2 {
counter-reset: h3
}
h3 {
counter-reset: h4
}
h4 {
counter-reset: h5
}
h5 {
counter-reset: h6
}
/** put counter result into headings */
#write h1:before {
counter-increment: h1;
content: counter(h1) " "
}#write h2:before {
counter-increment: h2;
content: counter(h1) "." counter(h2) " "
}
#write h3:before,
h3.md-focus.md-heading:before /** override the default style for focused headings */ {
counter-increment: h3;
content: counter(h1) "." counter(h2) "." counter(h3) " "
}
#write h4:before,
h4.md-focus.md-heading:before {
counter-increment: h4;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " "
}
#write h5:before,
h5.md-focus.md-heading:before {
counter-increment: h5;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
}
#write h6:before,
h6.md-focus.md-heading:before {
counter-increment: h6;
content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
}
/** override the default style for focused headings */
#write>h3.md-focus:before,
#write>h4.md-focus:before,
#write>h5.md-focus:before,
#write>h6.md-focus:before,
h3.md-focus:before,
h4.md-focus:before,
h5.md-focus:before,
h6.md-focus:before {
color: inherit;
border: inherit;
border-radius: inherit;
position: inherit;
left:initial;
float: none;
top:initial;
font-size: inherit;
padding-left: inherit;
padding-right: inherit;
vertical-align: inherit;
font-weight: inherit;
line-height: inherit;
}

效果如下:

参考文献

Typora设置标题自动添加序号


2019年全套Java、Android、HTML5前端、Python、大数据视频,价值数万资源大放送

寻找资源的地址如下:

扫描微信公众号

寻找价值数万的视频资源

Typora设置标题自动添加序号相关推荐

  1. Typora设置标题自动标号

    Typora由于默认标题无法自动标号,每次编辑时需要手动处理.为实现标题自动编号,需要进行相关操作. 一 官方说明 To achieve this, add the following to your ...

  2. office2013中word设置标题自动编号

    摘要:word中标题不会自行编号,特别是涉及到H1.H2.H3等这种多级标题,如果修改一个父级标题,造成需要很长时间才能手动修改完成子标题编号.参照列表的模式,自行生成序号,则解决此问题. 一.设置w ...

  3. 【vscode 插件】为 markdown 文章标题自动添加多级序号

    在使用 markdown 进行写作的过程中,有时文章里子标题的级别较深,会导致在部分网站上渲染出来的字体太小,不同级别的标题之间的差别也很难区分,造成不舒服的阅读体验. 在几番搜索和尝试后,找到了这个 ...

  4. Typora 博文标题自动编号

    Typora 博文标题自动编号 1.Why? 1.1.Typora标题自动编号 修改 base.user.css 中的 css 代码可达到如下效果,看着还不错 1.2.博文效果 修改 base.use ...

  5. 计算机word如何插入新列表,电脑word文档中怎么给表格自动添加序号?怎么增加表目录...

    电脑word文档中怎么给表格自动添加序号?怎么增加表目录 腾讯视频/爱奇艺/优酷/外卖 充值4折起 我们看一篇word文件的时候,如果篇幅比较长而表格又比较多的话,一般会给这篇word设置一个表目录. ...

  6. typora markdown 标题自动编号

    typora markdown 标题自动编号 1.参考资料 https://blog.csdn.net/HackerTom/article/details/96640782 https://zhuan ...

  7. word2007设置标题自动编号

    2019独角兽企业重金招聘Python工程师标准>>> 如何在word2007设置标题自动编号?当多级标题过多时或文章过长时,word2007里的标题自动编号就显示很方便.这里就介绍 ...

  8. MarkDown标题自动添加编号

    转自:MarkDown标题自动添加编号 说明: 这是一个实现给本地 Markdown 文件添加标题编号的 python 脚本.可与 Markdown文件自动生成目录 搭配使用. 比如说你现在有一个 M ...

  9. html表格自动序号,word实用技巧:表格中自动添加序号

    大家在工作中,不免要用word做表格,但是序号一列,往往要用手一个一个的嵌入序列号,又麻烦,又浪费时间,还容易出错.那么下面就由学习啦小编给大家分享下word表格中自动添加序号的技巧,希望能帮助到您. ...

最新文章

  1. nohup 和后台运行符号
  2. Flash 最小化,帧速变慢的问题
  3. python enumerate用法总结_python enumerate用法总结
  4. java byte 转 c_C 和 Java 之间的byte数据的转换问题
  5. 我的矩阵分析学习安排
  6. 电脑如何录制正在播放的视频 这个方法太简单了
  7. 小程序源码:独立后台带分销功能月老办事处交友盲盒-多玩法安装简单
  8. 新浪微博产品分析报告
  9. 记一次前端优化首屏加载
  10. 计算机CPU四大体系架构
  11. 图benchmark
  12. 金彩教育:店铺运营怎么看数据
  13. xxl-job 带参数执行和高可用部署
  14. 制造业OEER语言数据挖掘之人工神经网络探索
  15. android 框架搭建养成的良好习惯(一)
  16. 软件工程小项目~企业员工信息管理系统-需求分析~~
  17. Java面试题全集(上)-基础知识
  18. 解决表格的Drag a column header here to group by that column
  19. 绿之韵传销是空穴来风,一心一意为健康事业奋斗
  20. 西安到底需不需要互联网?

热门文章

  1. 认清电脑配件保修规定 不吃哑巴亏!
  2. 电脑城奸商最怕顾客知道的十条经验
  3. 做3D建模月薪平均多少?
  4. 新ipad 充电测试软件,ipad怎么充电 如何正确给ipad充电【详细介绍】
  5. 基于HTML+CSS实现的静态的电影网站【100010106】
  6. 什么是 信息系统工程监理
  7. JavaScript表单验证及注册界面
  8. css图片加内阴影不显示,css中实现图片阴影
  9. 如何用java取得汉字内码_如何用java随机生成一个汉字?
  10. 集合中所有子集元素之和