hiki2latex 0.9.9 → 0.9.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiki2latex/hiki2latex.rb +7 -2
- data/lib/hiki2latex/version.rb +1 -1
- data/lib/hiki2latex.rb +13 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb2a7419ac9a075f364581f678a75c1ff9c33900
|
4
|
+
data.tar.gz: 87703ca8814ebc5f0efe6c35c2a382525585a63c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad543f5879ff9bef9655e116f86edde08bbe00852a6dda5cc1d28eaa380d246ac91e7fc00ff39de5ae5c75487dad2115d867fc3bebcfa30892177eb8b3558e31
|
7
|
+
data.tar.gz: 406efffd2e564e70eefde43e73ebb93336f75f478c673d6dc5cddb3c3eeea99acfe4a6a48fbf762b7a35796191c6f647f1a162d4724a21fe6d35d0fdf16a9eb1
|
@@ -61,11 +61,16 @@ class LatexOutput
|
|
61
61
|
when 'reference'
|
62
62
|
@f << "\\section*\{#{tmp[1]}\}\n"
|
63
63
|
else
|
64
|
-
@f << "\\#{tmp[0]}\{#{tmp[1]}\}\n"
|
65
|
-
|
64
|
+
# @f << "\\#{tmp[0]}\{#{tmp[1]}\}\n"
|
65
|
+
headline_section(level,title)
|
66
66
|
end
|
67
67
|
return
|
68
|
+
else
|
69
|
+
headline_section(level,title)
|
68
70
|
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def headline_section(level,title)
|
69
74
|
case level
|
70
75
|
when 1
|
71
76
|
@f << "\\section\{#{title}\}\n"
|
data/lib/hiki2latex/version.rb
CHANGED
data/lib/hiki2latex.rb
CHANGED
@@ -35,11 +35,11 @@ module Hiki2latex
|
|
35
35
|
end
|
36
36
|
command_parser.banner = "Usage: hiki2latex [options] FILE"
|
37
37
|
command_parser.parse!(@argv)
|
38
|
-
# p @argv
|
39
38
|
plain_doc(@argv[0]) if @argv[0]!=nil
|
40
39
|
exit
|
41
40
|
end
|
42
41
|
|
42
|
+
# pre, post, listingsなどの拡張を処理
|
43
43
|
def plain_doc(file)
|
44
44
|
if @listings==true then
|
45
45
|
puts listings_preamble
|
@@ -66,7 +66,9 @@ module Hiki2latex
|
|
66
66
|
text.gsub!(/^\\tableofcontents/,'')
|
67
67
|
end
|
68
68
|
|
69
|
+
# convert section to abstract in the plain text
|
69
70
|
def mod_abstract(text)
|
71
|
+
# return text
|
70
72
|
abstract,section = [],[]
|
71
73
|
content = ""
|
72
74
|
text.split("\n").each do |line|
|
@@ -74,20 +76,23 @@ module Hiki2latex
|
|
74
76
|
when /^\\section(.+)/
|
75
77
|
section.push $1
|
76
78
|
end
|
77
|
-
|
79
|
+
# p section[-1]
|
78
80
|
case section[-1]
|
79
|
-
when
|
81
|
+
when /\{abstract\}/, /\{【abstract】\}/
|
80
82
|
abstract << line+"\n"
|
81
|
-
when
|
83
|
+
when /\{概要\}/, /\{【概要】\}/
|
82
84
|
abstract << line+"\n"
|
83
85
|
else
|
84
86
|
content << line+"\n"
|
85
87
|
end
|
86
88
|
end
|
87
|
-
abstract
|
88
|
-
|
89
|
-
|
90
|
-
|
89
|
+
# p abstract
|
90
|
+
if abstract.size>1 then
|
91
|
+
abstract.delete_at(0)
|
92
|
+
content.gsub!(/\\tableofcontents/){|text|
|
93
|
+
tt="\n\\abstract\{\n#{abstract.join}\}\n\\tableofcontents"
|
94
|
+
}
|
95
|
+
end
|
91
96
|
return content
|
92
97
|
end
|
93
98
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiki2latex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shigeto R. Nishitani
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|