0%

参考资料

简介以及基本用法

请参考 以 Markdown 撰写文稿,以 LaTeX 排版

最小实例

1
2
3
4
5
6
7
8
9
10
11
\documentclass{ctexart}
\usepackage{markdown}
\begin{document}
\begin{markdown}

1.markdown内容顶格写
2.空行检查是否有多余的Tab缩进
3.请使用PowerShell进行编译,无法在TexStudio中的运行进行编译

\end{markdown}
\end{document}

markdown2latex.gif

注意事项

  1. 在含有 tex 源文件的目录下使用 Powershell 对如下命令进行编译
1
xelatex --shell-escape texname.tex
  1. 使用 markdown 宏包之后,需要在 markdown 环境中书写 markdown 内容
  2. markdown 内容做到左侧无缩进(靠左侧顶格写)
  3. 同其他普通的 tex 文档一样,可以使用定制样式的文档类或宏包

比如可以使用我们喜欢的文档类,只要将相应的 cls 文件复制到同一目录下,在导言区引用即可

1
\documentclass[cn,normal,11pt,blue]{elegantnote}

可能会出现的问题

  1. 二级列表也顶格写的话就会变成一级列表

解决办法:在二级列表的前面添加四个空格,而不是增加一个 tab 键

  1. Markdown 中含有繁体中文时,输出的 PDF 中繁体中文显示会有问题
  2. 网页中带有中文字符等特殊符号时,会自动转义导致网页链接出错

解决办法:使用短链接,比如 Github:shorter,或者 Github:short_url

  1. 图片大小渲染问题,请参考:以 Markdown 撰写文稿,以 LaTeX 排版

参考资料

  1. Github:Elegantbook
  2. LaTeX 工作室:浮动体环境内部内容居中的设置方法
  3. LaTeX 工作室:Elegentbook 魔改版

Tex

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
\documentclass{ctexart}
% ====目录章节设置 ====
\usepackage[center,pagestyles]{titlesec}
\usepackage{apptools}
\usepackage[toc,page,title,titletoc]{appendix}
\setcounter{secnumdepth}{5}
% ++++ 章节标题格式设置 ++++
\titleformat{\section}[hang]{\bfseries}{
\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{%
\color{structurecolor}\Large\bfseries\filright}
\titleformat{\subsection}[hang]{\bfseries}{
\large\bfseries\color{structurecolor}\thesubsection\enspace}{1pt}{%
\color{structurecolor}\large\bfseries\filright}
\titleformat{\subsubsection}[hang]{\bfseries}{
\large\bfseries\color{structurecolor}\thesubsubsection\enspace}{1pt}{%
\color{structurecolor}\large\bfseries\filright}
% ====常用宏包====
\RequirePackage{makecell,lipsum,hologo,setspace}
\RequirePackage{booktabs}
\RequirePackage{multicol,multirow}
% ++++插入图片设置++++
\usepackage{graphics}
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
% ++++数学字体宏包++++
\usepackage{amsmath,mathrsfs,amsfonts,amssymb}
% ====行间距设置====
\linespread{1.3}
\renewcommand{\baselinestretch}{1.35}
% ====脚注环境设置====
\AtBeginDocument{
\setlength{\abovedisplayskip}{3pt}
\setlength{\belowdisplayskip}{3pt}
\RequirePackage[flushmargin,stable]{footmisc}
\setlength{\footnotesep}{12pt}
}
% ====设置列表环境====
\usepackage{enumerate}
\usepackage[shortlabels,inline]{enumitem}
\setlist{nolistsep}
% ====颜色设置====
\usepackage{xcolor}
\definecolor{structurecolor}{RGB}{0,120,2}
\definecolor{main}{RGB}{0,120,2}%
\definecolor{second}{RGB}{230,90,7}%
\definecolor{third}{RGB}{0,160,152}%
% ++++设置超链接的颜色++++
\definecolor{winered}{rgb}{0.5,0,0}
% ++++设置浮动体的某些主题色++++
\usepackage[font=small,labelfont={bf,color=structurecolor}]{caption}
\captionsetup[table]{skip=3pt}
\captionsetup[figure]{skip=3pt}
% ====假文宏包====
\usepackage{zhlipsum}
\usepackage{lipsum}
% ====字体设置====
\usepackage{xeCJK}
\setmainfont{Times New Roman}
% ====设置页边距 ====
\usepackage{geometry}
\geometry{
a4paper,
top=25.4mm, bottom=25.4mm,
headheight=2.17cm,
headsep=4mm,
footskip=12mm
}
% ====设置参考文献格式 ====
\usepackage[sort&compress]{natbib}
\setlength{\bibsep}{0.0pt}
\def\bibfont{\footnotesize}
% ====设置页眉页脚 ====
\usepackage{fancyhdr}
\fancyhf{}
\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
\newcommand{\citshape}{\kaishu}
\fancyhead[R]{\color{structurecolor}--\;\thepage\;--}
\fancyhead[L]{\color{structurecolor}\citshape\rightmark}
% ++++ 设置页眉页脚 ++++
\renewcommand{\headrule}{\color{structurecolor}\hrule width\textwidth}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1pt}
% \renewcommand{\headrule}{}
\fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}{} }
%\renewcommand{\chaptermark}[1]{\markboth{\chaptername \, #1\,}{}}
% ====设置公式环境 ====
\numberwithin{equation}{section}
% ====自定义环境 ====
% +++++ note环境 +++++
\newcommand{\notename}{笔记}
\usepackage{bbding,manfnt} % 一些图标,如 \dbend
\newenvironment{note}{
\par\noindent\makebox[-3pt][r]{
\scriptsize\color{red!90}\textdbend\quad}
\textbf{\color{second}\notename} \citshape}{\par}
% +++++ introduction环境 +++++
\newcommand{\introductionname}{内容提要}
\usepackage{multicol}
\usepackage[most]{tcolorbox}
\tcbset{
introductionsty/.style={
enhanced,
breakable,
colback=structurecolor!10,
colframe=structurecolor,
fonttitle=\bfseries,
colbacktitle=structurecolor,
fontupper=\citshape,
attach boxed title to top center={yshift=-3mm,yshifttext=-1mm},
boxrule=0pt,
toprule=0.5pt,
bottomrule=0.5pt,
top=8pt,
before skip=8pt,
sharp corners
},
}
\newenvironment{introduction}[1][\introductionname]{
\begin{tcolorbox}[introductionsty,title={#1}]
\begin{multicols}{2}
\begin{itemize}[label=\textcolor{structurecolor}{\upshape\scriptsize\SquareShadowBottomRight}]}{
\end{itemize}
\end{multicols}
\end{tcolorbox}}
% ====浮动体环境设置:自动居中小一号字 ====
\usepackage{xpatch}
\makeatletter
\xpatchcmd\@floatboxreset{\normalsize}{\centering\small}{}{}
\makeatother
% ====文档超链接设置 ====
\usepackage{hyperref}
\hypersetup{
breaklinks,
unicode,
linktoc=all,
bookmarksnumbered=true,
bookmarksopen=true,
pdfkeywords={Coffeelize},
colorlinks,
linkcolor=winered,
citecolor=winered,
urlcolor=winered,
plainpages=false,
pdfstartview=FitH,
pdfborder={0 0 0},
linktocpage
}
% ==== 代码块样式设置 ====
\usepackage{listings}
\renewcommand{\ttdefault}{cmtt}
\lstdefinestyle{mystyle}{
basicstyle=%
\ttfamily
\lst@ifdisplaystyle\small\fi
}

\lstset{basicstyle=\ttfamily,style=mystyle,breaklines=true}

\definecolor{lightgrey}{rgb}{0.9,0.9,0.9}
\definecolor{frenchplum}{RGB}{190,20,83}
\lstset{language=[LaTeX]TeX,
texcsstyle=*\color{winered},
numbers=none,
mathescape,
breaklines=true,
keywordstyle=\color{winered},
commentstyle=\color{gray},
emph={elegantpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,gbt7714,natbib},
emphstyle={\color{frenchplum}},
morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,extrainfo,logo,cover,subtitle,appendix,chapter,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf},
frame=single,
tabsize=2,
rulecolor=\color{structurecolor},
framerule=0.2pt,
columns=flexible,
% backgroundcolor=\color{lightgrey}
}

\begin{document}
% ==== frontmatter ====
\title{这是智朋的自定义模板}
\author{Coffeelize}
\tableofcontents
\clearpage
% ====正文开始 ====
% ++++ mainmatter ++++

\textcolor{main}{\lipsum[1]}
\textcolor{second}{\zhlipsum[1]}
\textcolor{third}{\zhlipsum[1]}

\section{列表环境示例}
\begin{enumerate}
\item first
\item second\footnote{这是一个脚注测试}
\item third
\end{enumerate}
有序列表,参数说明如下:
\begin{enumerate}
\item 最大序号:用于测定文献列表中文献序号的最大宽度,如果你是10以内的参考文献,那就用9,超过10小于100那就填99.
\item 文献序号:可选参数,用于设定该条文献在参考文献列表中的序号。
\item 检索名:为该文献信息起的简短名称,
\item 文献信息:就是参考文献内容了。
\end{enumerate}
\section{图片环境示例}
\begin{figure}
\includegraphics{example-image-A}
\caption{这是一张实例图片}
\end{figure}
\subsection{这是一个二级标题}
\zhlipsum[1-2]
\begin{note}
这里其实容易出问题的是图片大学不一样怎么版,通常我的解决办法是,从一开始就把两图片的大小设置成一样的,或者通过改参数实现。关于参数如何改,多改改就用经验了!O(∩\_∩)O
\end{note}

\subsubsection{这是一个三级标题}

一下是一个章节的内容摘要
\begin{introduction}
\item 参考文献
\item 交叉引用
\item 代码框设计
\item 网址链接
\end{introduction}

\begin{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.45\linewidth]{welt1.jpg}
%插入的第一个图片
\includegraphics[width=0.45\linewidth]{welt.jpg}
%插入的第二张图片
\caption{紫罗兰永恒花园}
\end{figure}
\end{lstlisting}

\end{document}

输出 PDF

智朋的Latex模板_页面_1.jpg
智朋的Latex模板_页面_2.jpg
智朋的Latex模板_页面_3.jpg
智朋的Latex模板_页面_4.jpg

coffeelize.sty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
%  ====目录章节设置 ====
\usepackage[center,pagestyles]{titlesec}
\usepackage{apptools}
\usepackage[toc,page,title,titletoc]{appendix}
\setcounter{secnumdepth}{5}
% ++++章节标题格式设置++++
\titleformat{\section}[hang]{\bfseries}{
\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{%
\color{structurecolor}\Large\bfseries\filright}
\titleformat{\subsection}[hang]{\bfseries}{
\large\bfseries\color{structurecolor}\thesubsection\enspace}{1pt}{%
\color{structurecolor}\large\bfseries\filright}
\titleformat{\subsubsection}[hang]{\bfseries}{
\large\bfseries\color{structurecolor}\thesubsubsection\enspace}{1pt}{%
\color{structurecolor}\large\bfseries\filright}
% ====常用宏包====
\RequirePackage{makecell,lipsum,hologo,setspace}
\RequirePackage{booktabs}
\RequirePackage{multicol,multirow}
% ++++插入图片设置++++
\usepackage{graphics}
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
% ++++数学字体宏包++++
\usepackage{amsmath,mathrsfs,amsfonts,amssymb}
% ====行间距设置====
\linespread{1.3}
\renewcommand{\baselinestretch}{1.35}
% ====脚注环境设置====
\AtBeginDocument{
\setlength{\abovedisplayskip}{3pt}
\setlength{\belowdisplayskip}{3pt}
\RequirePackage[flushmargin,stable]{footmisc}
\setlength{\footnotesep}{12pt}
}
% ====设置列表环境====
\usepackage{enumerate}
\usepackage[shortlabels,inline]{enumitem}
% ====颜色设置====
\usepackage{xcolor}
\definecolor{structurecolor}{RGB}{0,120,2}
\definecolor{main}{RGB}{0,120,2}%
\definecolor{second}{RGB}{230,90,7}%
\definecolor{third}{RGB}{0,160,152}%
% ++++设置超链接的颜色++++
\definecolor{winered}{rgb}{0.5,0,0}
% ++++设置浮动体的某些主题色++++
\usepackage[font=small,labelfont={bf,color=structurecolor}]{caption}
\captionsetup[table]{skip=3pt}
\captionsetup[figure]{skip=3pt}
% ====假文宏包====
\usepackage{zhlipsum}
\usepackage{lipsum}
% ====字体设置====
\usepackage{xeCJK}
\setmainfont{Times New Roman}

% ====设置页边距 ====
\usepackage{geometry}
\geometry{
a4paper,
top=25.4mm, bottom=25.4mm,
headheight=2.17cm,
headsep=4mm,
footskip=12mm
}
% ====设置参考文献格式 ====
\usepackage[sort&compress]{natbib}
\setlength{\bibsep}{0.0pt}
\def\bibfont{\footnotesize}
% ====设置页眉页脚 ====
\usepackage{fancyhdr}
\fancyhf{}
\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
\newcommand{\citshape}{\kaishu}
\fancyhead[R]{\color{structurecolor}--\;\thepage\;--}
%\fancyhead[L]{\color{structurecolor}\citshape\rightmark}
% ++++ 设置页眉页脚 ++++
\renewcommand{\headrule}{\color{structurecolor}\hrule width\textwidth}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1pt}
% \renewcommand{\headrule}{}
\fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}{} }
%\renewcommand{\chaptermark}[1]{\markboth{\chaptername \, #1\,}{}}
% ====设置公式环境 ====
\numberwithin{equation}{section}
% ====自定义环境====
% +++++note环境+++++
\newcommand{\notename}{笔记}
\usepackage{bbding,manfnt} % 一些图标,如 \dbend
\newenvironment{note}{
\par\noindent\makebox[-3pt][r]{
\scriptsize\color{red!90}\textdbend\quad}
\textbf{\color{second}\notename} \citshape}{\par}
% +++++introduction环境+++++
\newcommand{\introductionname}{内容提要}
\usepackage{multicol}
\usepackage[most]{tcolorbox}
\tcbset{
introductionsty/.style={
enhanced,
breakable,
colback=structurecolor!10,
colframe=structurecolor,
fonttitle=\bfseries,
colbacktitle=structurecolor,
fontupper=\citshape,
attach boxed title to top center={yshift=-3mm,yshifttext=-1mm},
boxrule=0pt,
toprule=0.5pt,
bottomrule=0.5pt,
top=8pt,
before skip=8pt,
sharp corners
},
}
\newenvironment{introduction}[1][\introductionname]{
\begin{tcolorbox}[introductionsty,title={#1}]
\begin{multicols}{2}
\begin{itemize}[label=\textcolor{structurecolor}{\upshape\scriptsize\SquareShadowBottomRight}]}{
\end{itemize}
\end{multicols}
\end{tcolorbox}}
% ====浮动体环境设置:自动居中小一号字====
\usepackage{xpatch}
\makeatletter
\xpatchcmd\@floatboxreset{\normalsize}{\centering\small}{}{}
\makeatother
% ====文档超链接设置 ====
\usepackage{hyperref}
\hypersetup{
breaklinks,
unicode,
linktoc=all,
bookmarksnumbered=true,
bookmarksopen=true,
pdfkeywords={Coffeelize},
colorlinks,
linkcolor=winered,
citecolor=winered,
urlcolor=winered,
plainpages=false,
pdfstartview=FitH,
pdfborder={0 0 0},
linktocpage
}
% ====代码块样式设置====
\usepackage{listings}
\renewcommand{\ttdefault}{cmtt}
\lstdefinestyle{mystyle}{
basicstyle=%
\ttfamily
\lst@ifdisplaystyle\small\fi
}

\lstset{basicstyle=\ttfamily,style=mystyle,breaklines=true}

\definecolor{lightgrey}{rgb}{0.9,0.9,0.9}
\definecolor{frenchplum}{RGB}{190,20,83}
\lstset{language=[LaTeX]TeX,
texcsstyle=*\color{winered},
numbers=none,
mathescape,
breaklines=true,
keywordstyle=\color{winered},
commentstyle=\color{gray},
emph={elegantpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,gbt7714,natbib},
emphstyle={\color{frenchplum}},
morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,extrainfo,logo,cover,subtitle,appendix,chapter,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf},
frame=single,
tabsize=2,
rulecolor=\color{structurecolor},
framerule=0.2pt,
columns=flexible,
% backgroundcolor=\color{lightgrey}
}

Java 代码高亮

参考资料:Listings Highlight Java Annotations - TeX - LaTeX Stack Exchange

将以下代码添加到 coffeelize.sty 文件末尾即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
%%% Java代码高亮
\usepackage[T1]{fontenc}
\usepackage{inconsolata}
\definecolor{pblue}{rgb}{0.13,0.13,1}
\definecolor{pgreen}{rgb}{0,0.5,0}
\definecolor{pred}{rgb}{0.9,0,0}
\definecolor{pgrey}{rgb}{0.46,0.45,0.48}
\lstset{language=Java,
showspaces=false,
showtabs=false,
breaklines=true,
showstringspaces=false,
breakatwhitespace=true,
commentstyle=\color{pgreen},
keywordstyle=\color{pblue},
stringstyle=\color{pred},
basicstyle=\ttfamily,
moredelim=[il][\textcolor{pgrey}]{$$},
moredelim=[is][\textcolor{pgrey}]{\%\%}{\%\%}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
\begin{lstlisting}
class Solution {
public int removeElement(int[] nums, int val) {
int slow = 0;
int fast = 0;
for (fast = 0; fast < nums.length; fast++) {
//快指针指向的不是目标元素
if (nums[fast] != val) {
// 1、将快指针指向的元素赋值给慢指针位置
// 2、赋值完成后,slow++,慢指针向前移动一个位置
nums[slow++] = nums[fast];
}
}
return slow;
}
}
\end{lstlisting}

06-Java语法高亮.png

了解 Vimium

  1. 少数派:让你用 Chrome 上网快到想哭:Vimium - 少数派
  2. Chrome Web Store:Chrome Web Store - Extensions
  3. 简书:Vimium——Chrome 里的极客插件

自定义配置

缘由:本想着为什么是 “j” 和 “k” 表示上下滚动,明明左手一般在键盘位置,右手握鼠标,显然 jk 这两个按键需要使用到右手,而我又不能完全放弃鼠标,这反而会影响效率。那么干脆将需要的按的键位都放在左上边,这样多好。

该配置上参考:22/03/ Vimium C: 浏览器扩展 键盘快捷键自定义_鬼扯子的博客 - CSDN 博客

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
unmapAll                    #取消所有映射

map W scrollToTop #滚动到顶部
map S scrollToBottom #滚动到底部
map w scrollPageUp #向上滚动半个页面的高度
map s scrollPageDown #向下滚动半个页面的高度

map r reload #刷新当前子页面
map R goBack #返回上一页面

map gg goToRoot #返回首页
map p openCopiedUrlInNewTab #在新标签页中打开粘贴板网址
map f LinkHints.activate #点击网页中的链接和按钮
map x removeTab #关闭当前标签页
map X restoreTab #打开关闭的标签页
map a previousTab #上一个标签页
map d nextTab #下一个标签页
map t createTab #新建标签页
map yy copyCurrentUrl #复制当前链接

map o Vomnibar.activateInNewTab #新建标签页搜索
map O Vomnibar.activate #当前标签页搜索
map ? showHelp #显示帮助页面
map q focusInput #切换选择光标
map A togglePinTab #固定当前页面
map gf firstTab #切换到第一个页面
map gl lastTab #切换最后一个页面

map v enterVisualMode #进入文字选定模式
map V enterVisualLineMode #进入文字行选定模式

map / enterFindMode #进入文字查找模式
map n performFind #查找下一处

Vimium-C自定义配置.png

作用于 Chrome 原生标签页

Vimium 无法在 Chrome 新标签页和一些 Chrome 原生页面上运行快捷键,需要进行如下配置,在 chrome 浏览器中复制如下内容即可开启 Extensions on chrome://URLs 设置

1
chrome://flags/#extensions-on-chrome-urls

作用于Chrome原生标签页.png

开启这个选项之后,就可以对 Chrome 的新标签页和 Chrome 原生的页面进行 Vimium 的快捷键使用啦:)

参考资料

  1. CSDN:22/03/ Vimium C: 浏览器扩展 键盘快捷键自定义_鬼扯子的博客 - CSDN 博客
  2. 个人博客:扩展推荐 ——Vimium C: 键盘快捷键 - 暮雨千泷

参考资料

  1. Emoji Code Sheet:Emoji Cheat Sheet
  2. VScode 插件:Markdown Emoji
  3. Obsidian 插件:Emoji shortcodes(自带补全提示)
  4. Complete list of github markdown emojis

常用 Emoji

只是,同样的 Markdown Emoji 符号,在不同的地方显示可能不同,比如 VScode 和 Obsidian,更别说其他浏览器里

  • 😄:smile
  • 😭:sob
  • 😂:joy
  • 😁:grin
  • 😉:wink
  • 😳:flushed
  • 👍:+1
  • 😅:sweat_smile

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
hexo new "My New Post"

More info: Writing

Run server

1
hexo server

More info: Server

Generate static files

1
hexo generate

More info: Generating

Deploy to remote sites

1
hexo deploy

More info: Deployment

速览

framed – Framed or shaded regions that can break across pages

该宏包提供可三个环境:

  • frame:which puts an ordinary frame box around the region
  • shaded:which shades the region
  • leftbar:which places a line at the left side.

还提供了一个命令来自定义设置 framed-style 的环境

案例分析

1
2
3
4
5
6
7
8
9
10
11
12
\documentclass{ctexart}
\usepackage{zhlipsum}
\usepackage{geometry}
\usepackage{framed}
\geometry{a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\begin{document}
\begin{framed}
\zhlipsum[1-5]
\end{framed}
\clearpage
\fbox{\zhlipsum[1-3]}
\end{document}

代码分析

设置页边距,ctexart 文档类默认的页边距有些宽,习惯使用如下的页边距

1
2
\usepackage{geometry} 
\geometry{a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}

使用中文假文

1
2
\usepackage{zhlipsum} %中文假文宏包
\zhlipsum[1-5] %从假文文章中抽取第一段到第五段内容

frame 环境和 fbox 命令

两者均可以为文本内容添加外边框,但是当文本内容超过一行之后,使用 fbox 就会出现问题了,无法正确的换行和分页,导致超出该行的部分无法在 PDF 中显示。如下图所示
因此,针对此问题,宏包作者开发了 framed 宏包,两者的关系不言而喻,framed 宏包是基于 fbox 进行开发的。

framed 环境输出

  1. 正常换行

01-frame宏包正常换行.png

  1. 正常分页

02-frame宏包正常分页.png

fbox 命令输出

  1. 无法正确换行

03-fbox命令无法处理长文本-无法正常换行和分页.png

实际上,framebox 命令输出也是这种效果,这里暂且认为 framebox 命令和 fbox 命令完全相同

对应的,fbox 可以设置边框边线的宽度和内容距边框的间距,framed 环境同样是可以设置的

设置边框宽度和间距

对 fbox 盒子进行设置

1
2
3
4
\fbox{Test box}
\setlength{\fboxrule}{1.6pt}
\setlength{\fboxsep}{1em}
\fbox{Test box}

06-设置fbox边框和间距.png

对 frame 盒子进行设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
\documentclass{ctexart}
\usepackage{zhlipsum}
\usepackage{geometry}
\usepackage{framed}
\geometry{a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\begin{document}

\begin{framed}
\zhlipsum[1]
\end{framed}
\setlength\FrameRule{1.6pt}
\setlength\FrameSep{2em}
\begin{framed}
\zhlipsum[1]
\end{framed}

\end{document}

07-默认frame盒子和自定义frame盒子.png

拓展应用

换页是否封闭外边框

  • framed 环境默认是封闭的
  • oframed 环境则提供了开口的外边框:oframed 其实是 “Open Framed” 的组合吧

04-oframed环境.png

左边线样式

我想许多人使用这个宏包就是为了实现网页中的 引用 效果吧 o (^▽^) o,左边线的长度会自动随着环境中的文本长度进行变化

1
2
3
4
5
6
7
8
9
10
\documentclass{ctexart}
\usepackage{zhlipsum}
\usepackage{geometry}
\usepackage{framed}
\geometry{a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\begin{document}
\begin{leftbar}
\zhlipsum[1]
\end{leftbar}
\end{document}

05-leftbar环境.png

其他参数

除了上面所说的 FrameSepFrameRule 命令,宏包手册中还列举了大量其他命令,这里就不仔细研究了,感觉用不到这里面太多的东西,但是还是感谢开发者啦 o (^▽^) o

08-framed宏包命令.png

参考资料