forked from nfeske/gosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inline.gosh
53 lines (46 loc) · 1.39 KB
/
inline.gosh
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
### WRITE HEADER OF TEX FILE ###
proc produce_head_latex {} {
}
### WRITE TAIL OF TEX FILE ###
proc produce_tail_latex {} {
}
### CHAPTER ###
proc process_chapter_latex {txtblock} {
set title [linetxt [lindex $txtblock 0]]
global chapter_tag;
printline ""
printline "\\$chapter_tag[section_env_latex $title]"
handle_txtblock chapter [lrange $txtblock 2 end]
}
### SECTION ###
proc process_section_latex {txtblock} {
set title [linetxt [lindex $txtblock 0]]
global section_tag
printline ""
printline "\\$section_tag[section_env_latex $title]"
handle_txtblock section [lrange $txtblock 2 end]
}
### SUBSECTION ###
proc process_subsection_latex {txtblock} {
set title [linetxt [lindex $txtblock 0]]
global subsection_tag
printline ""
printline "\\$subsection_tag[section_env_latex $title]"
handle_txtblock subsection [lrange $txtblock 2 end]
}
### PARAGRAPH ###
proc process_paragraph_latex {txtblock} {
set title [linetxt [lindex $txtblock 0]]
global paragraph_tag
printline ""
printline "\\$paragraph_tag{[out_latex $title]}"
handle_txtblock paragraph [lrange $txtblock 2 end]
}
proc indent {} {
global depth
set result ""
for {set i 0} {$i<$depth} {incr i} {
append result " "
}
return $result
}