Re: [NTG-context] Anyone could help me with this error in filter module?
Am 28.07.2014 um 16:15 schrieb Xan dxpublica at telefonica.net: Hi, Any hint on that [https://github.com/adityam/filter/issues/17], please? Don’t use \doifmode{…}{…} etc. with buffers or environments which rely on a buffer because you disable the function to keep end of lines in the input. What you have to do in this case is to use the \startmode or \startnotmode commands. Wolfgang Thanks Wolfgang and Aditya. This behaviour of doifmode is not documented in the wiki. Can anyone could add it Xan ___ 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 ___
Re: [NTG-context] Anyone could help me with this error in filter module?
On 7/30/2014 10:27 AM, Xan wrote: Am 28.07.2014 um 16:15 schrieb Xan dxpublica at telefonica.net: Hi, Any hint on that [https://github.com/adityam/filter/issues/17], please? Don’t use \doifmode{…}{…} etc. with buffers or environments which rely on a buffer because you disable the function to keep end of lines in the input. What you have to do in this case is to use the \startmode or \startnotmode commands. Wolfgang Thanks Wolfgang and Aditya. This behaviour of doifmode is not documented in the wiki. Can anyone could add it it is unrelated to doifmode but a general tex property: if you pass arguments the catcodes are frozen \startmode[foo] \stopmode can be tried as alternative as that one doesn't pick up arguments - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
[NTG-context] Anyone could help me with this error in filter module?
Hi, Any hint on that [https://github.com/adityam/filter/issues/17], please? Thanks, ___ 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 ___
Re: [NTG-context] Anyone could help me with this error in filter module?
Am 28.07.2014 um 16:15 schrieb Xan dxpubl...@telefonica.net: Hi, Any hint on that [https://github.com/adityam/filter/issues/17], please? Don’t use \doifmode{…}{…} etc. with buffers or environments which rely on a buffer because you disable the function to keep end of lines in the input. What you have to do in this case is to use the \startmode or \startnotmode commands. \usemodule[filter] \defineexternalfilter [python] [filtercommand={python \externalfilterinputfile\space \externalfilteroutputfile},cache=force] \starttext \startmode[solucions] \starttextrule{Solucions} \startpython from sympy.solvers import solve from sympy import Symbol from sympy import Eq x = Symbol('x') print(solve(Eq(3*x + 2, 35), x)) \stoppython \stoptextrule \stopmode \stoptext Wolfgang ___ 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 ___
Re: [NTG-context] Anyone could help me with this error in filter module?
On Mon, 28 Jul 2014, Wolfgang Schuster wrote: Am 28.07.2014 um 16:15 schrieb Xan dxpubl...@telefonica.net: Hi, Any hint on that [https://github.com/adityam/filter/issues/17], please? Don’t use \doifmode{…}{…} etc. with buffers or environments which rely on a buffer because you disable the function to keep end of lines in the input. What you have to do in this case is to use the \startmode or \startnotmode commands. \usemodule[filter] \defineexternalfilter [python] [filtercommand={python \externalfilterinputfile\space \externalfilteroutputfile},cache=force] \starttext \startmode[solucions] \starttextrule{Solucions} \startpython \stoppython \stoptextrule \stopmode \stoptext Another option is (untested): \defineexternalfilter [python] [ filtercommand={...}, before={\starttextrule{Solutions}}, after={\stoptextrule}, ] \startmode[solutions] \setupexternalfilter[python][state=stop, read=no] \stopmode \starttext \startpython ... \stoppython \stoptext BTW, you can simplify your setup using: \startbuffer[sympy] from sympy.solvers import solve from sympy import Symbol from sympy import Eq x = Symbol('x') \stopbuffer \defineexternalfilter [python] [ filtercommand={...}, bufferbefore={sympy}, ] \starttext \startpython print(solve(Eq(3*x + 2, 35), x)) \stoppython \stoptext Aditya ___ 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 ___