hikiutils 0.2.3.7 → 0.2.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hikiutils_bob/Rakefile +146 -38
- data/hikiutils_bob/figs/calphad_bob.pdf +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.001.bb +5 -0
- data/hikiutils_bob/figs/hikiutils_bob.002.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.004.jpeg +0 -0
- data/hikiutils_bob/figs/hikiutils_bob.005.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.002.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.004.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob/hikiutils_bob.005.jpeg +0 -0
- data/hikiutils_bob/hikiutils_bob.hiki +3 -3
- data/hikiutils_bob/hikiutils_bob.key +0 -0
- data/hikiutils_bob/latex2hiki.hiki +3 -0
- data/hikiutils_bob/latex_all.hiki +51 -14
- data/hikiutils_bob/latex_dir/head.tex +2 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.aux +1 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.log +75 -35
- data/hikiutils_bob/latex_dir/hikiutils_bob.pdf +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.synctex.gz +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.tex +3 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.toc +34 -25
- data/hikiutils_bob/latex_dir/latex2hiki.aux +23 -0
- data/hikiutils_bob/latex_dir/latex2hiki.tex +4 -0
- data/hikiutils_bob/latex_dir/latex_all.aux +16 -13
- data/hikiutils_bob/latex_dir/latex_all.tex +51 -10
- data/hikiutils_bob/latex_dir/sync.aux +33 -27
- data/hikiutils_bob/latex_dir/sync.log +18 -188
- data/hikiutils_bob/latex_dir/sync.tex +54 -23
- data/hikiutils_bob/sync.hiki +49 -21
- data/hikiutils_bob/toc.hiki +28 -0
- data/hikiutils_yamane/Rakefile +67 -15
- data/hikiutils_yamane/abstract.hiki +7 -0
- data/hikiutils_yamane/clidescription.hiki +4 -4
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.001.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.002.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.003.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.004.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.005.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.006.jpg +0 -0
- data/hikiutils_yamane/figs/hikiutils_yamane_09_copy.007.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane.hiki +6 -7
- data/hikiutils_yamane/latex_dir/abstract.aux +2 -2
- data/hikiutils_yamane/latex_dir/abstract.tex +8 -0
- data/hikiutils_yamane/latex_dir/clidescription.aux +9 -10
- data/hikiutils_yamane/latex_dir/clidescription.tex +4 -5
- data/hikiutils_yamane/latex_dir/code.aux +25 -25
- data/hikiutils_yamane/latex_dir/code.tex +15 -15
- data/hikiutils_yamane/latex_dir/compare.tex +4 -4
- data/hikiutils_yamane/latex_dir/head.tex +1 -0
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.aux +3 -6
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.log +78 -117
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.pdf +0 -0
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.synctex.gz +0 -0
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.tex +3 -6
- data/hikiutils_yamane/latex_dir/hikiutils_yamane.toc +22 -48
- data/hikiutils_yamane/latex_dir/method.aux +25 -0
- data/hikiutils_yamane/latex_dir/method.tex +14 -0
- data/hikiutils_yamane/latex_dir/purpose.aux +6 -9
- data/hikiutils_yamane/latex_dir/purpose.tex +1 -14
- data/hikiutils_yamane/latex_dir/results.aux +11 -19
- data/hikiutils_yamane/latex_dir/results.tex +22 -12
- data/hikiutils_yamane/method.hiki +12 -0
- data/hikiutils_yamane/purpose.hiki +1 -12
- data/hikiutils_yamane/results.hiki +15 -12
- data/hikiutils_yamane/toc.hiki +22 -0
- data/lib/hikiutils/version.rb +1 -1
- data/lib/templates/Rakefile_hiki_sync +102 -21
- metadata +14 -38
- data/hikiutils.gemspec~ +0 -43
- data/hikiutils_bob/latex_dir/hikiutils_bob +0 -243
- data/hikiutils_bob/latex_dir/hikiutils_bob.001.bb +0 -5
- data/hikiutils_bob/latex_dir/hikiutils_bob.001.jpeg +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.002.bb +0 -5
- data/hikiutils_bob/latex_dir/hikiutils_bob.002.jpeg +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.003.bb +0 -5
- data/hikiutils_bob/latex_dir/hikiutils_bob.003.jpeg +0 -0
- data/hikiutils_bob/latex_dir/latex_all).aux +0 -21
- data/hikiutils_bob/latex_dir/sync).aux +0 -21
- data/hikiutils_bob/latex_dir/sync.pdf +0 -0
- data/hikiutils_bob/latex_dir/sync.synctex.gz +0 -0
- data/hikiutils_bob/latex_dir/sync.toc +0 -17
- data/hikiutils_bob/latex_dir/to_latex.tex +0 -44
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.001.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.002.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.003.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.004.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.005.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.006.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/222/343/202/232/343/203/274.007.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.001.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.002.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.003.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.004.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.005.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.006.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274/hikiutils_yamane_09 /343/201/256/343/202/263/343/203/224/343/203/274.007.jpg +0 -0
- data/hikiutils_yamane/hikiutils_yamane_09.key +0 -0
- data/hikiutils_yamane/latex_dir/command_table.aux +0 -4
- data/hikiutils_yamane/latex_dir/command_table.log +0 -152
- data/hikiutils_yamane/latex_dir/command_table.pdf +0 -0
- data/hikiutils_yamane/latex_dir/command_table.synctex.gz +0 -0
- data/hikiutils_yamane/latex_dir/compare.aux +0 -40
- data/hikiutils_yamane/latex_dir/introduction.aux +0 -26
- data/hikiutils_yamane/latex_dir/pre.tex +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14f8ddaa5724a5bef43069e36c066add00238df3
|
4
|
+
data.tar.gz: 06ed1698aed26fb399a5f6e362e32cf3342756fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1a7f054d618f647670350be3ac85c38c0f0ac4be6a730915711c8b7ad3118606f51ed8b9ae2077ea6aa6ef4788f8bfe938b4c50bc41603b8d92ff33954d961b
|
7
|
+
data.tar.gz: 3bcb47f099baaa80aa0e9b21fdf4e76e48ee468c703d6e17ce190248e521e89f1eb5ff679cbb15faa7f1615208513ac4a82a4da1d7322ebd30b783ca8092ca86
|
data/hikiutils_bob/Rakefile
CHANGED
@@ -3,55 +3,167 @@ require 'systemu'
|
|
3
3
|
require 'tempfile'
|
4
4
|
# -*- coding: utf-8 -*-
|
5
5
|
begin
|
6
|
-
|
6
|
+
$hiki_dir = File.readlines('./.hikirc')[0].chomp
|
7
7
|
rescue => e
|
8
8
|
puts e
|
9
9
|
exit
|
10
10
|
end
|
11
11
|
dirnames=Dir.pwd.split('/')
|
12
|
-
basename = (dirnames[-1]=='hikis')? dirnames[-2] : dirnames[-1]
|
12
|
+
$basename = (dirnames[-1]=='hikis')? dirnames[-2] : dirnames[-1]
|
13
13
|
$latex_dir= 'latex_dir'
|
14
|
+
$section_layer = {}
|
14
15
|
|
16
|
+
task :default do
|
17
|
+
system 'rake -T'
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Githubのdirをsafariでopen"
|
15
21
|
task :github do
|
16
22
|
status, stdout, stderr = systemu %q( git remote -v |grep origin )
|
17
23
|
p github_dir=stdout.match(/(.+):(.+) \(push\)/)[2]
|
18
24
|
system "open https://github.com/#{github_dir}"
|
19
25
|
end
|
20
26
|
|
21
|
-
|
22
|
-
|
27
|
+
desc "hikiシステムにあるゴミファイルを掃除する"
|
28
|
+
task :reset_hiki do
|
29
|
+
status, stdout, stderr = systemu "hiki -l #{$basename}"
|
30
|
+
print stdout
|
31
|
+
files=[]
|
32
|
+
stdout.split("\n").each{|line|
|
33
|
+
files << line.split(/\s+/)[-1]
|
34
|
+
}
|
35
|
+
r_files = files.reverse[0..-5]
|
36
|
+
r_files.each{|file|
|
37
|
+
print "remove #{file}[ynql]?"
|
38
|
+
input=STDIN.gets.chomp
|
39
|
+
case input
|
40
|
+
when 'y'
|
41
|
+
p command="hiki --remove #{file}"
|
42
|
+
system command
|
43
|
+
when 'n'
|
44
|
+
when 'l'
|
45
|
+
p command="hiki -l #{$basename}"
|
46
|
+
system command
|
47
|
+
when 'q'
|
48
|
+
exit
|
49
|
+
end
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "latex_dirのゴミを掃除"
|
54
|
+
task :reset_latex_dir do
|
55
|
+
system "mv latex_dir/head.tex ."
|
56
|
+
system "rm -rf latex_dir"
|
57
|
+
system "mkdir latex_dir"
|
58
|
+
system "mv head.tex latex_dir/"
|
59
|
+
system "rake latex_all"
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "toc.hikiの作成"
|
63
|
+
task :mk_toc do
|
64
|
+
p target = $basename+'.toc'
|
65
|
+
cont=""
|
66
|
+
File.readlines(File.join('latex_dir',target)).each{|line|
|
67
|
+
if m=line.match(/\\contentsline \{(.+)\}\{\\numberline \{([\d|\.]+)\}(.+)\}\{\d+\}/)
|
68
|
+
layer,sec_no,title=m[1],m[2],m[3]
|
69
|
+
d = case m[1]
|
70
|
+
when 'section'
|
71
|
+
1
|
72
|
+
when 'subsection'
|
73
|
+
2
|
74
|
+
when 'subsubsection'
|
75
|
+
3
|
76
|
+
else
|
77
|
+
4
|
78
|
+
end
|
79
|
+
layer = "!"*d
|
80
|
+
title.gsub!('\_','_')
|
81
|
+
cont << "#{layer}#{sec_no}:#{title}\n"
|
82
|
+
end
|
83
|
+
}
|
84
|
+
print cont
|
85
|
+
File.open("toc.hiki",'w'){|file| file.print cont}
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "hikiシステムを最新状態に更新"
|
89
|
+
task :touch do
|
90
|
+
p target = File.join($hiki_dir,'cache','attach',$basename)
|
91
|
+
system "touch #{target}/*"
|
92
|
+
Dir.entries('.').each{|file|
|
93
|
+
file_split=file.split(".")
|
94
|
+
if file_split[1]=='hiki'
|
95
|
+
next if file_split[0]==$basename
|
96
|
+
p target = $basename+"_"+file_split[0]
|
97
|
+
system "hiki -u #{target}"
|
98
|
+
end
|
99
|
+
}
|
23
100
|
end
|
24
101
|
|
25
|
-
desc "latex
|
102
|
+
desc "FILE1をlatexに変換"
|
26
103
|
task :latex => [:latex_base] do
|
27
104
|
exit
|
28
105
|
end
|
29
106
|
|
30
|
-
desc "
|
107
|
+
desc "FILE1をwrap formatでlatexに変換"
|
31
108
|
task :latex_wrap => [:latex_base, :change_wrap] do
|
32
109
|
exit
|
33
110
|
end
|
34
111
|
|
35
|
-
|
36
|
-
task :latex_all do
|
37
|
-
p entries=Dir.entries('.')
|
112
|
+
def latex_loop(entries,opts={})
|
38
113
|
main_file=""
|
39
114
|
entries.each{|file|
|
40
|
-
|
115
|
+
options={:latex_all=>true}
|
41
116
|
next unless file.split('.')[1]=='hiki'
|
117
|
+
next if file=='toc.hiki'
|
42
118
|
next if file.include?('.hikirc')
|
43
119
|
f_name =File.basename(file,'.hiki')
|
44
|
-
if
|
45
|
-
|
46
|
-
|
120
|
+
if opts[:main]
|
121
|
+
if f_name==$basename
|
122
|
+
options[:latex]="--listings --head latex_dir/head.tex -p "
|
123
|
+
options[:main]=true
|
124
|
+
main_file=f_name
|
125
|
+
convert_to_latex(file, options)
|
126
|
+
end
|
47
127
|
else
|
48
|
-
|
128
|
+
if f_name!=$basename
|
129
|
+
p level = $section_layer[f_name] || 1
|
130
|
+
options[:latex]="-l #{level} --listings -b "
|
131
|
+
convert_to_latex(file, options)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
}
|
135
|
+
return main_file
|
136
|
+
end
|
137
|
+
|
138
|
+
def check_section_layers(lines)
|
139
|
+
p reg_exp = Regexp.new("#{$basename}_(.+)")
|
140
|
+
lines.each{|line|
|
141
|
+
p line
|
142
|
+
if m=line.match(/(!+)\[\[(.+)\]\]/)
|
143
|
+
p count = m[1].count('!')
|
144
|
+
p file_name=m[2].match(reg_exp)[1]
|
145
|
+
$section_layer[file_name]=count
|
49
146
|
end
|
50
|
-
convert_to_latex(file, option)
|
51
147
|
}
|
148
|
+
p $section_layer
|
149
|
+
end
|
150
|
+
|
151
|
+
def check_bounding_box
|
152
|
+
$bounding_box="0 0 442 432"
|
153
|
+
end
|
154
|
+
|
155
|
+
desc "すべてのhikiファイルをlatex変換"
|
156
|
+
task :latex_all do
|
157
|
+
p entries=Dir.entries('.')
|
158
|
+
check_bounding_box
|
159
|
+
main_file = latex_loop(entries,opts={:main=>true})
|
160
|
+
latex_loop(entries)
|
52
161
|
cont=""
|
53
|
-
p reg_exp = Regexp.new("#{basename}_(.+)")
|
162
|
+
p reg_exp = Regexp.new("#{$basename}_(.+)")
|
163
|
+
toc = false
|
54
164
|
File.readlines(File.join($latex_dir,"#{main_file}.tex")).each{|line|
|
165
|
+
line, toc = "", true if line.match(/\\tableofcontents/) and toc == true #only one
|
166
|
+
|
55
167
|
if line.match(/section{(.+)}/)
|
56
168
|
if m=line.match(/\\verb\|(.+)\((.+)\)\|/)
|
57
169
|
p m
|
@@ -62,7 +174,7 @@ task :latex_all do
|
|
62
174
|
p m_t=m[1].match(reg_exp)[1]
|
63
175
|
line = "\\include{#{m_t}}\n"
|
64
176
|
else
|
65
|
-
line = ""
|
177
|
+
# line = ""
|
66
178
|
end
|
67
179
|
end
|
68
180
|
cont << line
|
@@ -72,39 +184,38 @@ task :latex_all do
|
|
72
184
|
exit
|
73
185
|
end
|
74
186
|
|
75
|
-
desc "latex conversion FILE1(hiki) to FILE2(latex)"
|
76
187
|
task :latex_base do
|
77
188
|
Dir.mkdir($latex_dir) unless Dir.exist?($latex_dir)
|
78
189
|
convert_to_latex(ARGV[1])
|
79
190
|
system("open #{$save_name}")
|
80
191
|
end
|
81
192
|
|
82
|
-
def convert_to_latex(file_name,
|
193
|
+
def convert_to_latex(file_name, options={})
|
83
194
|
p file_name = file_name.include?('.hiki')? file_name : file_name+'.hiki'
|
84
195
|
p tex_name = File.basename(file_name,'.hiki')+'.tex'
|
85
196
|
p $save_name = ARGV[2] || File.join($latex_dir,tex_name)
|
86
197
|
pre_name = File.join($latex_dir,'pre.tex')
|
87
198
|
p pre_command = File.exist?(pre_name) ? '--pre '+pre_name : nil
|
88
199
|
lines = File.readlines(file_name)
|
200
|
+
check_section_layers(lines) if options[:main]
|
89
201
|
cont = ""
|
90
|
-
lines.
|
91
|
-
p line
|
202
|
+
lines.each_with_index{|line,i|
|
92
203
|
if m=line.match(/\{\{attach_view\((.*),(.*)\)\}\}/)
|
93
204
|
p line="\{\{attach_view\(#{m[1]}\)\}\}\n"
|
94
|
-
elsif
|
95
|
-
line="" if line.match(
|
205
|
+
elsif options[:latex_all] and i<5
|
206
|
+
line="" if line.match(/^!title:|^!author:|^!date:/)
|
96
207
|
end
|
97
208
|
cont << line
|
98
209
|
}
|
99
210
|
tf1,tf2='tmp1.txt','tmp2.txt'
|
100
211
|
File.open(tf1,'w'){|file| file.print cont}
|
101
|
-
system "hiki2latex #{pre_command} #{
|
212
|
+
system "hiki2latex #{pre_command} #{options[:latex]} #{tf1} > #{tf2}"
|
102
213
|
lines = File.readlines(tf2)
|
103
214
|
system "rm #{tf1} #{tf2}"
|
104
215
|
cont = ""
|
105
216
|
lines.each{|line|
|
106
217
|
if m=line.match(/\\includegraphics\[width=6cm\]\{(.+)\}/)
|
107
|
-
p line="\\includegraphics\[width=6cm,bb
|
218
|
+
p line="\\includegraphics\[width=6cm,bb=#{$bounding_box}\]\{../figs/#{m[1]}\}\n"
|
108
219
|
cont << line
|
109
220
|
else
|
110
221
|
cont << line
|
@@ -113,7 +224,6 @@ def convert_to_latex(file_name, option={})
|
|
113
224
|
File.open($save_name,'w'){|file| file.print cont }
|
114
225
|
end
|
115
226
|
|
116
|
-
desc "change latex figures to wrap format"
|
117
227
|
task :change_wrap do
|
118
228
|
lines = File.readlines($save_name)
|
119
229
|
|
@@ -195,26 +305,25 @@ task :convert do
|
|
195
305
|
exit
|
196
306
|
end
|
197
307
|
|
198
|
-
desc "
|
308
|
+
desc "hikiの同期"
|
199
309
|
task :sync => [:check_previous,:sync0]
|
200
310
|
|
201
311
|
|
202
|
-
desc "
|
312
|
+
desc "hikiの強制同期"
|
203
313
|
task :force_sync => [:sync0]
|
204
314
|
|
205
|
-
desc "sync0 hikis and figs to hiki directory"
|
206
315
|
task :sync0 do
|
207
316
|
entries=Dir.entries('.')
|
208
317
|
entries[2..-1].each{|source| #cp *.hiki
|
209
318
|
next unless source.split('.')[1]=='hiki'
|
210
319
|
next if source.include?('.hikirc')
|
211
320
|
p base = source.split('.')[0]
|
212
|
-
name = (base
|
213
|
-
p target = File.join(
|
321
|
+
name = (base==$basename)? base : $basename+'_'+base
|
322
|
+
p target = File.join($hiki_dir,'text',name)
|
214
323
|
FileUtils.cp(source,target,:verbose=>true)
|
215
324
|
}
|
216
325
|
p entries=Dir.entries('./figs') #cp files in figs
|
217
|
-
p target = File.join(
|
326
|
+
p target = File.join($hiki_dir,'cache','attach',$basename)
|
218
327
|
FileUtils.mkdir_p(target,:verbose=>true) unless File.exists?(target)
|
219
328
|
entries[2..-1].each{|file|
|
220
329
|
p source = File.join('./figs',file)
|
@@ -222,8 +331,8 @@ task :sync0 do
|
|
222
331
|
}
|
223
332
|
|
224
333
|
File.open('./.hikirc','w'){|file|
|
225
|
-
status, stdout, stderr =systemu "hiki -l #{basename}*"
|
226
|
-
file.print(
|
334
|
+
status, stdout, stderr =systemu "hiki -l #{$basename}*"
|
335
|
+
file.print($hiki_dir+"\n")
|
227
336
|
stdout.split("\n")[3..-1].each{|line|
|
228
337
|
file.print line+"\n"
|
229
338
|
}
|
@@ -234,8 +343,8 @@ end
|
|
234
343
|
desc "For hiki Errno::ENOENT, Errno::EACCES"
|
235
344
|
task :chenv do
|
236
345
|
p user = ENV['USER']
|
237
|
-
system("sudo chmod -R a+w #{
|
238
|
-
# system("sudo chown -R #{user} #{
|
346
|
+
system("sudo chmod -R a+w #{$hiki_dir}")
|
347
|
+
# system("sudo chown -R #{user} #{$hiki_dir}")
|
239
348
|
end
|
240
349
|
|
241
350
|
desc "self copy to hikiutils template directory"
|
@@ -249,11 +358,10 @@ task :self_copy do
|
|
249
358
|
}
|
250
359
|
end
|
251
360
|
|
252
|
-
desc "check previou and current sync"
|
253
361
|
task :check_previous do
|
254
362
|
current={}
|
255
363
|
print "current hiki dir\n"
|
256
|
-
status, stdout, stderr = systemu("hiki -l #{basename}*")
|
364
|
+
status, stdout, stderr = systemu("hiki -l #{$basename}*")
|
257
365
|
stdout.split("\n")[3..-1].each{|line|
|
258
366
|
p line
|
259
367
|
file= line.split(/\s+/)[-1]
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
!title:卒論編集システムの概要
|
2
2
|
*{{attach_anchor(hikiutils_bob.pdf,hikiutils_bob)}}
|
3
|
-
!
|
4
|
-
!
|
5
|
-
|
3
|
+
![[hikiとの同期|hikiutils_bob_sync]]
|
4
|
+
![[latexへの変換|hikiutils_bob_latex_all]]
|
5
|
+
![[hikiへのlatexからの変換|hikiutils_bob_latex2hiki]]
|
6
6
|
|
Binary file
|
@@ -33,19 +33,18 @@ DRY(Don't Repeat Yourself)原則さえ守れば,文書管理はいいのです
|
|
33
33
|
hiki -i
|
34
34
|
でinstallされています.新たに使うコマンド群は次の通りです.
|
35
35
|
<<< bash
|
36
|
-
rake
|
37
|
-
rake
|
38
|
-
rake
|
39
|
-
rake
|
40
|
-
rake latex_wrap # latex conversion FILE1 with wrap format
|
36
|
+
rake latex # FILE1をlatexに変換
|
37
|
+
rake latex_all # すべてのhikiファイルをlatex変換
|
38
|
+
rake latex_wrap # FILE1をwrap formatでlatexに変換
|
39
|
+
rake reset_latex_dir # latex_dirのゴミファイルを削除
|
41
40
|
>>>
|
42
41
|
|
43
|
-
!!rake latex
|
42
|
+
!!rake latex(個別ファイルの変換)
|
44
43
|
rake latex sync.hiki
|
45
44
|
とすると,
|
46
45
|
latex_dir/sync.tex
|
47
46
|
にlatex変換後のファイルが生成します.これを,TeXShopでcommand_t変換します.
|
48
|
-
|
47
|
+
完成例はこちらです.
|
49
48
|
*{{attach_anchor(sync.pdf,hikiutils_bob)}}
|
50
49
|
|
51
50
|
うまくいかないときは,terminalで
|
@@ -56,9 +55,11 @@ rake latex_wrap # latex conversion FILE1 with wrap format
|
|
56
55
|
!!!注意
|
57
56
|
hikiの初めの部分は,
|
58
57
|
<<<
|
59
|
-
|
60
|
-
!
|
61
|
-
!
|
58
|
+
bob% head -3 hikiutils_bob.hiki
|
59
|
+
! title:hikiutils -iによる卒論作成システム
|
60
|
+
! autor:Shigeto R. Nishitani
|
61
|
+
! date: Kwansei Gakuen Univ., 2017/1
|
62
|
+
|
62
63
|
>>>
|
63
64
|
とすると,
|
64
65
|
<<< latex
|
@@ -68,7 +69,8 @@ hikiの初めの部分は,
|
|
68
69
|
\date{ Kwansei Gakuen Univ., 2017/1}
|
69
70
|
\maketitle
|
70
71
|
>>>
|
71
|
-
|
72
|
+
と変換してくれます.次節のlatex_allでは,basename.hikiに書かれたそれらの情報は,
|
73
|
+
head.texでtitleなどを用意するべきなので,自動で消されます.
|
72
74
|
|
73
75
|
必要な図は,figsから自動で取るようになっていますが,
|
74
76
|
サイズや解像度が問題のときは手動で調整してください.
|
@@ -99,9 +101,13 @@ bob% cat hikiutils_bob.hiki
|
|
99
101
|
latex_dir内に幾つかのtex雛形を入れておく必要があります.
|
100
102
|
hiki -i
|
101
103
|
とhikiutils環境を再度初期化すると,自動でインストールする設定です.
|
102
|
-
なかったら手動で作ってください.
|
104
|
+
なかったら手動で作ってください.Rakefile以外は上書きしません.
|
105
|
+
また,latex_dir/head.texは下に記す修正が必要です.
|
106
|
+
|
103
107
|
!!!!head.tex
|
104
108
|
題目,学生番号,氏名を変更する.年月をチェック.
|
109
|
+
\\setcounter{tocdepth}はtocをどこまで表示するかのレベルに対応します.
|
110
|
+
原稿作成時は階層がわかりやすいように深めにしていますが,本番では2程度で十分です.
|
105
111
|
<<< latex
|
106
112
|
bob% cat head.tex
|
107
113
|
\title{卒業論文\\
|
@@ -110,12 +116,14 @@ bob% cat head.tex
|
|
110
116
|
\date{\vspace{3cm} 2017年 3月\\
|
111
117
|
\vspace{3cm} 指導教員 西谷 滋人 教授}
|
112
118
|
\maketitle
|
119
|
+
\setcounter{tocdepth}{6} %
|
113
120
|
\tableofcontents
|
114
121
|
>>>
|
115
122
|
|
123
|
+
|
116
124
|
!!!!pre.tex
|
117
|
-
|
118
|
-
|
125
|
+
あまり変更しないほうがいいですが,いずれいじることになります.
|
126
|
+
例えば,フォントポイント数を10から12ptに変える,\pagestyle{empty}を外すなどです.
|
119
127
|
<<< latex
|
120
128
|
bob% cat pre.tex
|
121
129
|
\documentclass[10pt,a4j]{article}
|
@@ -156,3 +164,32 @@ bob% cat pre.tex
|
|
156
164
|
\usepackage{here}
|
157
165
|
>>>
|
158
166
|
|
167
|
+
!!補助コマンドの解説
|
168
|
+
!!!rake reset_latex_dir(latex_dirのゴミ掃除)
|
169
|
+
わかりやすいようにまとめたり,ファイルの名称を変更した時には,過去のtexファイルが残る.
|
170
|
+
それらを整理する時に使用.head.texだけをescapeしてrm -rfで消すので,注意が必要.
|
171
|
+
特に図形のfilesやbb filesは消えるので注意.
|
172
|
+
|
173
|
+
!!!wrap関係
|
174
|
+
figure環境をwrapfigure環境で作るための幾つかのコマンド群です.
|
175
|
+
卒論ではfigure環境で作る方がいいんですが,journal論文などのページ数が制限された場合は,
|
176
|
+
wrapfigureでtextの回りこみや位置調整を行う必要があります.
|
177
|
+
それらのための環境を埋め込む仕組みです.
|
178
|
+
|
179
|
+
*rake change_wrap(wrapで変換)
|
180
|
+
*rake latex_base(latexに変換するだけの下請け)
|
181
|
+
*rake latex_wrap(figure環境だけをwrapfig環境に変える)
|
182
|
+
<<< ruby
|
183
|
+
desc "latex conversion FILE1"
|
184
|
+
task :latex => [:latex_base] do
|
185
|
+
exit
|
186
|
+
end
|
187
|
+
|
188
|
+
desc "latex conversion FILE1 with wrap format"
|
189
|
+
task :latex_wrap => [:latex_base, :change_wrap] do
|
190
|
+
exit
|
191
|
+
end
|
192
|
+
>>>
|
193
|
+
完成例はこちらです.
|
194
|
+
*{{attach_anchor(calphad_bob.pdf,hikiutils_bob)}}
|
195
|
+
|