ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* mp strings
@ 2020-04-10 12:12 Hans Hagen
  0 siblings, 0 replies; only message in thread
From: Hans Hagen @ 2020-04-10 12:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-10 12:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 12:12 mp strings Hans Hagen

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).