Class: ReVIEW::TOPBuilder
Constant Summary
Constants inherited
from Builder
Builder::CAPTION_TITLES
Instance Attribute Summary
Attributes inherited from Builder
#doc_status, #location
Attributes included from Loggable
#logger
Instance Method Summary
collapse
-
#base_block(type, lines, caption = nil) ⇒ Object
-
#base_parablock(type, lines, caption = nil) ⇒ Object
-
#bibpaper_header(id, caption) ⇒ Object
-
#circle_begin(_level, _label, caption) ⇒ Object
-
#comment(lines, comment = nil) ⇒ Object
-
#common_block_begin(type, _level, _label, caption = nil) ⇒ Object
-
#common_block_end(type, _level) ⇒ Object
-
#common_column_begin(type, caption) ⇒ Object
-
#common_column_end(type) ⇒ Object
-
#compile_href(url, label) ⇒ Object
-
#compile_kw(word, alt) ⇒ Object
-
#compile_ruby(base, ruby) ⇒ Object
-
#dd(lines) ⇒ Object
-
#dt(line) ⇒ Object
-
#emlistnum(lines, caption = nil, _lang = nil) ⇒ Object
-
#endnote_begin ⇒ Object
-
#endnote_end ⇒ Object
-
#endnote_item(id) ⇒ Object
-
#footnote(id, str) ⇒ Object
-
#headline(level, _label, caption) ⇒ Object
-
#image(lines, id, caption, metric = nil) ⇒ Object
-
#image_header(id, caption) ⇒ Object
-
#indepimage(_lines, id, caption = nil, metric = nil) ⇒ Object
(also: #numberlessimage)
-
#inline_ami(str) ⇒ Object
-
#inline_b(str) ⇒ Object
(also: #inline_strong)
-
#inline_balloon(str) ⇒ Object
-
#inline_bib(id) ⇒ Object
-
#inline_bou(str) ⇒ Object
-
#inline_code(str) ⇒ Object
-
#inline_comment(str) ⇒ Object
-
#inline_del(str) ⇒ Object
-
#inline_endnote(id) ⇒ Object
-
#inline_fn(id) ⇒ Object
-
#inline_hidx(str) ⇒ Object
-
#inline_hint(str) ⇒ Object
-
#inline_i(str) ⇒ Object
-
#inline_icon(id) ⇒ Object
-
#inline_idx(str) ⇒ Object
-
#inline_ins(str) ⇒ Object
-
#inline_keytop(str) ⇒ Object
-
#inline_labelref(idref) ⇒ Object
(also: #inline_ref)
-
#inline_m(str) ⇒ Object
-
#inline_maru(str) ⇒ Object
-
#inline_pageref(idref) ⇒ Object
-
#inline_sub(str) ⇒ Object
-
#inline_sup(str) ⇒ Object
-
#inline_tcy(str) ⇒ Object
-
#inline_tt(str) ⇒ Object
-
#inline_ttb(str) ⇒ Object
(also: #inline_ttbold)
-
#inline_tti(str) ⇒ Object
-
#inline_ttibold(str) ⇒ Object
-
#inline_u(str) ⇒ Object
-
#list(lines, id, caption, lang = nil) ⇒ Object
-
#list_body(_id, lines, _lang) ⇒ Object
-
#list_header(id, caption, _lang) ⇒ Object
-
#listnum(lines, id, caption, lang = nil) ⇒ Object
-
#listnum_body(lines, _lang) ⇒ Object
-
#noindent ⇒ Object
-
#nonum_begin(level, _label, caption) ⇒ Object
-
#notoc_begin(level, _label, caption) ⇒ Object
-
#ol_item(lines, num) ⇒ Object
-
#read(lines) ⇒ Object
(also: #lead)
-
#table(lines, id = nil, caption = nil) ⇒ Object
-
#table_end ⇒ Object
-
#texequation(lines, id = nil, caption = '') ⇒ Object
-
#texequation_header(id, caption) ⇒ Object
-
#th(str) ⇒ Object
-
#ul_item(lines) ⇒ Object
#best, #bibpaper, #bibpaper_bibpaper, #bpo, #caution, #centering, #circle_end, #cmd, #column_begin, #column_end, #dl_begin, #dl_end, #dtp, #edition_begin, #edition_end, #emlist, #expert, #extname, #flushright, #hood_begin, #hood_end, #imgtable, #important, #info, #inline_br, #inline_chap, #inline_chapref, #inline_dtp, #inline_hd_chap, #inline_raw, #inline_uchar, #insideout_begin, #insideout_end, #insn, #label, #link, #memo, #nodisp_begin, #nodisp_end, #nofunc_text, #nonum_end, #note, #notice, #notoc_end, #ol_begin, #ol_end, #olnum, #paragraph, #planning, #point, #post_paragraph, #practice, #pre_paragraph, #quote, #ref_begin, #ref_end, #reference, #result, #security, #shoot, #solve_nest, #source, #sup_begin, #sup_end, #table_begin, #table_header, #term, #text, #tip, #tr, #ul_begin, #ul_end, #warning, #world_begin, #world_end, #xcolumn_begin, #xcolumn_end
Methods included from TextUtils
#add_space?, #detab, #join_lines_to_paragraph, #split_paragraph
Methods inherited from Builder
#beginchild, #bibpaper, #bind, #blankline, #caption_top?, #captionblock, #check_nest, #check_nested_minicolumn, #check_printendnotes, #compile_inline, #detab, #embed, #emtable, #endchild, #endnote, #escape, #extract_chapter_id, #firstlinenum, #get_chap, #graph, #graph_aafigure, #graph_blockdiag, #graph_gnuplot, #graph_graphviz, #graph_plantuml, #handle_metric, #highlight?, #image_ext, #in_minicolumn?, #initialize, #inline_chap, #inline_chapref, #inline_column, #inline_column_chap, #inline_embed, #inline_eq, #inline_hd, #inline_href, #inline_img, #inline_imgref, #inline_include, #inline_kw, #inline_list, #inline_raw, #inline_ruby, #inline_table, #inline_title, #inline_w, #inline_wb, #line_num, #load_words, #minicolumn_block_name?, #over_secnolevel?, #parse_metric, #parse_table_rows, #post_paragraph, #pre_paragraph, #previous_list_type, #print, #printendnotes, #puts, #raw, #result, #result_metric, #solve_nest, #source, #system_graph, #table_row_separator_regexp, #table_rows, #target_name, #text, #tsize, #ul_item_begin, #ul_item_end
Methods included from Loggable
#app_error, #debug, #error, #error!, #warn
Instance Method Details
#base_block(type, lines, caption = nil) ⇒ Object
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# File 'lib/review/topbuilder.rb', line 128
def base_block(type, lines, caption = nil)
blank
puts "◆→開始:#{@titles[type]}←◆"
if caption_top?('list') && caption.present?
puts "■#{compile_inline(caption)}"
end
puts lines.join("\n")
if !caption_top?('list') && caption.present?
puts "■#{compile_inline(caption)}"
end
puts "◆→終了:#{@titles[type]}←◆"
blank
end
|
#base_parablock(type, lines, caption = nil) ⇒ Object
142
143
144
145
146
147
148
149
|
# File 'lib/review/topbuilder.rb', line 142
def base_parablock(type, lines, caption = nil)
blank
puts "◆→開始:#{@titles[type]}←◆"
puts "■#{compile_inline(caption)}" if caption.present?
puts split_paragraph(lines).join("\n")
puts "◆→終了:#{@titles[type]}←◆"
blank
end
|
438
439
440
441
|
# File 'lib/review/topbuilder.rb', line 438
def (id, caption)
print "[#{@chapter.bibpaper(id).number}]"
puts " #{compile_inline(caption)}"
end
|
#circle_begin(_level, _label, caption) ⇒ Object
537
538
539
|
# File 'lib/review/topbuilder.rb', line 537
def circle_begin(_level, _label, caption)
puts "・\t#{caption}"
end
|
272
273
274
275
276
277
278
279
280
281
|
# File 'lib/review/topbuilder.rb', line 272
def (lines, = nil)
return unless @book.config['draft']
lines ||= []
unless .blank?
lines.unshift()
end
str = lines.join("\n")
puts "◆→#{str}←◆"
end
|
#common_block_begin(type, _level, _label, caption = nil) ⇒ Object
472
473
474
475
476
|
# File 'lib/review/topbuilder.rb', line 472
def common_block_begin(type, _level, _label, caption = nil)
blank
puts "◆→開始:#{@titles[type]}←◆"
puts '■' + compile_inline(caption) if caption.present?
end
|
#common_block_end(type, _level) ⇒ Object
478
479
480
481
|
# File 'lib/review/topbuilder.rb', line 478
def common_block_end(type, _level)
puts "◆→終了:#{@titles[type]}←◆"
blank
end
|
#common_column_begin(type, caption) ⇒ Object
461
462
463
464
465
|
# File 'lib/review/topbuilder.rb', line 461
def common_column_begin(type, caption)
blank
puts "◆→開始:#{@titles[type]}←◆"
puts "■#{compile_inline(caption)}"
end
|
#common_column_end(type) ⇒ Object
467
468
469
470
|
# File 'lib/review/topbuilder.rb', line 467
def common_column_end(type)
puts "◆→終了:#{@titles[type]}←◆"
blank
end
|
#compile_href(url, label) ⇒ Object
322
323
324
325
326
327
328
|
# File 'lib/review/topbuilder.rb', line 322
def compile_href(url, label)
if label
"#{label}(△#{url}☆)"
else
"△#{url}☆"
end
end
|
#compile_kw(word, alt) ⇒ Object
315
316
317
318
319
320
|
# File 'lib/review/topbuilder.rb', line 315
def compile_kw(word, alt)
if alt
then "★#{word}☆(#{alt.strip})"
else "★#{word}☆"
end
end
|
#compile_ruby(base, ruby) ⇒ Object
311
312
313
|
# File 'lib/review/topbuilder.rb', line 311
def compile_ruby(base, ruby)
"#{base}◆→DTP連絡:「#{base}」に「#{ruby}」とルビ←◆"
end
|
#dd(lines) ⇒ Object
79
80
81
82
83
|
# File 'lib/review/topbuilder.rb', line 79
def dd(lines)
split_paragraph(lines).each do |paragraph|
puts "\t#{paragraph.delete("\n")}"
end
end
|
75
76
77
|
# File 'lib/review/topbuilder.rb', line 75
def dt(line)
puts "★#{line}☆"
end
|
#emlistnum(lines, caption = nil, _lang = nil) ⇒ Object
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File 'lib/review/topbuilder.rb', line 151
def emlistnum(lines, caption = nil, _lang = nil)
blank
puts "◆→開始:#{@titles['emlist']}←◆"
if caption_top?('list') && caption.present?
puts "■#{compile_inline(caption)}"
end
lines.each_with_index do |line, i|
puts((i + 1).to_s.rjust(2) + ": #{line}")
end
if !caption_top?('list') && caption.present?
puts "■#{compile_inline(caption)}"
end
puts "◆→終了:#{@titles['emlist']}←◆"
blank
end
|
#endnote_begin ⇒ Object
299
300
301
|
# File 'lib/review/topbuilder.rb', line 299
def endnote_begin
puts '◆→開始:後注←◆'
end
|
#endnote_end ⇒ Object
303
304
305
|
# File 'lib/review/topbuilder.rb', line 303
def endnote_end
puts '◆→終了:後注←◆'
end
|
#endnote_item(id) ⇒ Object
307
308
309
|
# File 'lib/review/topbuilder.rb', line 307
def endnote_item(id)
puts "【後注#{@chapter.endnote(id).number}】#{compile_inline(@chapter.endnote(id).content)}"
end
|
283
284
285
|
# File 'lib/review/topbuilder.rb', line 283
def (id, str)
puts "【注#{@chapter.(id).number}】#{compile_inline(str)}"
end
|
#headline(level, _label, caption) ⇒ Object
62
63
64
65
|
# File 'lib/review/topbuilder.rb', line 62
def headline(level, _label, caption)
prefix, _anchor = headline_prefix(level)
puts %Q(■H#{level}■#{prefix}#{compile_inline(caption)})
end
|
#image(lines, id, caption, metric = nil) ⇒ Object
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
# File 'lib/review/topbuilder.rb', line 193
def image(lines, id, caption, metric = nil)
metrics = parse_metric('top', metric)
metrics = " #{metrics}" if metrics.present?
blank
puts "◆→開始:#{@titles['image']}←◆"
if caption_top?('image')
(id, caption)
blank
end
if @chapter.image_bound?(id)
puts "◆→#{@chapter.image(id).path}#{metrics}←◆"
else
warn "image not bound: #{id}", location: location
lines.each do |line|
puts line
end
end
unless caption_top?('image')
blank
(id, caption)
end
puts "◆→終了:#{@titles['image']}←◆"
blank
end
|
218
219
220
221
222
223
224
|
# File 'lib/review/topbuilder.rb', line 218
def (id, caption)
if get_chap
puts "#{I18n.t('image')}#{I18n.t('format_number', [get_chap, @chapter.image(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
else
puts "#{I18n.t('image')}#{I18n.t('format_number_without_chapter', [@chapter.image(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
end
end
|
#indepimage(_lines, id, caption = nil, metric = nil) ⇒ Object
Also known as:
numberlessimage
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
|
# File 'lib/review/topbuilder.rb', line 498
def indepimage(_lines, id, caption = nil, metric = nil)
metrics = parse_metric('top', metric)
metrics = " #{metrics}" if metrics.present?
blank
if caption_top?('image') && caption.present?
puts "図 #{compile_inline(caption)}"
end
begin
puts "◆→画像 #{@chapter.image(id).path.sub(%r{\A\./}, '')}#{metrics}←◆"
rescue
warn "image not bound: #{id}", location: location
puts "◆→画像 #{id}←◆"
end
if !caption_top?('image') && caption.present?
puts "図 #{compile_inline(caption)}"
end
blank
end
|
#inline_ami(str) ⇒ Object
354
355
356
|
# File 'lib/review/topbuilder.rb', line 354
def inline_ami(str)
"#{str}◆→DTP連絡:「#{str}」に網カケ←◆"
end
|
#inline_b(str) ⇒ Object
Also known as:
inline_strong
362
363
364
|
# File 'lib/review/topbuilder.rb', line 362
def inline_b(str)
"★#{str}☆"
end
|
#inline_balloon(str) ⇒ Object
415
416
417
|
# File 'lib/review/topbuilder.rb', line 415
def inline_balloon(str)
%Q(\t←#{str.gsub(/@maru\[(\d+)\]/, inline_maru('\1'))})
end
|
#inline_bib(id) ⇒ Object
443
444
445
446
447
|
# File 'lib/review/topbuilder.rb', line 443
def inline_bib(id)
%Q([#{@chapter.bibpaper(id).number}])
rescue KeyError
app_error "unknown bib: #{id}"
end
|
#inline_bou(str) ⇒ Object
407
408
409
|
# File 'lib/review/topbuilder.rb', line 407
def inline_bou(str)
"#{str}◆→DTP連絡:「#{str}」に傍点←◆"
end
|
#inline_code(str) ⇒ Object
519
520
521
|
# File 'lib/review/topbuilder.rb', line 519
def inline_code(str)
"△#{str}☆"
end
|
419
420
421
422
423
424
425
|
# File 'lib/review/topbuilder.rb', line 419
def (str)
if @book.config['draft']
"◆→#{str}←◆"
else
''
end
end
|
#inline_del(str) ⇒ Object
390
391
392
|
# File 'lib/review/topbuilder.rb', line 390
def inline_del(str)
"◆→開始:削除表現←◆#{str}◆→終了:削除表現←◆"
end
|
#inline_endnote(id) ⇒ Object
293
294
295
296
297
|
# File 'lib/review/topbuilder.rb', line 293
def inline_endnote(id)
"【後注#{@chapter.endnote(id).number}】"
rescue KeyError
app_error "unknown endnote: #{id}"
end
|
#inline_fn(id) ⇒ Object
287
288
289
290
291
|
# File 'lib/review/topbuilder.rb', line 287
def inline_fn(id)
"【注#{@chapter.(id).number}】"
rescue KeyError
app_error "unknown footnote: #{id}"
end
|
#inline_hidx(str) ⇒ Object
350
351
352
|
# File 'lib/review/topbuilder.rb', line 350
def inline_hidx(str)
"◆→索引項目:#{str}←◆"
end
|
#inline_hint(str) ⇒ Object
338
339
340
|
# File 'lib/review/topbuilder.rb', line 338
def inline_hint(str)
"◆→ヒントスタイルここから←◆#{str}◆→ヒントスタイルここまで←◆"
end
|
#inline_i(str) ⇒ Object
358
359
360
|
# File 'lib/review/topbuilder.rb', line 358
def inline_i(str)
"▲#{str}☆"
end
|
#inline_icon(id) ⇒ Object
398
399
400
401
402
403
404
405
|
# File 'lib/review/topbuilder.rb', line 398
def inline_icon(id)
begin
"◆→画像 #{@chapter.image(id).path.sub(%r{\A\./}, '')}←◆"
rescue
warn "image not bound: #{id}", location: location
"◆→画像 #{id}←◆"
end
end
|
#inline_idx(str) ⇒ Object
346
347
348
|
# File 'lib/review/topbuilder.rb', line 346
def inline_idx(str)
"#{str}◆→索引項目:#{str}←◆"
end
|
#inline_ins(str) ⇒ Object
386
387
388
|
# File 'lib/review/topbuilder.rb', line 386
def inline_ins(str)
"◆→開始:挿入表現←◆#{str}◆→終了:挿入表現←◆"
end
|
#inline_keytop(str) ⇒ Object
411
412
413
|
# File 'lib/review/topbuilder.rb', line 411
def inline_keytop(str)
"#{str}◆→キートップ#{str}←◆"
end
|
#inline_labelref(idref) ⇒ Object
Also known as:
inline_ref
527
528
529
|
# File 'lib/review/topbuilder.rb', line 527
def inline_labelref(idref)
"「◆→#{idref}←◆」" end
|
#inline_m(str) ⇒ Object
427
428
429
430
431
432
433
434
435
436
|
# File 'lib/review/topbuilder.rb', line 427
def inline_m(str)
if @book.config['math_format'] == 'imgmath'
math_str = '$' + str + '$'
key = Digest::SHA256.hexdigest(str)
img_path = @img_math.defer_math_image(math_str, key)
%Q(◆→TeX式ここから←◆◆→math:#{File.basename(img_path)}←◆◆→TeX式ここまで←◆)
else
%Q(◆→TeX式ここから←◆#{str}◆→TeX式ここまで←◆)
end
end
|
#inline_maru(str) ⇒ Object
342
343
344
|
# File 'lib/review/topbuilder.rb', line 342
def inline_maru(str)
"#{str}◆→丸数字#{str}←◆"
end
|
533
534
535
|
# File 'lib/review/topbuilder.rb', line 533
def (idref)
"●ページ◆→#{idref}←◆" end
|
#inline_sub(str) ⇒ Object
334
335
336
|
# File 'lib/review/topbuilder.rb', line 334
def inline_sub(str)
"#{str}◆→DTP連絡:「#{str}」は下付き←◆"
end
|
#inline_sup(str) ⇒ Object
330
331
332
|
# File 'lib/review/topbuilder.rb', line 330
def inline_sup(str)
"#{str}◆→DTP連絡:「#{str}」は上付き←◆"
end
|
#inline_tcy(str) ⇒ Object
394
395
396
|
# File 'lib/review/topbuilder.rb', line 394
def inline_tcy(str)
"◆→開始:回転←◆#{str}◆→終了:縦回転←◆"
end
|
#inline_tt(str) ⇒ Object
368
369
370
|
# File 'lib/review/topbuilder.rb', line 368
def inline_tt(str)
"△#{str}☆"
end
|
#inline_ttb(str) ⇒ Object
Also known as:
inline_ttbold
372
373
374
|
# File 'lib/review/topbuilder.rb', line 372
def inline_ttb(str)
"★#{str}☆◆→等幅フォント太字←◆"
end
|
#inline_tti(str) ⇒ Object
378
379
380
|
# File 'lib/review/topbuilder.rb', line 378
def inline_tti(str)
"▲#{str}☆◆→等幅フォントイタ←◆"
end
|
#inline_ttibold(str) ⇒ Object
523
524
525
|
# File 'lib/review/topbuilder.rb', line 523
def inline_ttibold(str)
"▲#{str}☆◆→等幅フォント太字イタ←◆"
end
|
#inline_u(str) ⇒ Object
382
383
384
|
# File 'lib/review/topbuilder.rb', line 382
def inline_u(str)
"@#{str}@◆→@〜@部分に下線←◆"
end
|
#list(lines, id, caption, lang = nil) ⇒ Object
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# File 'lib/review/topbuilder.rb', line 94
def list(lines, id, caption, lang = nil)
blank
puts "◆→開始:#{@titles['list']}←◆"
begin
if caption_top?('list')
(id, caption, lang)
blank
end
list_body(id, lines, lang)
unless caption_top?('list')
blank
(id, caption, lang)
end
rescue KeyError
app_error "no such list: #{id}"
end
puts "◆→終了:#{@titles['list']}←◆"
blank
end
|
#list_body(_id, lines, _lang) ⇒ Object
122
123
124
125
126
|
# File 'lib/review/topbuilder.rb', line 122
def list_body(_id, lines, _lang)
lines.each do |line|
puts detab(line)
end
end
|
114
115
116
117
118
119
120
|
# File 'lib/review/topbuilder.rb', line 114
def (id, caption, _lang)
if get_chap
puts %Q(#{I18n.t('list')}#{I18n.t('format_number', [get_chap, @chapter.list(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)})
else
puts %Q(#{I18n.t('list')}#{I18n.t('format_number_without_chapter', [@chapter.list(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)})
end
end
|
#listnum(lines, id, caption, lang = nil) ⇒ Object
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# File 'lib/review/topbuilder.rb', line 167
def listnum(lines, id, caption, lang = nil)
blank
puts "◆→開始:#{@titles['list']}←◆"
begin
if caption_top?('list') && caption.present?
(id, caption, lang)
blank
end
listnum_body(lines, lang)
if !caption_top?('list') && caption.present?
blank
(id, caption, lang)
end
rescue KeyError
app_error "no such list: #{id}"
end
puts "◆→終了:#{@titles['list']}←◆"
blank
end
|
#listnum_body(lines, _lang) ⇒ Object
187
188
189
190
191
|
# File 'lib/review/topbuilder.rb', line 187
def listnum_body(lines, _lang)
lines.each_with_index do |line, i|
puts((i + 1).to_s.rjust(2) + ": #{line}")
end
end
|
449
450
451
|
# File 'lib/review/topbuilder.rb', line 449
def noindent
puts '◆→DTP連絡:次の1行インデントなし←◆'
end
|
#nonum_begin(level, _label, caption) ⇒ Object
453
454
455
|
# File 'lib/review/topbuilder.rb', line 453
def nonum_begin(level, _label, caption)
puts "■H#{level}■#{compile_inline(caption)}"
end
|
#notoc_begin(level, _label, caption) ⇒ Object
457
458
459
|
# File 'lib/review/topbuilder.rb', line 457
def notoc_begin(level, _label, caption)
puts "■H#{level}■#{compile_inline(caption)}◆→DTP連絡:目次に掲載しない←◆"
end
|
#ol_item(lines, num) ⇒ Object
71
72
73
|
# File 'lib/review/topbuilder.rb', line 71
def ol_item(lines, num)
puts "#{num}\t#{join_lines_to_paragraph(lines)}"
end
|
#read(lines) ⇒ Object
Also known as:
lead
85
86
87
88
89
90
|
# File 'lib/review/topbuilder.rb', line 85
def read(lines)
puts "◆→開始:#{@titles['lead']}←◆"
puts split_paragraph(lines).join("\n")
puts "◆→終了:#{@titles['lead']}←◆"
blank
end
|
#table(lines, id = nil, caption = nil) ⇒ Object
257
258
259
260
261
262
263
|
# File 'lib/review/topbuilder.rb', line 257
def table(lines, id = nil, caption = nil)
blank
puts "◆→開始:#{@titles['table']}←◆"
super(lines, id, caption, true)
puts "◆→終了:#{@titles['table']}←◆"
blank
end
|
#table_end ⇒ Object
269
270
|
# File 'lib/review/topbuilder.rb', line 269
def table_end
end
|
#texequation(lines, id = nil, caption = '') ⇒ Object
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
# File 'lib/review/topbuilder.rb', line 226
def texequation(lines, id = nil, caption = '')
blank
puts "◆→開始:#{@titles['texequation']}←◆"
(id, caption) if caption_top?('equation')
if @book.config['math_format'] == 'imgmath'
fontsize = @book.config['imgmath_options']['fontsize'].to_f
lineheight = @book.config['imgmath_options']['lineheight'].to_f
math_str = "\\begin{equation*}\n\\fontsize{#{fontsize}}{#{lineheight}}\\selectfont\n#{lines.join("\n")}\n\\end{equation*}\n"
key = Digest::SHA256.hexdigest(math_str)
img_path = @img_math.defer_math_image(math_str, key)
puts "◆→math:#{File.basename(img_path)}←◆"
else
puts lines.join("\n")
end
(id, caption) unless caption_top?('equation')
puts "◆→終了:#{@titles['texequation']}←◆"
blank
end
|
247
248
249
250
251
252
253
254
255
|
# File 'lib/review/topbuilder.rb', line 247
def (id, caption)
if id
if get_chap
puts "#{I18n.t('equation')}#{I18n.t('format_number', [get_chap, @chapter.equation(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
else
puts "#{I18n.t('equation')}#{I18n.t('format_number_without_chapter', [@chapter.equation(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
end
end
end
|
265
266
267
|
# File 'lib/review/topbuilder.rb', line 265
def th(str)
"★#{str}☆"
end
|