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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e89059de6fc29a9e2e4aa276121bce5c2b3561342cde2c5305af6e50223a1e08
4
- data.tar.gz: 6dd435ec22e2f0b40bae1062e86accdb73aa70ccbca0f8c9d30fd40d99846a32
3
+ metadata.gz: 73911ac5699fe50ad82be4a093af9ab0b07896edf4c0e6c8cc5460f26a53bf0a
4
+ data.tar.gz: 0dcce44e514e0b8fd8129ce85944a5ad79102e2552e481e67427b2e0544d6415
5
5
  SHA512:
6
- metadata.gz: a15b050b6c57985ce86f798e9af90e13693f37b268ceb1b473efd4f7df99f8761fb0a2c0410aad6e9cfe4800ae8db340645079467d78f3bfd63cede1918cb772
7
- data.tar.gz: 401ea7f2a31c4cdfa71bb875ac45db1cf41039ba9e6c4c1afd8c642186f884921f6de539336802779601991f079525fccc3a24da7f363cb239debc8a286bdb00
6
+ metadata.gz: 8465d24905fdc79e476c94515e9ce81249a07be10fcef1629a29bc1ab3b3c02b7f2f1793a3df233c71a5cae4964c344296ade6234d4fb487e6d60d5045c3be76
7
+ data.tar.gz: 0dba5c2ce3abe994b3aa32b2bdaa720dfd782d2fd2fb725d8300288d611c327dbd4c1d258cf3296924460daa5bb8b433b3a6103c800e90965f85f3bc028f870a
@@ -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) then
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
- puts split[1]
121
+
123
122
  File.open(splitter[1], 'w') do |f|
124
123
  f.print splitter[0].gsub!(/section/, 'chapter')
125
- f.print split[1]
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}")
@@ -1,3 +1,3 @@
1
1
  module NbUtil
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
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
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
@@ -1 +0,0 @@
1
- lib/nb_util/EAGLE@MAC.local.2953