628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
|
# File 'lib/asciidoctor/latex/node_processors.rb', line 628
def tex_process
n_rows = self.rows.body.count
n_columns = self.columns.count
alignment = (['c']*n_columns).join('|')
output = "\\begin\{center\}\n"
output << "\\begin\{tabular\}\{|#{alignment}|\}\n"
output << "\\hline\n"
self.rows.body.each_with_index do |row, index|
row_array = []
row.each do |cell|
row_array << cell.content[0]
end
output << row_array.join(' & ')
output << " \\\\ \n"
end
output << "\\hline\n"
output << "\\end{tabular}\n"
output << "\\end{center}\n"
"#{output}"
end
|