You have to do it in two steps.
- step one you call markmin2latex and save the output in a file
(sample.tex)
- step two:
from gluon.contrib.markmin.markmin2pdf import latex2pdf
latex = open('sample.tex','rb')
latex2pdf(latex, pdflatex='pdflatex', passes=3)
and replace the ;pdflatex' with the command to run your pdflatex
instance. I do not know what that is.
Massimo
On Jul 27, 2:31 am, Martin Weissenboeck <[email protected]> wrote:
> 2011/7/26 Massimo Di Pierro <[email protected]>
>
> > It requires latex. Do you have pdflatex installed on windows?
>
> No. During the last hours I have tried to get a (small?) pdflatex package,
> but I have only found complete Latex packages (1GB and so on). Today I am
> at Crete/Greece and the data connection is very poor. Maybe I can install
> Portable Latex (download time about 4 hours...)
>
> > How do you run it from shell?
>
> I have copyied the markmin2xxx.py files to C:\Python27\Lib\site-packages and
> opened the IDE of Python 2.7. All the lines of my first email are responses
> of the IDE.
>
>
>
>
>
>
>
> > On Jul 26, 1:00 pm, Martin Weissenboeck <[email protected]> wrote:
> > > Hi,
>
> > > I wanted to learn more markmin.
> > > I have the examples from the documentation, markmin2html and
> > markmin2latex
> > > work fine:
>
> > > >>> from markmin2html import markmin2html as mh
> > > >>> m='hello **world**'
> > > >>> print mh(m)
>
> > > <p>hello <b>world</b></p>
>
> > > >>> from markmin2latex import markmin2latex as ml
> > > >>> print ml(m)
>
> > > \documentclass[12pt]{article}
> > > *... shortened...*
> > > \newpage
> > > hello {\bf world}
> > > \end{document}
>
> > > But markmin2pdf answered with an error
>
> > > >>> from markmin2pdf import markmin2pdf as mp
> > > >>> mp(m)
>
> > > Traceback (most recent call last):
> > > File "<pyshell#25>", line 1, in <module>
> > > mp(m)
> > > File "C:\Python27\lib\site-packages\markmin2pdf.py", line 93, in
> > > markmin2pdf
> > > return latex2pdf(markmin2latex(text,image_mapper=image_mapper,
> > > extra=extra))
> > > File "C:\Python27\lib\site-packages\markmin2pdf.py", line 74, in
> > latex2pdf
> > > stderr=subprocess.PIPE)
> > > File "C:\Python27\lib\subprocess.py", line 486, in call
> > > return Popen(*popenargs, **kwargs).wait()
> > > File "C:\Python27\lib\subprocess.py", line 672, in __init__
> > > errread, errwrite)
> > > File "C:\Python27\lib\subprocess.py", line 882, in _execute_child
> > > startupinfo)
> > > WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
> > > *(Means: System can't find the file)*
>
> > > Any hints?
> > > Regards, Martin