[Markdown][typora]如何让markdown自动显示序号

2023-11-08

介绍

我们经常会遇到在写markdown的时候,需要显示标题。这个时候,通常大家的做法是手动添加标题,但是写到最后会发现要在添加一个之前的章节,结果后面的写好的都要跟着改,那markdown有没有办法自动显示标题呢?这边我搜索了相关博客,学习了一下。记录下来。

第一步

打开typora的外观里面的主题文件夹
在这里插入图片描述

第二步:

新建一个名为base.user.css的文件

第三步:

添加如下内容即可:
上边那部分是左边的标题栏,下面那部分是正文的标题

#write {
    counter-reset: h1
}

h1 {
    counter-reset: h2
}

h2 {
    counter-reset: h3
}

h3 {
    counter-reset: h4
}

h4 {
    counter-reset: h5
}

h5 {
    counter-reset: h6
}

#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 {
    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) " "
}

#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;
}

第四步:

看下效果:
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

[Markdown][typora]如何让markdown自动显示序号 的相关文章

随机推荐

  • mysql show table column_Mysql 常用show命令 show table-奇乐网

    Mysql 常用show命令 show tables或show tables from database name或show database name tables 解释 显示当前数据库中所有表的名称 show databases 解释
  • leetcode 535. Encode and Decode TinyURL(对URL编解码)

    Note This is a companion problem to the System Design problem Design TinyURL TinyURL is a URL shortening service where y
  • 搞懂一般的stacking和blending只需一张图片

    搞懂一般的stacking和blending只需一张图片 搞不懂我把这张图片的纸吃了 下面再简单参考一下其他博主的对于这两种集成方法的比较 Blending的优点在于 1 比stacking简单 因为不用进行k次的交叉验证来获得stacke
  • postgresql用sql语句查询表结构

    用到的postgresql系统表 关于postgresql系统表 可以参考PostgreSQL 8 1 中文文档 系统表 pg class 记录了数据库中的表 索引 序列 视图 关系 其中比较重要字段有 relname 表 索引 视图等的名
  • JsRPC生成某乎3.0版x-zse-96学习分析,网站:aHR0cHM6Ly93d3cuemhpaHUuY29tLw==

    一 jsrpc工具 用的是github上一位大神所写的工具 里面有写具体用法 https github com jxhczhl JsRpc 点进去下载安装包 下载本地版 https wss版本需要在当前目录放证书 下载后直接双击运行 开启服
  • Java 判断一个对象中某一个属性的值是否为空

    每次写博客都不知道咋开头 算了 直接说问题吧 就是验证一个对象中的一个属性的值是否为空 自己在网上也找到了很多大神给的答案 有看到利用反射机制 public boolean checkObjFieldIsNull Object obj th
  • react 获取response header中content-disposition中的filename值

    我们在开发中经常会碰到下载文件 后端将fileName放在response header中 我们该如何获取呢 首先是请求接口 注 getResponse true 这个属性必不可少 它可以返回返回 data response 其次是代码写法
  • 不识别v-on标签,不识别v-bind标签 idea 报错(Namespace 'v-on' not bound more....)

    解决办法 setting 里面去掉这个UNbound xml namespace prefix
  • python去掉字符串重复字符_【python】【字符串】字符串首尾相连,去掉连接处的重复...

    coding utf 8 字符串从反向拆词 def string depart str1 ls str1 str tmp for str t in reversed str1 str tmp str t str tmp ls str1 ap
  • 通信技术之复用与解复用

    想像一下 如果一条信道一次只能传输一条信息 那么对于海量的信息来说 传输的速度未免太慢了 因此 我们想要一根线上传送多路信号 复用技术就应运而生了 在上一篇博客中 我们知道了PCM编码的位数是8 抽样周期是1s 8000次 125us 在这
  • 机器学习——基本认识

    一 机器学习定义 机器学习 Machine Learning 什么是机器学习 Arthur Samuel 机器学习领域的先驱之一 他编写了世界上第一个棋类游戏的人工智能程序 1959年对机器学习的定义 Machine Learning is
  • Fiddler Everywhere(TTP调试抓包工具) for Mac苹果电脑版

    Fiddler Everywhere for Mac版是Mac电脑上的一款跨平台的HTTP调试抓包工具 Fiddler Everywhere for Mac能够记录客户端与服务器之间的所有HTTP S 通信 支持对包进行监视 分析 设置断点
  • 微信小程序——小程序的API介绍

    小程序的宿主环境 API 1 小程序API概述 小程序中的API是由宿主环境提供的 通过这些丰富的小程序API 开发者可以方便的调用微信提供的能力 例如 获取用户信息 本地存储 支付功能等 2 小程序API的3大分类 小程序官方把API分成
  • 用户行为记录的一个简单例子

    分析的前提 用户行为分析的前提是用户行为的记录 如下图则记录了三个用户的用户记录 设计用户记录 用户记录都包含哪些呢 用户记录对于数据分析非常重要 可以让程序员定位bug或者性能问题 产品可以查看用户体验 甚至是广告分析数据分析和用户增长模
  • 算法学习:55. 跳跃游戏

    跳跃游戏 题目难度 中等 给定一个非负整数数组 nums 你最初位于数组的 第一个下标 数组中的每个元素代表你在该位置可以跳跃的最大长度 判断你是否能够到达最后一个下标 示例 输入 nums 2 3 1 1 4 输出 true 解释 可以先
  • Iterm2设置

    Item2 1 安装item2 使用 homebrew 安装 item2 brew install item2 可以打开 item2了使用了 查看所有 shell cat etc shells 查看当前 shell echo SHELL 切
  • RK3568平台入门到精通系列讲解之开发环境搭建(依赖软件包)

    一 服务器平台信息 芯片平台 Intel至强E526xx系列x2 系统版本 ubuntu 14 04 18 04 22 04服务器版 内存 128GB 磁盘空间 256GB SSD 8TB HD 二 服务器系统安装 系统可以从官方下载 ht
  • 常用Linux网络/内存/磁盘分析工具

    Centos查看网卡 CPU 内存等使用率 watch more proc net dev 性能分析和监控工具 uptime dmesg tail vmstat 1 mpstat P ALL 1 pidstat 1 iostat xz 1
  • Freesync小白科普

    内容摘自AMD官网 AMD FreeSync 技术解释 FreeSync是一项 AMD 计划 它利用 DisplayPort Adaptive Sync 等行业标准为最终用户提供动态刷新率 与G sync一样 可以解决画面卡顿 撕裂问题 作
  • [Markdown][typora]如何让markdown自动显示序号

    介绍 我们经常会遇到在写markdown的时候 需要显示标题 这个时候 通常大家的做法是手动添加标题 但是写到最后会发现要在添加一个之前的章节 结果后面的写好的都要跟着改 那markdown有没有办法自动显示标题呢 这边我搜索了相关博客 学