thanks! web2py create very good the pdf with the template.tex but without args in the pdf.
Its right that i have to create a class like this: class LaTeXTemplate(string.Template): delimiter = "%%" Or understand the markmin a special operator to insert the args? My template.tex is: \documentclass{article} \begin{document} The task is: $$args \end{document} Am Mittwoch, 7. Mai 2014 20:59:29 UTC+2 schrieb Massimo Di Pierro: > > > > On Wednesday, 7 May 2014 13:37:25 UTC-5, Peter Pan wrote: >> >> Hey Massimo, >> >> i follwo the link, read the manual and download your markmin-app, >> but i could not find the answer - sorry iam a beginner in web2py. >> >> Look, i have a grid with a Button "print" : >> >> grid = SQLFORM.grid(query, >> orderby=~db.task.modified_on,create=False,details=False,editable=False, >> lambda row: A('print',_href=(URL('print_task',args=row.id >> ),_class="btn")) >> > > You need this: > > def print_task(): > task = db.task(request.args(0,cast=int)) > from gluon.contrib.markmin.markmin2pdf import latex2pdf > template = open('yourtemplate.tex','r').read() # check path > latex = template % task # or something similar > pdf, warning, errors = latex2pdf(latex) > if errors: pass # log errors > response.headers['Content-Type'] = 'application/pdf' > return pdf > > >> >> and i have a template = "template.tex" >> >> >> But i do not know - how i connect the button "print" with the markmin and >> i do not know how i implement the "template.tex." >> >> can you help me? >> >> >> Am Dienstag, 6. Mai 2014 15:14:33 UTC+2 schrieb Massimo Di Pierro: >>> >>> Look into this file: >>> >>> >>> https://github.com/web2py/web2py/blob/master/gluon/contrib/markmin/markmin2pdf.py >>> >>> there is a function markmin2pdf that uses markmin2latex and then calls >>> pdflatex. Only a subset of markmin is supported. Formulas go in between >>> $$...$$ in markmin. >>> >>> Massimo >>> >>> >>> On Monday, 5 May 2014 14:29:34 UTC-5, Peter Pan wrote: >>>> >>>> Hey >>>> I' m a teacher and work with pdflatex. I think its a good idea to learn >>>> LaTeX with web2py. >>>> The Students create theire own reports with pdflatex. >>>> I do Not know how to implement a pdflatex-Template in web2py. I read the >>>> informations about markmin >>>> But i couldn' t find the answer. >>>> >>>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.