版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
第Typora自動(dòng)編號(hào)的具體操作在使用Typora寫比較長(zhǎng)的文章時(shí),需要給章節(jié)編號(hào),方便區(qū)分層次。如果手動(dòng)編號(hào),一旦章節(jié)順序改變,很多章節(jié)的編號(hào)都需要一一手動(dòng)修改,極其麻煩。
Typora官方提供了自動(dòng)編號(hào)的方法:https://support.typora.io/Auto-Numbering/。本文將對(duì)官方提供的方法,以及簡(jiǎn)單改進(jìn)進(jìn)行介紹。
這個(gè)方法的原理是,Typora基于瀏覽器開發(fā)(使用快捷鍵Shift+F12可以打開開發(fā)者工具)。因此,可以利用CSS實(shí)現(xiàn)自動(dòng)編號(hào)。
打開Typora-文件-偏好設(shè)置-外觀-打開主題文件夾。
在主題文件夾下新建文件base.user.css。
將https://support.typora.io/Auto-Numbering/中提供的三份代碼(分別實(shí)現(xiàn)文章內(nèi)容自動(dòng)編號(hào)、TOC自動(dòng)編號(hào)、側(cè)邊欄大綱自動(dòng)編號(hào))復(fù)制到base.user.css中。
重啟Typora。
官方提供的代碼會(huì)對(duì)一級(jí)標(biāo)題進(jìn)行編號(hào),但實(shí)際寫文章時(shí),一級(jí)標(biāo)題往往是文章標(biāo)題,無需編號(hào),因此,我對(duì)代碼進(jìn)行了簡(jiǎn)單修改。下面是修改后的代碼:
文章內(nèi)容自動(dòng)編號(hào):
/**initializecsscounter*/
counter-reset:h2
counter-reset:h3
counter-reset:h4
counter-reset:h5
counter-reset:h6
/**putcounterresultintoheadings*/
#writeh2:before{
counter-increment:h2;
content:counter(h2)"."
#writeh3:before,
h3.md-focus.md-heading:before/**overridethedefaultstyleforfocusedheadings*/{
counter-increment:h3;
content:counter(h2)"."counter(h3)"."
#writeh4:before,
h4.md-focus.md-heading:before{
counter-increment:h4;
content:counter(h2)"."counter(h3)"."counter(h4)"."
#writeh5:before,
h5.md-focus.md-heading:before{
counter-increment:h5;
content:counter(h2)"."counter(h3)"."counter(h4)"."counter(h5)"."
#writeh6:before,
h6.md-focus.md-heading:before{
counter-increment:h6;
content:counter(h2)"."counter(h3)"."counter(h4)"."counter(h5)"."counter(h6)"."
/**overridethedefaultstyleforfocusedheadings*/
#writeh3.md-focus:before,
#writeh4.md-focus:before,
#writeh5.md-focus:before,
#writeh6.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;
}
TOC自動(dòng)編號(hào):
/*NolinkunderlinesinTOC*/
.md-toc-inner{
text-decoration:none;
.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-h2:before{
color:black;
counter-increment:h2toc;
content:counter(h2toc)"."
.md-toc-h2.md-toc-inner{
margin-left:0;
.md-toc-h3:before{
color:black;
counter-increment:h3toc;
content:counter(h2toc)"."counter(h3toc)"."
.md-toc-h3.md-toc-inner{
margin-left:0;
.md-toc-h4:before{
color:black;
counter-increment:h4toc;
content: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(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(h2toc)"."counter(h3toc)"."counter(h4toc)"."counter(h5toc)"."counter(h6toc)"."
.md-toc-h6.md-toc-inner{
margin-left:0;
側(cè)邊欄大綱自動(dòng)編號(hào):
.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-h2.outline-item.outline-label:before{
counter-increment:h2;
content:counter(h2)"."
.outline-h3.outline-item.outline-label:before{
counter-increment:h3;
content:counter(h2)"."counter(h3)"."
.outline-h4.outline-item.outline-label:before{
counter-increment:h4;
content:counter(h2)"."counter(h3)"."counter(h4)"."
.outline-h5.outline-item.outline-label:before{
counter-increment:h5;
content:counter(h2)"."counter(h3)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 前端開發(fā)技術(shù)趨勢(shì)與應(yīng)用
- 2026年軟件系統(tǒng)崩潰應(yīng)急恢復(fù)操作測(cè)試題
- 2026年建筑設(shè)計(jì)師專業(yè)知識(shí)題綠色建筑與可持續(xù)發(fā)展實(shí)踐題
- 2026年中醫(yī)藥學(xué)基礎(chǔ)與臨床應(yīng)用中醫(yī)知識(shí)題庫(kù)
- 2026年網(wǎng)絡(luò)安全知識(shí)企業(yè)員工必修考核題
- 2026年職場(chǎng)能力提升專業(yè)知識(shí)測(cè)試題集
- 2026年智能語(yǔ)音助手功能測(cè)試題庫(kù)
- 2026年大數(shù)據(jù)項(xiàng)目管理專家面試預(yù)測(cè)模擬題
- 2026年電力工程L3工程師技能考核試題及答案詳解
- 2026年軟件測(cè)試工程師專業(yè)題庫(kù)鴻蒙系統(tǒng)測(cè)試技術(shù)要點(diǎn)
- 《電滲析與電除鹽》課件
- 施工合作協(xié)議書范文范本電子版下載
- 煙草物理檢驗(yàn)競(jìng)賽考試題庫(kù)及答案
- 人才技術(shù)入股公司股權(quán)分配協(xié)議書
- 招聘會(huì)會(huì)展服務(wù)投標(biāo)方案(技術(shù)標(biāo) )
- 高考英語(yǔ)3500單詞表(帶音標(biāo))(亂序版)默寫背誦通用版
- 馬超-水田省力化劑型的開發(fā)及應(yīng)用研究-
- 頭面部的神經(jīng)阻滯課件
- 友達(dá)光電(昆山)有限公司第一階段建設(shè)項(xiàng)目環(huán)?!叭瑫r(shí)”執(zhí)行情況報(bào)告
- 光學(xué)下擺拋光技術(shù)培訓(xùn)教材
- LY/T 2456-2015桉樹豐產(chǎn)林經(jīng)營(yíng)技術(shù)規(guī)程
評(píng)論
0/150
提交評(píng)論