typora设置标题自动编号

  • 1、特性:
  • 2、效果预览
  • 3、配置说明
  • 4、按照Typora官网操作
    • 4.1、Auto-Numbering in TOC
    • 4.2、Auto-Numbering Outline panel

1、特性:

  • 内容标题自动编号
  • TOC 自动编号
  • 侧边栏目录导航自动编号

2、效果预览

配置前


配置后:

3、配置说明

1、打开 typora 的主题目录


2、将仓库中的 base.user.cssgithub.user.css 两个文件都拷贝到主题目录中

3、配置完成,重启 typora 文档内容标题就会有自动编号了。

参考:https://github.com/lipengzhou/typora-theme-auto-numbering

按照上述操作后发现结果如下,看不到左侧的导航栏了,其实是因为typora新版本的原因,在左下角有一个小圆圈,使用来控制显示与隐藏导航栏的,点一下就可以了。

4、按照Typora官网操作

About Themes
Auto Numbering for Headings


To achieve this, add the following to your base.user.css or [theme].user.css in the theme folder.

/** 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;
}

4.1、Auto-Numbering in TOC

If you want TOC entities to be displayed auto-numbered, you could try http://pastebin.com/NYugSbXk posted by a Typora user.

4.2、Auto-Numbering Outline panel

To show auto-numbering in Typora’s Outline panel, disable the collapsable outline panel in the preferences panel and then try https://pastebin.com/XmYgBbaz.

两个链接的内容分别是:

/*************************************** Header Counters in TOC**************************************//* No link underlines in TOC */
.md-toc-inner {text-decoration: none;
}.md-toc-content {counter-reset: h1toc
}.md-toc-h1 {margin-left: 0;font-size: 1.5rem;counter-reset: h2toc
}.md-toc-h2 {font-size: 1.1rem;margin-left: 2rem;counter-reset: h3toc
}.md-toc-h3 {margin-left: 3rem;font-size: .9rem;counter-reset: h4toc
}.md-toc-h4 {margin-left: 4rem;font-size: .85rem;counter-reset: h5toc
}.md-toc-h5 {margin-left: 5rem;font-size: .8rem;counter-reset: h6toc
}.md-toc-h6 {margin-left: 6rem;font-size: .75rem;
}.md-toc-h1:before {color: black;counter-increment: h1toc;content: counter(h1toc) ". "
}.md-toc-h1 .md-toc-inner {margin-left: 0;
}.md-toc-h2:before {color: black;counter-increment: h2toc;content: counter(h1toc) ". " counter(h2toc) ". "
}.md-toc-h2 .md-toc-inner {margin-left: 0;
}.md-toc-h3:before {color: black;counter-increment: h3toc;content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". "
}.md-toc-h3 .md-toc-inner {margin-left: 0;
}.md-toc-h4:before {color: black;counter-increment: h4toc;content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". "
}.md-toc-h4 .md-toc-inner {margin-left: 0;
}.md-toc-h5:before {color: black;counter-increment: h5toc;content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". " counter(h5toc) ". "
}.md-toc-h5 .md-toc-inner {margin-left: 0;
}.md-toc-h6:before {color: black;counter-increment: h6toc;content: counter(h1toc) ". " counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". " counter(h5toc) ". " counter(h6toc) ". "
}.md-toc-h6 .md-toc-inner {margin-left: 0;
}/*************************************** Header Counters in Content**************************************//** 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;
}
.sidebar-content {counter-reset: h1
}.outline-h1 {counter-reset: h2
}.outline-h2 {counter-reset: h3
}.outline-h3 {counter-reset: h4
}.outline-h4 {counter-reset: h5
}.outline-h5 {counter-reset: h6
}.outline-h1>.outline-item>.outline-label:before {counter-increment: h1;content: counter(h1) ". "
}.outline-h2>.outline-item>.outline-label:before {counter-increment: h2;content: counter(h1) "." counter(h2) ". "
}.outline-h3>.outline-item>.outline-label:before {counter-increment: h3;content: counter(h1) "." counter(h2) "." counter(h3) ". "
}.outline-h4>.outline-item>.outline-label:before {counter-increment: h4;content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "
}.outline-h5>.outline-item>.outline-label:before {counter-increment: h5;content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
}.outline-h6>.outline-item>.outline-label:before {counter-increment: h6;content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "
}

typora设置标题自动编号相关推荐

  1. Typora设置标题自动标号

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

  2. Typora 博文标题自动编号

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

  3. typora markdown 标题自动编号

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

  4. Typora设置标题自动添加序号

    仅供学习,转载请注明出处 打开文件 - 偏好设置 - 打开主题文件夹 设置css样式 创建一个空文件,命名为base.user.css. 里面粘贴如下内容保存后重启Typora,输入标题时会自动出现序 ...

  5. word2007设置标题自动编号

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

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

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

  7. word中设置多级标题,标题自动编号

      word二级标题自动编号,本来应该是2.1,可是却变成1.3,怎么办?设置三个标题差不多够用了,因此,这里以三个标题为例,首先在样式里设置三个样式,可以命名为Title1,Title2,及Titl ...

  8. Word章节标题及图表的自动编号及引用简记(含设置完标题自动编号之后的标题格式调整)

    Word标题及图表的自动编号及引用 最近需要给文章排版,做一简记. Word标题的自动编号 主要参考一百度文库文章: https://wenku.baidu.com/view/2557d6023c1e ...

  9. word 标题自动编号、按章节给图片设置题注、给图片添加对应的文字交叉引用

    论文标题自动编号.按章节给图片设置题注.给图片添加对应的文字交叉引用 1.准备环节及工作环境 2.多级列表 2.1 定义新的多级列表 2.2 修改标题格式 3.按章节给图片编号 3.1 插入题注 3. ...

  10. win10系统word2019给标题设置添加设置自定义自动编号的方法

    描述:win10系统word2019给标题设置添加自动编号的方法 步骤: 打开word->菜单栏->标题1->修改 选择格式->编号 选中编号->点击确定->确定 ...

最新文章

  1. 【普及组模拟赛】游戏
  2. 【Linux】一步一步学Linux——man命令(有问题找男人)(13)
  3. 明源云创CI/CD技术演进
  4. tcp长连接和短连接的区别_TCP --- 连接
  5. exit(0)和exit(1)解释
  6. Gradient Boosting Decision Tree学习
  7. 几何画板200个经典课件_2020国学起名:7部国学经典,200个大气独特的好名字
  8. 黄金三月,技术自检 | 作为测试人必备的10项 Linux 技能
  9. 字节跳动教育部分开始裁员,N+2赔付...一大波读者失业
  10. react 实现图片正在加载中 加载完成 加载失败三个阶段的
  11. 迈高图手机版_迈高图(地图数据下载器 ) V2.10.1.0 官方版-完美软件下载
  12. python如何设置画布开始位置_Python用Turtle绘图,原来如此简单
  13. 举办计算机知识竞赛的意义,计算机专业成功举办“计算机基础知识竞赛”
  14. 使用Blynk打造一款物联网产品
  15. ROS-ubuntu-系统安装
  16. [数据科学]000.我为什么当数据科学家
  17. 数学建模三大类模型适用场景及建模方法(纯干货)
  18. 小龙虾炒菜机器人_开挖掘机炒小龙虾?机器人餐厅?吃饭竟也能如此炫酷!
  19. 爬楼梯--每次只能走一步或者两步,但是不能连续走两步
  20. TopCoder Arena 插件配置(1)Greed 2.0

热门文章

  1. 企业微信开发实战:自建审批流引擎
  2. 小米笔记本linux指纹,小米笔记本Air 13.3寸指纹版(128GB)如何bios设置u盘启动
  3. 80386 CPU资源
  4. 关于混合app 开发框架Ionic
  5. python怎么填充背景颜色,python通过pil为png图片填充上背景颜色的方法
  6. Echarts 配置渐变
  7. STM32的端口复用功能RCC_APB2Periph_AFIO
  8. 遇到数学公式中不认识的符号怎么办
  9. 蓝桥杯 java 时间显示
  10. 虚拟机win7装oracle,大神教你win7系统安装Oracle VM VirtualBox虚拟机的处理教程