From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80961 Path: news.gmane.org!not-for-mail From: Xan Newsgroups: gmane.comp.tex.context Subject: Re: python embedded in ConTeXt Date: Mon, 25 Feb 2013 19:04:46 +0100 Message-ID: <512BA7BE.907@telefonica.net> References: <5128BA65.3020802@telefonica.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0174570607==" X-Trace: ger.gmane.org 1361815225 3071 80.91.229.3 (25 Feb 2013 18:00:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2013 18:00:25 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 25 19:00:49 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UA2M2-0000YE-56 for gctc-ntg-context-518@m.gmane.org; Mon, 25 Feb 2013 19:00:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 15EE1101E7; Mon, 25 Feb 2013 19:00:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qC02kO29G-uC; Mon, 25 Feb 2013 19:00:23 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 16380101E3; Mon, 25 Feb 2013 19:00:23 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1D37E101E3 for ; Mon, 25 Feb 2013 19:00:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pKC3GZh1o5RS for ; Mon, 25 Feb 2013 19:00:15 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 18BED101E2 for ; Mon, 25 Feb 2013 19:00:15 +0100 (CET) Original-Received: from telefonica.net (impaqm3.telefonica.net [213.4.138.19]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r1PI0BIx001211 for ; Mon, 25 Feb 2013 19:00:11 +0100 Original-Received: from IMPmailhost5.adm.correo ([10.20.102.126]) by IMPaqm3.telefonica.net with bizsmtp id 4bhE1l0022jdgqJ3Pi0AcT; Mon, 25 Feb 2013 19:00:10 +0100 Original-Received: from [172.26.0.5] ([80.30.58.50]) by IMPmailhost5.adm.correo with BIZ IMP id 4i091l00y151Eu81li0AYj; Mon, 25 Feb 2013 19:00:10 +0100 X-CMAE-Analysis: v=1.1 cv=KvjgWV6gpMkjKXdEOxC7Cz36qS0d90brCJOypFHpn2Y= c=1 sm=1 a=v6JIbie9kv0A:10 a=VY-2JVJxNB4A:10 a=oT3JjdVB5o9IKzef49VOJA==:17 a=MiNTnEJAAAAA:8 a=Oi69n97d7kFxep0BjKcA:9 a=PUjeQqilurYA:10 a=7TSkLEdhhVXuid4lPoAA:9 a=_W_S_7VecoQA:10 a=oT3JjdVB5o9IKzef49VOJA==:117 X-original-sender: publicitat@telefonica.net User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 In-Reply-To: <5128BA65.3020802@telefonica.net> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.4.138.19; country=ES; latitude=40.0000; longitude=-4.0000; http://maps.google.com/maps?q=40.0000,-4.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QJ4G0bt8 - c485077db36a - 20130225 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80961 Archived-At: This is a multi-part message in MIME format. --===============0174570607== Content-Type: multipart/alternative; boundary="------------050200020000010804050107" This is a multi-part message in MIME format. --------------050200020000010804050107 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Thank you very much, Henning and Aditya. It clear the actual programming in ConTeXt. Now I use mako templates for emulate this purpose, but it's an annoying thing having to do this "outside" ConTeXt documents.... Thanks, both. Xan. On Sat, 23 Feb 2013, Henning Hraban Ramm wrote: >/ Am 2013-02-23 um 13:47 schrieb Xan: />/ />>/ I just want to know if there is a equal thing like python.sty [1], />>/ sympytex [2] or sagetex [3] for embed python, sympy and sage into />>/ ConTeXt documents as there exist for latex. Yeah, I know I could write />>/ a script and run python externally to ConTeXt but this were easier to />>/ use. />/ />/ Have a look at Aditya's filter module, that can call arbitrary external commands. / Attached is a proof of concept implementation for sympy. All the three python packages that you mentioned include a corresponding python script that does a lot of book-keeping. So, getting the full functionality of all these packages will require adapting those python script to generate results in ConTeXt syntax rather than in LaTeX syntax. Aditya -------------- next part -------------- A non-text attachment was scrubbed... Name: sympy.tex Type: application/x-tex Size: 916 bytes Desc: URL: ------------------------------------------------------------------------ --------------050200020000010804050107 Content-Type: text/html; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Thank you very much, Henning and Aditya. It clear the actual programming in ConTeXt. Now I use mako templates for emulate this purpose, but it's an annoying thing having to do this "outside" ConTeXt documents....

Thanks, both.

Xan.
On Sat, 23 Feb 2013, Henning Hraban Ramm wrote:

> Am 2013-02-23 um 13:47 schrieb Xan:
>
>> I just want to know if there is a equal thing like python.sty [1], 
>> sympytex [2] or sagetex [3] for embed python, sympy and sage into 
>> ConTeXt documents as there exist for latex. Yeah, I know I could write 
>> a script and run python externally to ConTeXt but this were easier to 
>> use.
>
> Have a look at Aditya's filter module, that can call arbitrary external commands.

Attached is a proof of concept implementation for sympy. All the three 
python packages that you mentioned include a corresponding python script 
that does a lot of book-keeping. So, getting the full functionality of all 
these packages will require adapting those python script to generate 
results in ConTeXt syntax rather than in LaTeX syntax.

Aditya

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sympy.tex
Type: application/x-tex
Size: 916 bytes
Desc: 
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20130223/f57ddc6c/attachment.tex>

--------------050200020000010804050107-- --===============0174570607== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0174570607==--