From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/20576 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Peter_M=FCnster?= Newsgroups: gmane.comp.tex.context Subject: \stopbuffer in macro Date: Mon, 30 May 2005 21:51:36 +0200 (CEST) Message-ID: Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1117485187 16490 80.91.229.2 (30 May 2005 20:33:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 May 2005 20:33:07 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon May 30 22:33:06 2005 Return-path: 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 1DcqvP-0003PT-CS for gctc-ntg-context-518@m.gmane.org; Mon, 30 May 2005 22:31:51 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 37B42127B7; Mon, 30 May 2005 22:34:31 +0200 (CEST) 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 04251-01; Mon, 30 May 2005 22:34:30 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BD7DA127A9; Mon, 30 May 2005 22:30:34 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2B96C12795 for ; Mon, 30 May 2005 22:30:32 +0200 (CEST) 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 03911-06 for ; Mon, 30 May 2005 22:30:29 +0200 (CEST) Original-Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by ronja.ntg.nl (Postfix) with ESMTP id 1D563127F2 for ; Mon, 30 May 2005 21:53:21 +0200 (CEST) Original-Received: from gaston.free.fr (rennes-1-62-147-96-143.dial.proxad.net [62.147.96.143]) by postfix4-2.free.fr (Postfix) with ESMTP id 5BC2831DAAB for ; Mon, 30 May 2005 21:53:20 +0200 (CEST) Original-Received: by gaston.free.fr (Postfix, from userid 500) id 87B7813C04E; Mon, 30 May 2005 21:51:36 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by gaston.free.fr (Postfix) with ESMTP id 832B514810C for ; Mon, 30 May 2005 21:51:36 +0200 (CEST) X-X-Sender: peter@gaston.free.fr Original-To: ConTeXt list 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:20576 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:20576 Hello, how could I build some macros, that make usage of \startbuffer and \stopbuffer? Example: \def\startXXX[#1]{\doSomeMagicSetups{#1}% \startbuffer[...]} \def\stopXXX{\stopbuffer \doSomeSpecialWorkHere} And then: \startXXX[some options] some text \stopXXX TIA for any help! Cheers, Peter --------------------------------------------------- For those, who are interested, here in detail what I'm trying to do: I still like the LaTeX listings.sty package very much, but porting it to ConTeXt would be too much work for me. So why not using a wrapper? Somewhere in the PATH I put the file createListing.sh: #!/bin/bash echo '\documentclass{article}\usepackage{listings} \lstset{language=C++,tabsize=4}\pagestyle{empty} \begin{document}\begin{lstlisting}{}' >$1-lst-ltx.tex cat $1-lst.tmp >>$1-lst-ltx.tex echo '\end{lstlisting}\end{document}' >>$1-lst-ltx.tex latex $1-lst-ltx dvips -E -o $1-lst-ltx.eps $1-lst-ltx Then the ConTeXt-file: \starttext Here is a listing: \startbuffer[lst] #include int main(){ return 0; } \stopbuffer \immediate\write18{./createListing.sh \jobname}% \externalfigure[\jobname-lst-ltx][] And here we go on... \stoptext But this would be much better: \def\startLST[#1]{\dosomesetups{#1}\startbuffer[...]} \def\stopLST{\stopbuffer\immediate\write18{./createListing ...}% \externalfigure[...][...]} And then: \startLST[some options for \lstset{}] some code \stopLST -- http://pmrb.free.fr/contact/