ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: catcode problems (mkiv)
Date: Fri, 14 Jan 2011 17:52:38 +0100	[thread overview]
Message-ID: <4D307F56.4070702@gmx.net> (raw)

Hi,

I have some problems with catcode handling in lua and tex. Source of the
problem is (aside from my limited knowledge) a XML based line of text
that can contain any printable character. From this source line I create
one modified text line for the tex side (named 'textext') and one
unmodified text line for the lua side (named 'luatext').
The tex side actually prints the text and the lua side is used to
create some bitmap based background graphics.

The XSLT output is something like this (saved in a *.tex file) ...

\ctxlua{myluacode.foo{

    luatext = [[Test |%_^~$#{}±©®¶°<>&     123]],
    textext = [[Test \textbar \%\_\textcircumflex \texttilde
\$\#\textbraceleft \textbraceright \textpm \copyright \registered
¶\textdegree <>\&     123]],

...
}}

Two problems still occur. The "%"-sign in (ctx)lua (text is ignored
afterwords) and the significant spaces in the tex part (which are eaten
up when printed). I tried it with a modified catcodetable, but no
success (ugly sideeffects). So my question is:

What is the best way to

1.   deal with the "%" character in ctxlua?
2.   print significant spaces?

My current 'solution' for 2. is writing to a tex buffer instead and then
using

\bgroup\obeyspaces\getbuffer[textext]\egroup

If I try to use \obeyspaces in combination with the lua variable
'textext' I can no longer access the variable, as the variable is
indexed by a tex macro (lets call it \FOO), which then is interpreted as

  whatever.["\FOO "].textext ).

No solution for 1. yet.


As always... any help welcome :-)


Peter

___________________________________________________________________________________
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:[~2011-01-14 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 16:52 Peter Rolf [this message]
2011-01-16  7:41 ` Taco Hoekwater
2011-01-16 21:17   ` Peter Rolf
2011-01-16 15:32 ` Hans Hagen

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=4D307F56.4070702@gmx.net \
    --to=indiego@gmx.net \
    --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).