From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62633 Path: news.gmane.org!not-for-mail From: "Kevin D. Robbins" Newsgroups: gmane.comp.tex.context Subject: Is it possible to pass unmarked paragraphs into Lua for processing Date: Thu, 14 Oct 2010 15:21:52 -0600 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1195457248==" X-Trace: dough.gmane.org 1287091336 29234 80.91.229.12 (14 Oct 2010 21:22:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Oct 2010 21:22:16 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 14 23:22:12 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P6VFa-00075G-GX for gctc-ntg-context-518@m.gmane.org; Thu, 14 Oct 2010 23:22:10 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A5448CA737; Thu, 14 Oct 2010 23:22:09 +0200 (CEST) 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 qoEn0WF6oKyb; Thu, 14 Oct 2010 23:22:06 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D722DCA72D; Thu, 14 Oct 2010 23:22:06 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 548D0CA72D for ; Thu, 14 Oct 2010 23:22:05 +0200 (CEST) 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 Y7Mx9wowOdTB for ; Thu, 14 Oct 2010 23:21:53 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id CA5B3CA620 for ; Thu, 14 Oct 2010 23:21:53 +0200 (CEST) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9ELLq3x009210 for ; Thu, 14 Oct 2010 23:21:53 +0200 Original-Received: by fxm2 with SMTP id 2so37341fxm.14 for ; Thu, 14 Oct 2010 14:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=A+ULtlsRDyhW01OLfRk/QE38NOokd8v/DlE3Obr8aXU=; b=viu7em7nV1HESyUTRK7Cl8WAszTyAOvHv8m32ZLqOfV7W5VcySejhMt112XEyT7HQN 0kdgNgnUXRoPn6Cd6MtbPa8vWsNizuLl6Sgk0hf6Vgs7xGtVdsTnJh+Lc0o6K1itCDMR GyrYc65aENtMQCUMkgKScwGv4ldj5ii74CXrI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HMsHgMu2LhSfCKM67sMDVGLcKmo8HPzor2njLFDbZ2zFg1XZCYJdwmoae6+cXB/XKj RMoXZhf9TbcwavK6NJN0beDRaJuVXZRawJsRvjYmY5sEmRj777pcmwk+SQ1J406+pB0R hapCDN0J0GaCVTPTle0jU3KKm/P7a3DCXE4c4= Original-Received: by 10.239.158.71 with SMTP id t7mr792851hbc.88.1287091312358; Thu, 14 Oct 2010 14:21:52 -0700 (PDT) Original-Received: by 10.239.132.195 with HTTP; Thu, 14 Oct 2010 14:21:52 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eDiJlQ7E - 4a8ebea39980 - 20101014 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:62633 Archived-At: --===============1195457248== Content-Type: multipart/alternative; boundary=001485f1a24677754404929a4c57 --001485f1a24677754404929a4c57 Content-Type: text/plain; charset=UTF-8 Hi all, I am wondering if and how it might be possible to catch all unmarked paragraphs in a TeX file and pass them into Lua. So, in the following example, each of the first three unmarked paragraphs would be passed to the Lua function "process_paragraph" for optional processing, but the fourth paragraph between \startmarkedparagraph...\stopmarkedparagraph would not be passed to "process_paragraph". I want the Lua function to be able to eat each of the first three unmarked paragraphs and optionally write some processed version back out to be typeset, but there should be the possibility that none of the paragraphs are typeset at all. In the latter case that no text is to be typeset at all, is there a way to prevent ConTeXt/LuaTeX from creating an empty PDF? \startluacode def process_paragragh (par) -- Some magic here... -- Maybe a context (processed_par) to typeset the processed paragraph... end \stopluacode \starttext Thus, I came to the conclusion that the designer of a new system must not only be the implementer and first large||scale user; the designer should also write the first user manual. \startitemize \item One \item Two \item Three \stopitemize The separation of any of these four components would have hurt \TeX\ significantly. If I had not participated fully in all these activities, literally hundreds of improvements would never have been made, because I would never have thought of them or perceived why they were important. But a system cannot be successful if it is too strongly influenced by a single person. Once the initial design is complete and fairly robust, the real test begins as people with many different viewpoints undertake their own experiments. \startmarkedparagraph Thus, I came to the conclusion that the designer of a new system must not only be the implementer and first large||scale user; the designer should also write the first user manual. \stopmarkedparagraph \stoptext Thanks, Kevin --001485f1a24677754404929a4c57 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all,

I am wondering if and how it might be possible to catch all = unmarked paragraphs in a TeX file and pass them into Lua. So, in the follow= ing example, each of the first three unmarked paragraphs would be passed to= the Lua function "process_paragraph" for optional processing, bu= t the fourth paragraph between \startmarkedparagraph...\stopmarkedparagraph= would not be passed to "process_paragraph".

I want the Lua function to be able to eat each of the first three unmar= ked paragraphs and optionally write some processed version back out to be t= ypeset, but there should be the possibility that none of the paragraphs are= typeset at all.

In the latter case that no text is to be typeset at all, is there a way= to prevent ConTeXt/LuaTeX from creating an empty PDF?

\startluacode=

def process_paragragh (par)
=C2=A0=C2=A0 -- Some magic here...=C2=A0=C2=A0 -- Maybe a context (processed_par) to typeset the processed = paragraph...
end

\stopluacode

\starttext

Thus, I came to the conclu= sion that the designer of a new
system must not only be the implementer = and first
large||scale user; the designer should also write the first user manual.
\startitemize
\item One
\item Two
\item Three
\= stopitemize

The separation of any of these four components would hav= e
hurt \TeX\ significantly. If I had not participated fully in
all th= ese activities, literally hundreds of improvements
would never have been made, because I would never have
thought of them o= r perceived why they were important.

But a system cannot be successf= ul if it is too strongly
influenced by a single person. Once the initial= design is
complete and fairly robust, the real test begins as people
with many dif= ferent viewpoints undertake their own
experiments.

\startmarkedp= aragraph
Thus, I came to the conclusion that the designer of a new
system must not only be the implementer and first
large||scale user; the designer should also write the first
user manual.
\stopmarkedparagraph

\stoptext

Thanks,
Kevin

--001485f1a24677754404929a4c57-- --===============1195457248== 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 ___________________________________________________________________________________ --===============1195457248==--