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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: afc878ba4b383d2e28dc53a1ce6c7222b73d749a
4
- data.tar.gz: 2b682a71103499f4ef6e2c394e56d9f39e029002
3
+ metadata.gz: eb2a7419ac9a075f364581f678a75c1ff9c33900
4
+ data.tar.gz: 87703ca8814ebc5f0efe6c35c2a382525585a63c
5
5
  SHA512:
6
- metadata.gz: b70054d02f993497d9f4a1669e73fb057904c3d59b505283b669ffef54e08686c9226cb28b2aa5bd11a844edc65dc149ce9d7eadfb17dd251675521f84a7d8e5
7
- data.tar.gz: 086af928a25d3047f8462d12e84cc28f2dd37847bb557f50c4d03c478713f3bd2c260b4759b0ecb7844ec25e8b9e7d17b19656bcba4b07065ec30e9fca80deeb
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
- # @f << "#{title}\n"
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"
@@ -1,3 +1,3 @@
1
1
  module Hiki2latex
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.10"
3
3
  end
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 /.+abstract.+/
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.delete_at(0)
88
- content.gsub!(/\\tableofcontents/){|text|
89
- tt="\n\\abstract\{\n#{abstract.join}\}\n\\tableofcontents"
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.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-19 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler