ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: mp strings
Date: Fri, 10 Apr 2020 14:12:04 +0200	[thread overview]
Message-ID: <9f8d07f1-c0e7-f04f-008f-1f42ba0f9fe5@xs4all.nl> (raw)

Hi,

The *next* lmtx upload (one of these days) will have a small extension 
to the mp library wrt strings. In order to be more " neutral the string 
can be bound by STX/EOT characters (enabled by default). In addition to 
that there is also an option to set the catcode regime. The combination 
of these permits passing and processing strings as-they-are. Just in 
case the Gerbens among us need it.

Hans

==================== example =====================

\startTEXpage

     \def\foo{x}

     \framed{\startMPcode
         interim catcoderegime := vrbcatcoderegime ;
         draw textext("stream $\string\foo$") withcolor "darkred" ;
     \stopMPcode}

     \framed{\startMPcode
         draw textext("stream $\foo$") withcolor "darkblue" ;
     \stopMPcode}

     \startlmtxmode

         % here the string starts with ascii code 2 (STX) and ends with
         % ascii code 3 (EOT) ... visibility depends on the editor and 

         % font used; these are normally not used and therefore nice
         % alternative string capsules 	

         \framed{\startMPcode
             interim catcoderegime := vrbcatcoderegime ;
             draw textext(\x02stream $\string\foo$\x03) withcolor "darkgreen" ;
         \stopMPcode}

         \framed{\startMPcode
             draw textext(\x02stream $\foo$\x03) withcolor "darkyellow" ;
         \stopMPcode}

     \stoplmtxmode

\stopTEXpage


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

                 reply	other threads:[~2020-04-10 12:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9f8d07f1-c0e7-f04f-008f-1f42ba0f9fe5@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --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).