-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwasm-style.mdk
86 lines (76 loc) · 2.48 KB
/
wasm-style.mdk
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
.code,.pre-indented,.pre-fenced3 {
language: javascript;
}
.pre-indented,.pre-fenced3 {
margin-left:1ex;
}
.math-inline, .code2, .pre-fenced4 {
input: mathpre;
}
.ptoken.keyword { color:navy; }
.ptoken.type { color:#066; }
.ptoken.predefined { color:navy; }
.ptoken.string, .ptoken.constructor { color:#505; }
.ptoken.comment { color:#050; }
@tex .ptoken.identifier { tex-cmd-inner:"\itcorrect"; }
.math-inline, mathpre, .code2, .pre-fenced4 {
replace:"//([a-zA-Z0-9\)])([\*\?])/\1^{\2}//g";
replace:"//\|q\|/{|q|}//\|~q\|/{|\sim{}q|}//g";
replace:"/@resume_throw(?![a-zA-Z])/@resume\_@throw/g";
replace:"//~([^~\n\s]+)~>/\leadsto_{\1}\
//\/\\/\wedge{}\
//\\\//\vee{}\
//\.\.\./{\dots}\
//\[\[/{\llbracket}\
//\]\]/{\rrbracket}\
//!-->>/{\longmapsto^*}\
//-->>/{\longrightarrow^*}\
//<<--/{^*\!{\longleftarrow}}\
//!-->/{\longmapsto}\
//-->/{\longrightarrow}\
//<--/{\longleftarrow}\
//!->/{\mapsto}\
//->/{\rightarrow}\
//===/{\equiv}\
//!==/{\not\equiv}\
//~==/{\,\cong\,}\
//!~=/{\,\not\equiv\,}\
//!=/\ne{}\
//\.=/\doteq{}\
//\btau(\d)/\tau_{\1}\
//\btau(?![a-zA-Z])/\tau\
//\bmu(?![a-zA-Z])/\mu{}\
//\bnu(?![a-zA-Z])/\upsilon{}\
//\b([CSFE])(?![a-zA-Z])/\mathsf{\1}\
//\|\-/\vdash{}\
//<</\llangle{}\
//>>/\rrangle{}\
//=>/\Rightarrow{}\
//g";
}
Tex Header:
\newlength\mdxwidth
\newcommand\ifnowidth[3]{%
\settowidth{\mdxwidth}{#1}%
\ifdim\mdxwidth>0pt\relax#3\else#2\fi
}
\newcommand{\infer}[3]{\dfrac{\begin{array}{llll}#1\end{array}}{\begin{array}{llll}#2\end{array}}\ifnowidth{#3}{}{\;[{#3}]}}
\renewcommand\notin{\not\strut\hspace{-1.2ex}\in}
%
%\DeclareSymbolFont{modernmath}{OML}{ptm}{m}{n}
%\DeclareMathSymbol{\mlambda}{\mathord}{modernmath}{"15}
.pre-fenced5 {
input: markdown;
}
infer, .pre-fenced5 {
replace:"/\/\/ *(.*)/&\\;\\text{(\1)}/g";
replace:"/([\s\S]*?)\n *----+ *(?:\[([^\]]*)\])? *\n([\s\S]*)/\\infer{\1}{\3}{\textsc{\2}}/m";
replace:"~Begin MathPreCenter&nl;~Begin MathPre {.infereq; display:inline-block;}&nl;&source;&nl;~ End MathPre&nl;~ End MathPreCenter";
}
FigBlock {
before: "**&caption;:**&nl;{margin-bottom:1em}&nl;";
.align-center;
margin-bottom: 1em;
margin-top: 1ex;
line-adjust:-3;
}