From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24935 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: present for mojca Date: Wed, 04 Jan 2006 15:45:19 +0100 Message-ID: <43BBDF7F.5090302@wxs.nl> References: <6faad9f00601030018h35a6a95cj5bf3ce468e39f4eb@mail.gmail.com> <6faad9f00601031227k520f1c82k386b7c246e7031f1@mail.gmail.com> <43BAF5B1.1010703@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040701070702000706040003" X-Trace: sea.gmane.org 1136385969 18377 80.91.229.2 (4 Jan 2006 14:46:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2006 14:46:09 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 04 15:46:05 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eu9tL-00029Q-Fh for gctc-ntg-context-518@m.gmane.org; Wed, 04 Jan 2006 15:45:31 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AC704127EC; Wed, 4 Jan 2006 15:45:29 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06791-05; Wed, 4 Jan 2006 15:45:27 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D055112799; Wed, 4 Jan 2006 15:45:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1874812799 for ; Wed, 4 Jan 2006 15:45:25 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06623-07 for ; Wed, 4 Jan 2006 15:45:24 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id DD04F12792 for ; Wed, 4 Jan 2006 15:45:23 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 10231 for ; Wed, 04 Jan 2006 15:54:22 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: ntg-context@ntg.nl In-Reply-To: X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24935 Archived-At: This is a multi-part message in MIME format. --------------040701070702000706040003 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit see attached file for usage Hans --------------040701070702000706040003 Content-Type: text/x-tex; name="m-gnuplot.tex" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="m-gnuplot.tex" %D \module %D [ file=m-gnuplot, %D version=2006.01.04, %D title=\CONTEXT\ Extra Modules, %D subtitle=\GNUPLOT\ Inclusion, %D author=Hans Hagen, %D date=\currentdate, %D copyright=\PRAGMA] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. % todo: reuse (only if really needed) % \enablemode[demo] %D example: %D %D \starttyping %D texexec --pdf --mode=demo m-gnuplot %D \stoptyping \unprotect \ifx\operatingsystem\undefined \def\operatingsystem{unix} \fi % texexec will set that \newcounter\GNUPLOTnumber \def\startGNUPLOTinclusions {\bgroup \obeylines \dostartGNUPLOTinclusions} \def\dostartGNUPLOTinclusions#1\stopGNUPLOTinclusions {\gdef\GNUPLOTinclusions{#1}% \egroup} \def\startGNUPLOTgraphic#1% {\bgroup \obeylines \dostartGNUPLOTgraphic{#1}} \def\dostartGNUPLOTgraphic#1#2\stopGNUPLOTgraphic {\doglobal\increment\GNUPLOTnumber \letgvalue{gpg:n:#1}\GNUPLOTnumber \setgvalue{gpg:d:\GNUPLOTnumber}{#2}% \egroup} \def\useGNUPLOTgraphic {\dodoubleempty\douseGNUPLOTgraphic} \def\douseGNUPLOTgraphic[#1][#2]% {\iffirstargument \@EA\dodouseGNUPLOTgraphic % like \externalfigure[name][optional args] \else \@EA\redouseGNUPLOTgraphic % like \useMPgraphic{name} \fi[#1][#2]} \def\redouseGNUPLOTgraphic[#1][#2]#3% {\dodouseGNUPLOTgraphic[#3][]} \def\dodouseGNUPLOTgraphic[#1][#2]% {\bgroup \doifdefined{gpg:n:#1} {\edef\GNUPLOTnumber{\getvalue{gpg:n:#1}}% \bgroup % hm, gnuplot only seems to handle lf so we cannot use \mappartolineend % also, in order to prevent fuzzy runs (or no runs) we add a ; to each line \def\par{;\rawcharacter{10}}% \immediate\openout\scratchwrite=\bufferprefix gnuplot-\GNUPLOTnumber.gpd \immediate\write\scratchwrite{\GNUPLOTinclusions}% \immediate\write\scratchwrite{set output "\bufferprefix gnuplot-\GNUPLOTnumber.ps"}% \immediate\write\scratchwrite{\getvalue{gpg:d:\GNUPLOTnumber}}% \immediate\write\scratchwrite{end}% \immediate\closeout\scratchwrite \egroup \processGNUPLOTgraphic{\bufferprefix gnuplot-\GNUPLOTnumber}% \convertGNUPLOTgraphic{\bufferprefix gnuplot-\GNUPLOTnumber}% \externalfigure[\bufferprefix gnuplot-\GNUPLOTnumber.pdf][#2]}% \egroup} % we assume pdf inclusion, eps wil be implemented when applicable \def\processGNUPLOTgraphic#1% {\doifelse\operatingsystem{mswin} {\executesystemcommand{start pgnuplot #1.gpd}} % start is needed else gp fails {\executesystemcommand{gnuplot #1.gpd}}} \def\convertGNUPLOTgraphic#1% {\executesystemcommand{texmfstart newpstopdf #1.ps}} \protect \doifnotmode{demo}{\endinput} \starttext \startGNUPLOTinclusions set title "trigonometry" set terminal postscript \stopGNUPLOTinclusions \startGNUPLOTgraphic{sin} plot sin(x) \stopGNUPLOTgraphic \startGNUPLOTgraphic{cos} plot cos(x) \stopGNUPLOTgraphic \useGNUPLOTgraphic{sin} \useGNUPLOTgraphic{cos} \useGNUPLOTgraphic[cos] \useGNUPLOTgraphic[sin][height=3cm] \stoptext --------------040701070702000706040003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------040701070702000706040003--