from pylatex.numpy import Matrix from pylatex.utils import italic doc = Document() section = Section('Yaay the first section, it can even be ' + italic('italic')) section.append('Some regular text') math = Subsection('Math', data=[Math(data=['2*3', '=', 6])]) section.append(math) table = Table('rc|cl') table.add_hline() table.add_row((1, 2, 3, 4)) table.add_hline(1, 2) table.add_empty_row() table.add_row((4, 5, 6, 7)) table = Subsection('Table of something', data=[table]) section.append(table) a = np.array([[100, 10, 20]]).T M = np.matrix([[2, 3, 4], [0, 0, 1], [0, 0, 2]]) math = Math(data=[Matrix(M), Matrix(a), '=', Matrix(M*a)]) print(math.dumps()) equation = Subsection('Matrix equation', data=[math]) print(equation.dumps())
table1.add_row((5, 6, 7, 8)) table1.add_hline() row_cells = ('9', MultiColumn(3, '|c|', 'Multicolumn not on left')) table1.add_row(row_cells) table1.add_hline() table2 = Table('|c|c|c|') table2.add_hline() table2.add_row((MultiRow(3, '*', 'Multirow'), 1, 2)) table2.add_hline(2, 3) table2.add_row(('', 3, 4)) table2.add_hline(2, 3) table2.add_row(('', 5, 6)) table2.add_hline() table2.add_row((MultiRow(3, '*', 'Multirow2'), '', '')) table2.add_empty_row() table2.add_empty_row() table2.add_hline() table3 = Table('|c|c|c|') table3.add_hline() table3.add_row((MultiColumn(2, '|c|', MultiRow(2, '*', 'multi-col-row')), 'X')) table3.add_row((MultiColumn(2, '|c|', ''), 'X')) table3.add_hline() table3.add_row(('X', 'X', 'X')) table3.add_hline() table4 = Table('|c|c|c|') table4.add_hline() col1_cell = MultiRow(4, '*', 'span-4') col2_cell = MultiRow(2, '*', 'span-2')
from pylatex.numpy import Matrix from pylatex.utils import italic doc = Document() section = Section('Yaay the first section, it can even be ' + italic('italic')) section.append('Some regular text') math = Subsection('Math that is incorrect', data=[Math(data=['2*3', '=', 9])]) section.append(math) table = Table('rc|cl') table.add_hline() table.add_row((1, 2, 3, 4)) table.add_hline(1, 2) table.add_empty_row() table.add_row((4, 5, 6, 7)) table = Subsection('Table of something', data=[table]) section.append(table) a = np.array([[100, 10, 20]]).T M = np.matrix([[2, 3, 4], [0, 0, 1], [0, 0, 2]]) math = Math(data=[Matrix(M), Matrix(a), '=', Matrix(M*a)]) equation = Subsection('Matrix equation', data=[math]) section.append(equation)