[NTG-context] No escape to TeX for inline typing?

Wolfgang Schuster schuster.wolfgang at gmail.com
Tue Feb 17 16:30:13 CET 2015


> Am 17.02.2015 um 16:04 schrieb Christoph Reller <christoph.reller at gmail.com>:
> 
> Hi,
> 
> How do I escape to TeX from inside an inline typing command? It works fine from a typing environment.
> 
> MWE:
> 
> \setuptyping[TEX][escape={[[,]]}]
> \definetype[typeTEX][option=TEX]
> \starttext
> \startTEX
>   \I\can [[\em escape]]
> \stopTEX
> \typeTEX{\I\cannot [[\em escape]]}
> \stoptext
> 
> Thank you for any feedback!

The \type command doesn’t support a escape function but it can be added an additional line in the code (buff-ver.miv):

\def\buff_verbatim_type_normal#1%
  {\buff_verbatim_initialize_type_two
   \dostarttaggedchained\t!verbatim\currenttype\??type
   \ctxcommand{typestring{
     data    = \!!bs\detokenize{#1}\!!es,
     tab     = "\typeparameter\c!tab",
     method  = "\typeparameter\c!option",
+    escape  = \!!bs\typeparameter\c!escape\!!es,
     nature  = "inline",
     compact = "\typeparameter\c!compact", % none | all | last (all needed in tabulate etc for manuals)
    }}%
   \dostoptagged
   \buff_verbatim_right_of_type
   \egroup}

To enable the function add „escape=yes” (or your own delimiters) to \definetype.

Wolfgang


More information about the ntg-context mailing list