ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Catcode tables
Date: Tue, 13 Jan 2009 17:18:02 +0100	[thread overview]
Message-ID: <EFF1B917-12DD-4CEF-BBDC-075ADA677AEE@gmail.com> (raw)
In-Reply-To: <496B0FB7.5040805@elvenkind.com>


Am 12.01.2009 um 10:39 schrieb Taco Hoekwater:

> The example text is flawed in itself: \newcatcodetable gives you an
> empty table, and \startcatcodetable upgrades that to 'initex' level
> itself. But initex *does not* set the catcodes of { and }. Nor
> does it set the catcode of $, & and %, so the catcode assignments
> that are needed are not there, and the ones that are there are
> superfluous.
>
>  \startcatcodetable \mycatcodetable
>    \catcode`\{ = 1
>    \catcode`\} = 2
>  \stopcatcodetable
>
> is enough.


No in a real macro, here is a problem I posted a long time ago where
I was now able to replace my low level catcodes changes with catcode
tables, I hope this will help other users if they have the same problem.

\unprotect

\newcatcodetable \diacatcodes

\startcatcodetable \diacatcodes
     \catcode`\^^M =  5
     \catcode`\    = 10
     \catcode`\\   =  0
     \catcode`\{   =  1
     \catcode`\}   =  2
     \catcode`\%   = 11
     \catcode`\!   = 11
     \catcode`\?   = 11
\stopcatcodetable

\def\????ax{@@@@ax}

\def\setupaxis
  {\pushcatcodetable
   \setcatcodetable\diacatcodes
   \dodoubleargument\dosetupaxis}

\def\dosetupaxis[#1][#2]%
  {\def\docommand##1{\getparameters[\????ax##1][#2]}%
   \popcatcodetable
   \processcommalist[#1]\docommand}

\setupaxis
  [\c!x,\c!y]
  [\c!format=%d]

\protect

\starttext
\getvalue{@@@@axxformat}
\stoptext

Wolfgang

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      reply	other threads:[~2009-01-13 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29 17:41 Wolfgang Schuster
2008-12-29 22:03 ` Aditya Mahajan
2008-12-29 23:19   ` Wolfgang Schuster
2009-01-11 19:59     ` Wolfgang Schuster
2009-01-12  9:39       ` Taco Hoekwater
2009-01-13 16:18         ` Wolfgang Schuster [this message]

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=EFF1B917-12DD-4CEF-BBDC-075ADA677AEE@gmail.com \
    --to=schuster.wolfgang@googlemail.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).