Markdown编辑器Typora标题自动编号

2023-11-15

Typora标题自动编号

Typora官方说明

正文中的各级标题自动编号

  1. 来到Typora的主题文件夹: 打开Typora界面,点击左上角文件偏好设置外观打开主题文件夹

  2. 添加一个名为base.user.css的文件,用记事本就可。复制以下内容到文件内。

/** 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;
}
  1. 保存文件,重启Typora即可。

目录的标题自动编号

  1. Typora 生成目录:在第一行输入[toc],然后回车即可
  2. 在上述的base.user.css文件中粘贴一下内容:
/**************************************
 * 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;
}
  1. 保存文件,重启Typora即可。

左侧大纲栏的标题自动编号

  1. 在上述的base.user.css文件中粘贴一下内容:
.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) ". "
}
  1. 保存文件,重启Typora即可。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Markdown编辑器Typora标题自动编号 的相关文章

随机推荐

  • alter table语法

    文档地址 http docs oracle com cd B19306 01 server 102 b14200 statements 3001 htm CIHCFDDJ ALTER TABLE Purpose Use the ALTER
  • shell脚本中的多行注释

    shell 中注释的使用方法 1 单行注释 单行注释最为常见 它是通过一个 来实现的 注意shell脚本的最开始部分 bin bash 的 号不是用来注释的 2 多行注释 在shell脚本中还有一种多行的注释方法 我们称之为 HERE DO
  • 机器视觉毕业设计 深度学习人体跌倒检测系统 - opencv python

    文章目录 0 前言 课题背景和意义 1 实现方法 传统机器视觉算法 基于机器学习的跌倒检测 SVM简介 SVM跌倒检测原理 算法流程 算法效果 深度学习跌倒检测 最终效果 网络原理 最后 0 前言 这两年开始毕业设计和毕业答辩的要求和难度不
  • 解决:报错cv2.error: OpenCV(4.1.2) error: (-215:Assertion failed) !_img.empty() in function ‘cv::imwrite‘

    cv2 error OpenCV 4 1 2 C projects opencv python opencv modules imgcodecs src l oadsave cpp 715 error 215 Assertion faile
  • 常见线性滤波(第一篇博客)

    一 基本概念了解 1 什么是图像滤波 官方解释 图像滤波 即在尽量保留图像细节特征的条件下对目标图像的噪声进行抑制 是图像预处理中不可缺少的操作 其处理效果的好坏将直接影响到后续图像处理和分析的有效性和可靠性 个人理解 为图像滤波是通过设计
  • Kubernetes 101,第二部分,pod

    在上一篇文章中 我们了解了Kubernetes 的基础知识以及对其主要架构的介绍 介绍完毕后 就该探索如何在 Kubernetes 中运行应用程序了 容器包装器 在 Kubernetes 中 我们无法直接创建单个容器 相反 为了更好 我们可
  • 加工中心G76,G87,G83,G84数控代码讲解

    G76表示精密镗孔循环 具体使用格式如下面 G76 X Y Z R Q F
  • Linux Shell脚本字符串变量拼接与赋值总结

    Linux Shell脚本字符串总结 1 字符串拼接 2 定义值为双引号或单引号的字符串 3 在单引号和双引号字符串中取变量值 最近在工作用到shell脚本 用到了字符串变量的拼接 同时需要对字符串进行赋值 这里与大家分享一下 1 字符串拼
  • Android进阶知识树——应用进程的启动过程

    程序的启动是从进程启动开始的 换句话说只有程序进程启动后 程序才会加载和执行 在AMS启动程序时首先会判断当前进程是否启动 对未启动的进程会发送请求 Zygote在收到请求后创建新的进程 1 Zygote监听客户端请求 由Android进阶
  • 猿创征文|Java开发工具,从环境到开发,一篇管够!

    文章目录 一 文章背景 二 环境 开发工具 1 安装Docker 2 配置 Docker 阿里镜像加速器 3 使用docker运行Mysql 8 4 使用Docker运行Redis 5 数据库管理工具 6 接口测试工具 7 代码版本管理工具
  • Unity触控——单指、双指、Windows大屏多人触控

    前段时间做了个Windows系统的大屏触控程序 最多同时支持十点触控 并且在各自的小窗口中要分别处理 即每个小窗口中的触点为一个处理组 判断其单点或多点操作 按以往移动端程序的触屏事件Input GetTouch int index 不满足
  • 如何优雅做好项目管理?

    导言 项目本身无好坏之分 项目管理有做好与做坏之别 在互联网大厂的体制下 想要做坏一个项目很难 可以通过换人 追加资源等方式消除风险 想要做好一个项目不容易 需要团队及PM付出大量心血和精力 在这些做好的项目中 我们也观察到很多PM做的疲惫
  • TVM编译pytorch模型

    编译PyTorch模型 加载预训练的PyTorch模型 加载测试图像 将图形导入到Relay 构建Relay 在TVM上执行可移植图形 查找同义词集名称 本文是介绍如何使用Relay部署PyTorch模型的入门教程 首先 应该安装PyTor
  • 全国计算机等级考试题库二级C操作题100套(第62套)

    第62套 给定程序中 函数fun的功能是 把形参s所指字符串中下标为奇数的字符右移到下一个奇数位置 最右边被移出字符串的字符绕回放到第一个奇数位置 下标为偶数的字符不动 注 字符串的长度大于等于2 例如 形参s所指的字符串为 abcdefg
  • [hihoCoder] 压缩字符串 解题报告

    时间限制 10000ms 单点时限 1000ms 内存限制 256MB 描述 小Hi希望压缩一个
  • 牛客网校招风暴周算法题-回文数列

    题目要求 任意输入一个整数字符串 可以使任意相邻的两个数相加来构造回文数列 要求输入任意的整数数列 然后输出使它们相加次数最少得到的回文 数列 43 36 54 36 例如 输入 1 3 9 7 2 2 1 1输出 2 实例解析 为了得到回
  • 新iPad中国发售风光不在的十大原因

    曾经的苹果新品发售现场 人头攒动 争先恐后 可谓风光无限 然而 最近的New iPad在中国上市 却显得略微冷清 风光不在 虽没到 门前冷落鞍马稀 的地步 但至少很难用 异常火爆 之类的词汇来形容了 究竟是什么原因造成新iPad在中国发售风
  • linux每天定时刻重启 & Vim搜索高亮取消

    一 linux每天定时刻重启 vim etc crontab 即为每天上午8 30重启 二 Vim搜索及高亮取消
  • uni-app开发微信小程序的简要流程

    uni app开发微信小程序 开发uni app的技术条件就是微信小程序及Vue 不熟悉vue的同学要先学习了解一下 不熟悉小程序可以直接看uni文档 https uniapp dcloud io frame 其他博客 vue elemen
  • Markdown编辑器Typora标题自动编号

    Typora标题自动编号 Typora官方说明 正文中的各级标题自动编号 来到Typora的主题文件夹 打开Typora界面 点击左上角文件 偏好设置 外观 打开主题文件夹 添加一个名为base user css的文件 用记事本就可 复制以