-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbeamdown.sed
99 lines (76 loc) · 1.63 KB
/
beamdown.sed
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
# Code
/<pre><code>/{
s|<pre><code>\([^$]\+\)$|\\begin{verbatim}\n\1|g
s|<pre><code>|\\begin{verbatim}|g
:top
s|<|<|g
s|>|>|g
n
/<\/code><\/pre>/!b top
s|</code></pre>|\\end{verbatim}|g
p
d
}
s|<code>|\\verb`|g
s|</code>|`|g
# Quotes
s|<blockquote>|\\begin{quote}|g
s|</blockquote>|\\end{quote}|g
# Remove <p></p>
s|<p>|\n|g
s|</p>||g
#restore & in tables
s|\&|\&|g
#these randomly appear
s|<br />||g
#double backslash at the end of tables:
s|\\$|\\\\|g
# Section
s|<h1>\(.*\)</h1>|\\section{\1}|g
# Subsection
s|<h2>\(.*\)</h2>|\\subsection{\1}|g
# Frametitle
s|<h3>\(.*\)</h3>|\\frametitle{\1}|g
# Framesubtitle
s|<h4>\(.*\)</h4>|\\framesubtitle{\1}|g
# Itemize
s|<ul>|\\begin{itemize}|g
s|</ul>|\\end{itemize}|g
s|<li>|\\item |g
s|</li>||g
# Enumerate
s|<ol>|\\begin{enumerate}|g
s|</ol>|\\end{enumerate}|g
s|<li>|\\item |g
s|</li>||g
# Emphasis
s|<em>|\\emph{|g
s|</em>|}|g
# Strong
s|<strong>\(.*\)</strong>|\\alert{\1}|g
# '<' character
s|<|<|g
# '>' character
s|>|>|g
# Figures
s|<a href="\(.*\)">\(.*\)</a>|\\includegraphics[\2]{\1}|g
# Columns
s/^\s*{|\(.*\)$/\\begin{columns}\\begin{column}{\1}/g
s/^\s*|}$/\\end{column}\\end{columns}/g
s/^\s*|\(.*\)$/\\end{column}\\begin{column}{\1}/g
# Blocks
s|^\s*{\.\(.*\)$|\\begin{block}{\1}|g
s|^\s*\.}|\\end{block}|g
s|^\s*{!\(.*\)$|\\begin{alertblock}{\1}|g
s|^\s*!}|\\end{alertblock}|g
s|^\s*{?\(.*\)$|\\begin{exampleblock}{\1}|g
s|^\s*?}|\\end{exampleblock}|g
# Center
s|{=|\\begin{center}|g
s|=}|\\end{center}|g
# Frames
s|^\s*/---\+\s*$|\\begin{frame}[fragile]|g
s|^\s*---\+/\s*$|\\end{frame}|g
# Enquotes
s|{"|\\enquote{|g
s|"}|}|g