Im Folgenden können Sie einen Einblick in das bekommen, was ich versuche.
Code: Select all
from pylatex import Document, Section, Subsection, Tabular
from pylatex import Math, TikZ, Axis, Plot, Figure, Matrix, Alignat
from pylatex.utils import italic, bold
...
...
with doc.create(Subsection('Math Equations')):
doc.append('Attempt to create dynamic table i.e creating dynamic rows depending on the number of rows in Database, and displaying those values in PDF Table. \n \n')
with doc.create(Tabular('|p{3cm}|p{7cm}|p{3cm}|')) as table:
table.add_hline()
table.add_row((bold('ID'), bold('Equation'), bold('Result')))
table.add_hline()
table.add_row('1',Math(inline=False, data="\sum(a+b)", escape=None),'Result')
table.add_hline()
for x in range(0, 3):
table.add_row((bold(x), bold(x+1), bold(x+2)))
table.add_hline()

Erwartungen:

Ich habe auch „Pythontex“ ausprobiert Latex, wo das Erstellen von Gleichungen mit \sum_(a+b) für die Summierung einfach ist, das Erstellen dynamischer Tabellen jedoch schwierig oder unmöglich erscheint.
Ich freue mich auf Ihre Vorschläge.
