Method: TexlabFile#tables

Defined in:
lib/texlab/texlabfile.rb

#tables(data, caption, opts = {}) ⇒ Object



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/texlab/texlabfile.rb', line 134

def tables data, caption, opts={}
  placement        = opts.delete(:placement) || "htbp"
  tableLandscape   = opts.delete(:landscape)
  tableFontSize    = opts.delete(:fontSize)  || @defaultTableFontSize
  tableLabel       = opts.delete(:label)     || ""
  tableCaption     = caption

  puts "\\begin{landscape}" if tableLandscape
  puts "\n\\begin{table}[#{placement}]\n\\begin{center}"
  puts "\\#{tableFontSize}" if tableFontSize
  
  puts data.map { |args|
    entries, caption, opts = *args
    "\\subtable[#{caption}]{#{plain_table(*args)}}"
  }.join("\\qquad")

  puts "\\caption{#{tableCaption}}\n" if tableCaption
  puts "\\label{tab:#{tableLabel}}" if tableLabel
  puts "\\end{center}\n\\end{table}\n"
  puts "\\end{landscape}" if @tableLandscape
end