typora自定义主题
暂时没有找到其他可以自定义主题的,支持首行缩进的其他本地编辑器,有一个在线的编辑器https://editor.mdnice.com/
做的也不错。
怎么破解typora自行搜索,我只能告诉你我用的是0.11.17
版
自定义主题的帮助文件
在typora的帮助
点custom themes
,就可以看到帮助文件,里面有一段描述:
Create & write a base.user.css
under theme folder, the css rules inside it will be applied to all themes.
这里的这个文件真的就叫 base.user.css
,用其他名字都无效,效果会应用在所有的主题中。
我自用的几个重要的css
/*正文*/
#write {
font-family: "华文仿宋";
}
/*标题1居中*/
#write h1 {
text-align: center;
column-span: all;
}
/*目录隐藏标题1*/
.md-toc-h1 {
display: none;
}
目前在 base.user.css
就添加了这几个,配合typora自带的主题已经可以满足我的使用需求了。
当然我也自建了一个主题,用于写报告,代码如下:
:root {
--base-font-size: 14pt; /*四号*/
--small-font-size: 10.5pt; /*五号*/
--big-font-size: 16pt; /*三号*/
--title-font-size: 22pt; /*二号*/
}
/*正文*/
#write {
font-family: "华文仿宋";
font-size: var(--base-font-size);
max-width: 21cm; /*A4大小*/
color: #000000;
}
/*标题*/
#write h1 {
text-align: center;
column-span: all;
font-size: var(--title-font-size);
font-family: "宋体";
}
#write h2 {
font-size: var(--base-font-size);
font-family: "黑体";
}
#write h3 {
font-size: var(--base-font-size);
font-family: "楷体";
}
#write h4 {
font-size: var(--base-font-size);
}
#write h5 {
font-size: var(--base-font-size);
}
#write h6 {
font-size: var(--base-font-size);
}
/*目录*/
.md-toc-content {
counter-reset: toc-h2 toc-h3 toc-h4; /* 显示三级标题 */
page-break-after: always;
font-size: var(--base-font-size);
}
.md-toc-inner {
color: var(--text-color);
}
/*隐藏标题1*/
.md-toc-h1 {
display: none;
}
/*表格*/
#write table {
border-top: 1.2pt solid;
border-bottom: 1.2pt solid;
text-align: center;
page-break-inside: avoid;
border-spacing: 6px;
font-size: var(--small-font-size);
font-family: "黑体";
}
/* 表格标题(首行)样式 */
#write thead {
border-bottom: 0.5pt solid;
font-weight: var(--strong-weight);
}
/*代码块*/
.md-fences {
font-family: "黑体";
font-size: var(--small-font-size);
border: 1px solid #000000;
}
最后还有一个提示
typora的分页代码是:
<div STYLE="page-break-after: always;"></div>
居右代码是:
<div align='right'>text</div>