ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Kevin D. Robbins" <robbins.kevin.d@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Is it possible to pass unmarked paragraphs into Lua for processing
Date: Thu, 14 Oct 2010 15:21:52 -0600	[thread overview]
Message-ID: <AANLkTinDyxbAqB9K6yeF12=9K9QU+v08aPg4aKyp0M58@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1962 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2174 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

             reply	other threads:[~2010-10-14 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 21:21 Kevin D. Robbins [this message]
2010-10-14 21:48 ` Aditya Mahajan
2010-10-15 21:36   ` Kevin D. Robbins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTinDyxbAqB9K6yeF12=9K9QU+v08aPg4aKyp0M58@mail.gmail.com' \
    --to=robbins.kevin.d@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).