nb_util 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nb_util/ipynb2tex.rb +8 -6
- data/lib/nb_util/version.rb +1 -1
- metadata +1 -2
- data/lib/nb_util/.#ipynb2tex.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73911ac5699fe50ad82be4a093af9ab0b07896edf4c0e6c8cc5460f26a53bf0a
|
4
|
+
data.tar.gz: 0dcce44e514e0b8fd8129ce85944a5ad79102e2552e481e67427b2e0544d6415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8465d24905fdc79e476c94515e9ce81249a07be10fcef1629a29bc1ab3b3c02b7f2f1793a3df233c71a5cae4964c344296ade6234d4fb487e6d60d5045c3be76
|
7
|
+
data.tar.gz: 0dba5c2ce3abe994b3aa32b2bdaa720dfd782d2fd2fb725d8300288d611c327dbd4c1d258cf3296924460daa5bb8b433b3a6103c800e90965f85f3bc028f870a
|
data/lib/nb_util/ipynb2tex.rb
CHANGED
@@ -54,7 +54,7 @@ module NbUtil
|
|
54
54
|
|
55
55
|
mk_xbb(target, re_fig)
|
56
56
|
|
57
|
-
if File.exist?(cp_lib_data_pieces_bundle)
|
57
|
+
if File.exist?(cp_lib_data_pieces_bundle)
|
58
58
|
FileUtils.cp_r(cp_lib_data_pieces_bundle, target_parent)
|
59
59
|
FileUtils.cp_r(cp_lib_data_thesis_bundle, target_parent)
|
60
60
|
else
|
@@ -108,7 +108,6 @@ module NbUtil
|
|
108
108
|
pickup_ipynb = ipynb["cells"].to_s.split(",")
|
109
109
|
chapter = pickup_ipynb.grep(/"# /).map{ |i| i.gsub(/.*# /, '').gsub(/".*/, '') }
|
110
110
|
chapter_size = chapter.size
|
111
|
-
|
112
111
|
for num in 0..chapter_size-1 do
|
113
112
|
splitters = [ ["\\section{#{chapter[num]}}", target_parent + "/chapter#{num}.tex", FileUtils.mkdir_p(target_parent + "/split_files/chapter#{num}")],
|
114
113
|
["\\begin{Verbatim}", target_parent + '/tmp.tex', FileUtils.mkdir_p(target_parent + '/split_files/tmp')]]
|
@@ -119,12 +118,15 @@ module NbUtil
|
|
119
118
|
split[1].to_s.gsub!(/subsubsection/, 'subsection')
|
120
119
|
split[1].to_s.gsub!(/paragraph/, 'subsubsection')
|
121
120
|
cont = split[0]
|
122
|
-
|
121
|
+
|
123
122
|
File.open(splitter[1], 'w') do |f|
|
124
123
|
f.print splitter[0].gsub!(/section/, 'chapter')
|
125
|
-
|
126
|
-
|
127
|
-
|
124
|
+
if num+1 != chapter_size
|
125
|
+
f.print split[1].sub!(/ \\section{#{chapter[num+1]}}\\label.*/m, '')
|
126
|
+
end
|
127
|
+
if num+1 == chapter_size
|
128
|
+
f.print split[1]
|
129
|
+
end
|
128
130
|
end
|
129
131
|
end
|
130
132
|
FileUtils.mv(target_parent + "/chapter#{num}.tex", target_parent + "/split_files/chapter#{num}")
|
data/lib/nb_util/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nb_util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masatoshi Kowaki
|
@@ -97,7 +97,6 @@ files:
|
|
97
97
|
- lib/data/pieces/usepackage.tex
|
98
98
|
- lib/data/thesis/thesis.tex
|
99
99
|
- lib/nb_util.rb
|
100
|
-
- lib/nb_util/.#ipynb2tex.rb
|
101
100
|
- lib/nb_util/.DS_Store
|
102
101
|
- lib/nb_util/combine.rb
|
103
102
|
- lib/nb_util/getcode.rb
|
data/lib/nb_util/.#ipynb2tex.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
lib/nb_util/EAGLE@MAC.local.2953
|