review 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +36 -0
  3. data/.rubocop.yml +1 -0
  4. data/ChangeLog +102 -0
  5. data/README.rdoc +2 -2
  6. data/bin/review-check +18 -16
  7. data/bin/review-compile +49 -42
  8. data/bin/review-epubmaker +23 -993
  9. data/bin/review-epubmaker-legacy +1024 -0
  10. data/bin/review-index +17 -15
  11. data/bin/review-init +39 -9
  12. data/bin/review-pdfmaker +124 -89
  13. data/bin/review-preproc +16 -14
  14. data/bin/review-vol +17 -15
  15. data/debian/docs +1 -1
  16. data/doc/catalog.rdoc +34 -0
  17. data/doc/format.rdoc +16 -2
  18. data/doc/libepubmaker/{config.yaml → config.yml} +63 -19
  19. data/doc/quickstart.rdoc +1 -1
  20. data/doc/{sample.yaml → sample.yml} +0 -0
  21. data/lib/epubmaker.rb +1 -1
  22. data/lib/epubmaker/content.rb +9 -1
  23. data/lib/epubmaker/epubv2.rb +59 -7
  24. data/lib/epubmaker/epubv3.rb +14 -9
  25. data/lib/epubmaker/producer.rb +68 -27
  26. data/lib/epubmaker/resource.rb +3 -1
  27. data/lib/lineinput.rb +2 -2
  28. data/lib/review/book/base.rb +125 -24
  29. data/lib/review/book/chapter.rb +42 -0
  30. data/lib/review/book/compilable.rb +23 -4
  31. data/lib/review/book/image_finder.rb +64 -0
  32. data/lib/review/book/index.rb +64 -50
  33. data/lib/review/book/page_metric.rb +1 -1
  34. data/lib/review/builder.rb +19 -12
  35. data/lib/review/catalog.rb +47 -0
  36. data/lib/review/compiler.rb +3 -2
  37. data/lib/review/configure.rb +5 -3
  38. data/lib/review/epubmaker.rb +130 -46
  39. data/lib/review/ewbbuilder.rb +27 -31
  40. data/lib/review/extentions/string.rb +4 -4
  41. data/lib/review/htmlbuilder.rb +140 -79
  42. data/lib/review/htmllayout.rb +26 -4
  43. data/lib/review/htmlutils.rb +20 -1
  44. data/lib/review/i18n.rb +5 -2
  45. data/lib/review/{i18n.yaml → i18n.yml} +4 -2
  46. data/lib/review/idgxmlbuilder.rb +65 -39
  47. data/lib/review/latexbuilder.rb +72 -24
  48. data/lib/review/latexutils.rb +3 -1
  49. data/lib/review/makerhelper.rb +8 -2
  50. data/lib/review/preprocessor.rb +20 -20
  51. data/lib/review/review.tex.erb +4 -0
  52. data/lib/review/sec_counter.rb +9 -11
  53. data/lib/review/tocparser.rb +2 -2
  54. data/lib/review/tocprinter.rb +12 -12
  55. data/lib/review/topbuilder.rb +15 -15
  56. data/lib/review/version.rb +1 -1
  57. data/lib/uuid.rb +7 -7
  58. data/review.gemspec +2 -2
  59. data/rubocop-todo.yml +443 -0
  60. data/test/sample-book/src/config.yml +2 -2
  61. data/test/sample-book/src/{main.css → style.css} +0 -0
  62. data/test/test_book.rb +46 -48
  63. data/test/test_book_chapter.rb +25 -13
  64. data/test/test_builder.rb +3 -3
  65. data/test/test_catalog.rb +107 -0
  66. data/test/test_epubmaker.rb +6 -6
  67. data/test/test_htmlbuilder.rb +160 -39
  68. data/test/test_htmlutils.rb +22 -0
  69. data/test/test_i18n.rb +2 -2
  70. data/test/test_idgxmlbuilder.rb +33 -47
  71. data/test/test_image_finder.rb +82 -0
  72. data/test/test_inaobuilder.rb +1 -1
  73. data/test/test_latexbuilder.rb +35 -39
  74. data/test/test_lineinput.rb +2 -2
  75. data/test/test_markdownbuilder.rb +2 -2
  76. data/test/test_topbuilder.rb +39 -23
  77. metadata +23 -14
  78. data/bin/review-epubmaker-ng +0 -23
@@ -18,6 +18,7 @@ $LOAD_PATH.unshift((bindir + '../lib').realpath)
18
18
  require 'review/book'
19
19
  require 'review/tocparser'
20
20
  require 'review/tocprinter'
21
+ require 'review/version'
21
22
  require 'optparse'
22
23
 
23
24
  def main
@@ -41,56 +42,57 @@ def _main
41
42
  "outencoding" => "UTF-8"
42
43
  }
43
44
 
44
- parser = OptionParser.new
45
- parser.on('--inencoding=ENCODING', 'Set input encoding. (UTF-8, EUC, JIS, and SJIS)') {|enc|
45
+ opts = OptionParser.new
46
+ opts.version = ReVIEW::VERSION
47
+ opts.on('--inencoding=ENCODING', 'Set input encoding. (UTF-8, EUC, JIS, and SJIS)') {|enc|
46
48
  param["inencoding"] = enc
47
49
  }
48
- parser.on('--outencoding=ENCODING', 'Set output encoding. (UTF-8[default], EUC, JIS, and SJIS)') {|enc|
50
+ opts.on('--outencoding=ENCODING', 'Set output encoding. (UTF-8[default], EUC, JIS, and SJIS)') {|enc|
49
51
  param["outencoding"] = enc
50
52
  }
51
- parser.on('-a', '--all', 'print all chapters.') {
53
+ opts.on('-a', '--all', 'print all chapters.') {
52
54
  begin
53
55
  source = ReVIEW.book
54
56
  rescue ReVIEW::Error => err
55
57
  error_exit err.message
56
58
  end
57
59
  }
58
- parser.on('-p', '--part N', 'list only part N.') {|n|
60
+ opts.on('-p', '--part N', 'list only part N.') {|n|
59
61
  source = ReVIEW.book.part(Integer(n)) or
60
62
  error_exit "part #{n} does not exist in this book"
61
63
  }
62
- parser.on('-c', '--chapter C', 'list only chapter C.') {|c|
64
+ opts.on('-c', '--chapter C', 'list only chapter C.') {|c|
63
65
  begin
64
66
  source = ReVIEW::Book::Part.new(nil, 1, [ReVIEW.book.chapter(c)])
65
67
  rescue
66
68
  error_exit "chapter #{c} does not exist in this book"
67
69
  end
68
70
  }
69
- parser.on('-l', '--level N', 'list upto N level (1..4, default=4)') {|n|
71
+ opts.on('-l', '--level N', 'list upto N level (1..4, default=4)') {|n|
70
72
  upper = Integer(n)
71
73
  unless (0..4).include?(upper) # 0 is hidden option
72
74
  $stderr.puts "-l/--level option accepts only 1..4"
73
75
  exit 1
74
76
  end
75
77
  }
76
- parser.on('--text', 'output in plain text (default)') {
78
+ opts.on('--text', 'output in plain text (default)') {
77
79
  printer_class = ReVIEW::TextTOCPrinter
78
80
  }
79
- parser.on('--html', 'output in HTML (deprecated)') {
81
+ opts.on('--html', 'output in HTML (deprecated)') {
80
82
  printer_class = ReVIEW::HTMLTOCPrinter
81
83
  }
82
- parser.on('--idg', 'output in InDesign XML') {
84
+ opts.on('--idg', 'output in InDesign XML') {
83
85
  printer_class = ReVIEW::IDGTOCPrinter
84
86
  }
85
- parser.on('--help', 'print this message and quit.') {
86
- puts parser.help
87
+ opts.on('--help', 'print this message and quit.') {
88
+ puts opts.help
87
89
  exit 0
88
90
  }
89
91
  begin
90
- parser.parse!
92
+ opts.parse!
91
93
  rescue OptionParser::ParseError => err
92
94
  $stderr.puts err.message
93
- $stderr.puts parser.help
95
+ $stderr.puts opts.help
94
96
  exit 1
95
97
  end
96
98
  if source
@@ -98,7 +100,7 @@ def _main
98
100
  error_exit '-a/-s option and file arguments are exclusive'
99
101
  end
100
102
  else
101
- puts parser.help
103
+ puts opts.help
102
104
  exit 0
103
105
  end
104
106
 
@@ -8,22 +8,46 @@
8
8
  # For details of the GNU LGPL, see the file "COPYING".
9
9
 
10
10
  require 'fileutils'
11
+ require 'optparse'
12
+
13
+ require 'pathname'
14
+
15
+ bindir = Pathname.new(__FILE__).realpath.dirname
16
+ $LOAD_PATH.unshift((bindir + '../lib').realpath)
17
+
18
+ require 'review/version'
11
19
 
12
20
  def main
21
+ opts = OptionParser.new
22
+ opts.version = ReVIEW::VERSION
23
+ opts.banner = "Usage: #{File.basename($0)} dirname"
24
+ opts.on('-h', '--help', 'print this message and quit.') {
25
+ puts opts.help
26
+ exit 0
27
+ }
28
+ begin
29
+ opts.parse!
30
+ rescue OptionParser::ParseError => err
31
+ $stderr.puts err.message
32
+ $stderr.puts opts.help
33
+ exit 1
34
+ end
35
+
13
36
  if ARGV.empty?
14
- puts "Usage: #{File.basename($0)} dirname"
15
- exit
37
+ $stderr.puts opts.help
38
+ exit 1
16
39
  end
17
40
 
18
41
  initdir = File.expand_path(ARGV.shift)
19
42
  @review_dir = File.dirname(File.expand_path(__FILE__ + "./../"))
20
43
 
21
44
  generate_dir(initdir) do |dir|
22
- generate_review_setting_files(dir)
45
+ generate_catalog_file(dir)
23
46
  generate_sample(dir)
24
47
  generate_images_dir(dir)
25
48
  generate_cover_image(dir)
26
49
  generate_layout(dir)
50
+ generate_style(dir)
27
51
  generate_texmacro(dir)
28
52
  generate_config(dir)
29
53
  generate_rakefile(dir)
@@ -67,12 +91,18 @@ EOS
67
91
  end
68
92
  end
69
93
 
70
- def generate_review_setting_files(dir)
71
- File.open(dir + "/PREDEF", "w")
72
- File.open(dir + "/CHAPS", "w") do |file|
73
- file.write("#{File.basename(dir)}.re")
94
+ def generate_catalog_file(dir)
95
+ File.open(dir + "/catalog.yml", "w") do |file|
96
+ file.write <<-EOS
97
+ PREDEF:
98
+
99
+ CHAPS:
100
+ - #{File.basename(dir)}.re
101
+
102
+ POSTDEF:
103
+
104
+ EOS
74
105
  end
75
- File.open(dir + "/POSTDEF", "w")
76
106
  end
77
107
 
78
108
  def generate_images_dir(dir)
@@ -88,7 +118,7 @@ def generate_config(dir)
88
118
  end
89
119
 
90
120
  def generate_style(dir)
91
- File.open(dir + "/style.css", "w")
121
+ FileUtils.cp @review_dir + "/test/sample-book/src/style.css", dir
92
122
  end
93
123
 
94
124
  def generate_texmacro(dir)
@@ -13,6 +13,7 @@ require 'tmpdir'
13
13
  require 'yaml'
14
14
  require 'fileutils'
15
15
  require 'erb'
16
+ require 'optparse'
16
17
 
17
18
  require 'pathname'
18
19
  bindir = Pathname.new(__FILE__).realpath.dirname
@@ -21,48 +22,82 @@ $LOAD_PATH.unshift((bindir + '../lib').realpath)
21
22
  require 'review'
22
23
  require 'review/i18n'
23
24
 
25
+ include ReVIEW::LaTeXUtils
26
+
27
+ include FileUtils
28
+
24
29
  def error(msg)
25
30
  $stderr.puts "#{File.basename($0, '.*')}: error: #{msg}"
26
31
  exit 1
27
32
  end
28
33
 
29
- def usage
30
- $stderr.puts "Usage: #{$0} configfile"
31
- exit 0
34
+ def warn(msg)
35
+ $stderr.puts "#{File.basename($0, '.*')}: warning: #{msg}"
32
36
  end
33
37
 
34
- def check_book(values)
35
- pdf_file = values["bookname"]+".pdf"
38
+ def check_book(config)
39
+ pdf_file = config["bookname"]+".pdf"
36
40
  if File.exist? pdf_file
37
41
  error "file already exists:#{pdf_file}"
38
42
  end
39
43
  end
40
44
 
41
- def build_path(values)
42
- if values["debug"].nil?
43
- Dir.mktmpdir+"/#{values["bookname"]}-pdf"
45
+ def build_path(config)
46
+ "./#{config["bookname"]}-pdf"
47
+ end
48
+
49
+ def check_compile_status(ignore_errors)
50
+ return unless @compile_errors
51
+
52
+ if ignore_errors
53
+ $stderr.puts "compile error, but try to generate PDF file"
44
54
  else
45
- "./#{values["bookname"]}-pdf"
55
+ error "compile error, No PDF file output."
46
56
  end
47
57
  end
48
58
 
59
+
49
60
  def main
50
- usage if ARGV.size != 1
61
+ config = ReVIEW::Configure.values
62
+ cmd_config = Hash.new
63
+
64
+ opts = OptionParser.new
65
+ opts.banner = "Usage: #{File.basename($0)} configfile"
66
+ opts.version = ReVIEW::VERSION
67
+ opts.on('--help', 'Prints this message and quit.') do
68
+ puts opts.help
69
+ exit 0
70
+ end
71
+ opts.on('--[no-]debug', 'Keep temporary files.') do |debug|
72
+ cmd_config["debug"] = debug
73
+ end
74
+ opts.on('--ignore-errors', 'Ignore review-compile errors.') do
75
+ cmd_config["ignore-errors"] = true
76
+ end
51
77
 
78
+ opts.parse!(ARGV)
79
+ if ARGV.size != 1
80
+ puts opts.help
81
+ exit 0
82
+ end
52
83
  yamlfile = ARGV[0]
53
- values = ReVIEW::Configure.values.merge(YAML.load_file(yamlfile))
54
- check_book(values)
84
+ config.merge!(YAML.load_file(yamlfile))
85
+ # YAML configs will be overridden by command line options.
86
+ config.merge!(cmd_config)
87
+
88
+ check_book(config)
55
89
  @basedir = Dir.pwd
56
- @path = build_path(values)
57
- bookname = values["bookname"]
90
+ @path = build_path(config)
91
+ bookname = config["bookname"]
58
92
  Dir.mkdir(@path)
59
93
 
60
94
  @chaps_fnames = Hash.new{|h, key| h[key] = ""}
95
+ @compile_errors = nil
61
96
 
62
97
  ReVIEW::Book.load(@basedir).parts.each do |part|
63
98
  if part.name.present?
64
99
  if part.file?
65
- output_parts(part.name, values)
100
+ output_parts(part.name, config)
66
101
  @chaps_fnames["CHAPS"] << %Q|\\input{#{part.name}.tex}\n|
67
102
  else
68
103
  @chaps_fnames["CHAPS"] << %Q|\\part{#{part.name}}\n|
@@ -71,24 +106,26 @@ def main
71
106
 
72
107
  part.chapters.each do |chap|
73
108
  filename = "#{File.basename(chap.path, ".*")}.tex"
74
- output_chaps(filename, values)
109
+ output_chaps(filename, config)
75
110
  @chaps_fnames["PREDEF"] << "\\input{#{filename}}\n" if chap.on_PREDEF?
76
111
  @chaps_fnames["CHAPS"] << "\\input{#{filename}}\n" if chap.on_CHAPS?
77
112
  @chaps_fnames["POSTDEF"] << "\\input{#{filename}}\n" if chap.on_POSTDEF?
78
113
  end
79
114
  end
80
115
 
81
- values["pre_str"] = @chaps_fnames["PREDEF"]
82
- values["chap_str"] = @chaps_fnames["CHAPS"]
83
- values["post_str"] = @chaps_fnames["POSTDEF"]
116
+ check_compile_status(config["ignore-errors"])
117
+
118
+ config["pre_str"] = @chaps_fnames["PREDEF"]
119
+ config["chap_str"] = @chaps_fnames["CHAPS"]
120
+ config["post_str"] = @chaps_fnames["POSTDEF"]
84
121
 
85
- values["usepackage"] = ""
86
- if values["texstyle"]
87
- values["usepackage"] = "\\usepackage{#{values['texstyle']}}"
122
+ config["usepackage"] = ""
123
+ if config["texstyle"]
124
+ config["usepackage"] = "\\usepackage{#{config['texstyle']}}"
88
125
  end
89
126
 
90
127
  %w[aut csl trl dsr ill cov edt].each do |item|
91
- values[item] = [values[item]] if !values[item].nil? && values[item].instance_of?(String)
128
+ config[item] = [config[item]] if !config[item].nil? && config[item].instance_of?(String)
92
129
  end
93
130
 
94
131
  copy_images("./images", "#{@path}/images")
@@ -96,52 +133,50 @@ def main
96
133
  copyStyToDir(Dir.pwd, @path, "tex")
97
134
 
98
135
  Dir.chdir(@path) {
99
- template = get_template(values)
136
+ template = get_template(config)
100
137
  File.open("./book.tex", "wb"){|f| f.write(template)}
101
138
 
102
139
  ## do compile
103
- enc = values["params"].to_s.split(/\s+/).find{|i| i =~ /\A--outencoding=/ }
104
- kanji = enc ? enc.split(/=/).last.gsub(/-/, '').downcase : 'utf8'
105
- texcommand = values["texcommand"] || "platex"
106
- fork {
107
- exec("#{texcommand} -kanji=#{kanji} book.tex")
108
- }
109
- Process.waitall
110
- fork {
111
- exec("#{texcommand} -kanji=#{kanji} book.tex")
112
- }
113
- Process.waitall
114
- fork {
115
- exec("#{texcommand} -kanji=#{kanji} book.tex")
116
- }
117
- if texcommand != "lualatex"
118
- Process.waitall
119
- fork {
120
- exec("dvipdfmx -d 5 book.dvi")
121
- }
122
- Process.waitall
140
+ enc = config["params"].to_s.split(/\s+/).find{|i| i =~ /\A--outencoding=/ }
141
+ kanji = 'utf8'
142
+ if enc
143
+ kanji = enc.split(/\=/).last.gsub(/-/, '').downcase
144
+ end
145
+ texcommand = config["texcommand"] || "platex"
146
+ 3.times do
147
+ system("#{texcommand} -kanji=#{kanji} book.tex")
148
+ end
149
+ if File.exist?("book.dvi")
150
+ system("dvipdfmx -d 5 book.dvi")
123
151
  end
124
152
  }
125
153
  FileUtils.cp("#{@path}/book.pdf", "#{@basedir}/#{bookname}.pdf")
126
- end
127
154
 
128
- def output_chaps(filename, values)
129
- fork {
130
- STDOUT.reopen("#{@path}/#{filename}")
131
- $stderr.puts "compiling #{filename}"
132
- exec("review-compile --target=latex --level=#{values["secnolevel"]} --toclevel=#{values["toclevel"]} #{values["params"]} #{filename}")
133
- }
134
- Process.waitall
155
+ unless config["debug"]
156
+ remove_entry_secure @path
157
+ end
135
158
  end
136
159
 
137
- def output_parts(filename, values)
138
- fork {
139
- STDOUT.reopen("#{@path}/#{filename}.tex")
140
- $stderr.puts "compiling #{filename}.tex"
141
- exec("review-compile --target=latex --level=#{values["secnolevel"]} --toclevel=#{values["toclevel"]} #{values["params"]} #{filename}.re | sed -e s/\\chapter{/\\part{/")
160
+ def output_chaps(filename, config)
161
+ $stderr.puts "compiling #{filename}"
162
+ cmd = "#{ReVIEW::MakerHelper.bindir}/review-compile --target=latex --level=#{config["secnolevel"]} --toclevel=#{config["toclevel"]} #{config["params"]} #{filename} > #{@path}/#{filename}"
163
+ if system cmd
164
+ # OK
165
+ else
166
+ @compile_errors = true
167
+ warn cmd
168
+ end
169
+ end
142
170
 
143
- }
144
- Process.waitall
171
+ def output_parts(filename, config)
172
+ $stderr.puts "compiling #{filename}.tex"
173
+ cmd = "review-compile --target=latex --level=#{config["secnolevel"]} --toclevel=#{config["toclevel"]} #{config["params"]} #{filename}.re | sed -e s/\\chapter{/\\part{/ > #{@path}/#{filename}.tex"
174
+ if system cmd
175
+ # OK
176
+ else
177
+ @compile_errors = true
178
+ warn cmd
179
+ end
145
180
  end
146
181
 
147
182
 
@@ -149,16 +184,15 @@ def copy_images(from, to)
149
184
  if File.exist?(from)
150
185
  Dir.mkdir(to)
151
186
  ReVIEW::MakerHelper.copy_images_to_dir(from, to)
152
- Dir.chdir(to) {
153
- fork {
154
- begin
155
- exec("extractbb *.png *.jpg *.pdf */*.jpg */*.png */*.pdf;extractbb -m *.png *.jpg *.pdf */*.jpg */*.png */*.pdf")
156
- rescue
157
- exec("ebb *.png *.jpg *.pdf */*.jpg */*.png */*.pdf")
158
- end
187
+ Dir.chdir(to) do
188
+ images = Dir.glob("**/*").find_all{|f|
189
+ File.file?(f) and f =~ /\.(jpg|jpeg|png|pdf)\z/
159
190
  }
160
- }
161
- Process.waitall
191
+ system("extractbb", *images)
192
+ unless system("extractbb", "-m", *images)
193
+ system("ebb", *images)
194
+ end
195
+ end
162
196
  end
163
197
  end
164
198
 
@@ -171,42 +205,42 @@ def make_custom_titlepage(coverfile)
171
205
  end
172
206
  end
173
207
 
174
- def get_template(values)
175
- dclass = values["texdocumentclass"] || []
208
+ def get_template(config)
209
+ dclass = config["texdocumentclass"] || []
176
210
  documentclass = dclass[0] || "jsbook"
177
211
  documentclassoption = dclass[1] || "oneside"
178
212
 
179
213
  okuduke = ""
180
214
  authors = ""
181
- if !values["aut"].nil? && !values["aut"].empty?
182
- okuduke += "著 者 & #{values["aut"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
183
- authors = values["aut"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("author_postfix")
215
+ if !config["aut"].nil? && !config["aut"].empty?
216
+ okuduke += "著 者 & #{escape_latex(config["aut"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
217
+ authors = config["aut"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("author_postfix")
184
218
  end
185
- if !values["csl"].nil? && !values["csl"].empty?
186
- okuduke += "監 修 & #{values["csl"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
187
- authors += " \\\\\n"+values["csl"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("supervisor_postfix")
219
+ if !config["csl"].nil? && !config["csl"].empty?
220
+ okuduke += "監 修 & #{escape_latex(config["csl"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
221
+ authors += " \\\\\n"+config["csl"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("supervisor_postfix")
188
222
  end
189
- if !values["trl"].nil? && !values["trl"].empty?
190
- okuduke += "翻 訳 & #{values["trl"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
191
- authors += " \\\\\n"+values["trl"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("translator_postfix")
223
+ if !config["trl"].nil? && !config["trl"].empty?
224
+ okuduke += "翻 訳 & #{escape_latex(config["trl"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
225
+ authors += " \\\\\n"+config["trl"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("translator_postfix")
192
226
  end
193
- if !values["dsr"].nil? && !values["dsr"].empty?
194
- okuduke += "デザイン & #{values["dsr"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
227
+ if !config["dsr"].nil? && !config["dsr"].empty?
228
+ okuduke += "デザイン & #{escape_latex(config["dsr"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
195
229
  end
196
- if !values["ill"].nil? && !values["ill"].empty?
197
- okuduke += "イラスト & #{values["ill"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
230
+ if !config["ill"].nil? && !config["ill"].empty?
231
+ okuduke += "イラスト & #{escape_latex(config["ill"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
198
232
  end
199
- if !values["cov"].nil? && !values["cov"].empty?
200
- okuduke += "表 紙 & #{values["cov"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
233
+ if !config["cov"].nil? && !config["cov"].empty?
234
+ okuduke += "表 紙 & #{escape_latex(config["cov"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
201
235
  end
202
- if !values["edt"].nil? && !values["edt"].empty?
203
- okuduke += "編集者 & #{values["edt"].join(ReVIEW::I18n.t("names_splitter"))} \\\\\n"
236
+ if !config["edt"].nil? && !config["edt"].empty?
237
+ okuduke += "編集者 & #{escape_latex(config["edt"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
204
238
  end
205
239
  okuduke += <<EOB
206
- 発行所 & #{values["prt"]} \\\\
240
+ 発行所 & #{config["prt"]} \\\\
207
241
  EOB
208
242
 
209
- custom_titlepage = make_custom_titlepage(values["coverfile"])
243
+ custom_titlepage = make_custom_titlepage(config["coverfile"])
210
244
 
211
245
  template = File.expand_path(File.dirname(__FILE__) +
212
246
  '/../lib/review/review.tex.erb')
@@ -216,6 +250,7 @@ EOB
216
250
  end
217
251
 
218
252
  erb = ERB.new(File.open(template).read)
253
+ values = config # must be 'values' for legacy files
219
254
  erb.result(binding)
220
255
  end
221
256