Re: [NTG-context] run a ruby script and use the standard output ???
Renaud AUBIN wrote: Taco Hoekwater a écrit : And all you need now is the latest pdftex -) http://sarovar.org/project/showfiles.php?group_id=106release_id=752 Taco Is it normal that pdfetex.pool is no more built ? Yes. There is now only one executable, pdftex. It contains all code that was previously in pdfetex and the `bare' pdftex is gone. Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
\starttext \input "|ls" \stoptext leads to (/usr/share/texmf-tetex/tex/latex/tools/.tex File ignored) Runaway argument? ls" ! Paragraph ended before \next was complete. to be read again \par ??? Taco Hoekwater a crit: Hans Hagen wrote: piping: the latest versions of pdftex support this (i\ve forgotten the syntax, but taco who wrote the patch may remember) piping syntax: \input "|ruby ./myscript.rb \vartest X" the magic trick is the | symbol. With your current tex: \writ18{ruby ./myscript.rb \vartest X whatever.tex} \input whatever % or something using \openin ... Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Renaud AUBIN wrote: \starttext \input |ls \stoptext leads to (/usr/share/texmf-tetex/tex/latex/tools/.tex File ignored) Runaway argument? ls ! Paragraph ended before \next was complete. to be read again \par ??? The pipe symbol has to be non-active (\catcode`\|=12 ) Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Taco Hoekwater a crit: The pipe symbol has to be non-active (\catcode`\|=12 ) Taco \starttext \catcode`\|=12 \input "|ls -l" \stoptext ! I can't find file `"|ls -l"'. l.7 \input "|ls -l" ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Renaud AUBIN wrote: \starttext \catcode`\|=12 \input |ls -l \stoptext ! I can't find file `|ls -l'. And all you need now is the latest pdftex -) http://sarovar.org/project/showfiles.php?group_id=106release_id=752 Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Taco Hoekwater a écrit : And all you need now is the latest pdftex -) http://sarovar.org/project/showfiles.php?group_id=106release_id=752 Taco Thanks Yes, I finally realized that... ;) I'm now on my way to upgrade it... ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Taco Hoekwater a écrit : And all you need now is the latest pdftex -) http://sarovar.org/project/showfiles.php?group_id=106release_id=752 Taco Is it normal that pdfetex.pool is no more built ? ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Renaud AUBIN wrote: Hi all, Is it possible to run a ruby script from a context document during its processing (I already know how to do that using \write18 but there is maybe a better way...) then get the output of the script to display or use it into the document. It's a little bit hard to describe so I have a simple example: \starttext \def\vartest{3.124325234543523452435} \write18{ruby ./myscript.rb \vartest X} \stoptext with myscript.rb: temp = ARGV[0] puts \nX + (Math::sqrt(temp.to_f)).to_s + X\n I would store the result of puts into a variable usable within ConTeXt... piping: the latest versions of pdftex support this (i\ve forgotten the syntax, but taco who wrote the patch may remember) you can also let ruby write a definition to a file temp.tmp which you can read in however, luatex can do: \edef\SomeVar{\lua{tex.print(math.sqrt(3.124325234543523452435))} or \def\GimmeARoot#1{\lua{tex.print(math.sqrt(#1))} actually, this is one of the examples i use in prelim demos at user group meetings -) so, be a bit patient and it will come your way ... Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] run a ruby script and use the standard output ???
Hans Hagen wrote: piping: the latest versions of pdftex support this (i\ve forgotten the syntax, but taco who wrote the patch may remember) piping syntax: \input |ruby ./myscript.rb \vartest X the magic trick is the | symbol. With your current tex: \writ18{ruby ./myscript.rb \vartest X whatever.tex} \input whatever % or something using \openin ... Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context