Method: ReVIEW::LATEXBuilder#imgtable

Defined in:
lib/review/latexbuilder.rb

#imgtable(lines, id, caption = nil, metric = nil) ⇒ Object



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
# File 'lib/review/latexbuilder.rb', line 900

def imgtable(lines, id, caption = nil, metric = nil)
  unless @chapter.image_bound?(id)
    warn "image not bound: #{id}", location: location
    image_dummy(id, caption, lines)
    return
  end

  captionstr = nil
  begin
    if caption.present?
      puts "\\begin{table}[h]%%#{id}"
      @doc_status[:caption] = true
      captionstr = macro('reviewimgtablecaption', compile_inline(caption))
      @doc_status[:caption] = nil
      if caption_top?('table')
        puts captionstr
      end
    end
    puts macro('label', table_label(id))
  rescue ReVIEW::KeyError
    app_error "no such table: #{id}"
  end
  imgtable_image(id, caption, metric)

  if caption.present?
    unless caption_top?('table')
      puts captionstr
    end
    puts '\end{table}'
  end
  blank
end