On 1/10/2026 3:45 AM, Jairo A. del Rio wrote:
Hi, list!

Is there an analogue to alltt in ConTeXt? https://ctan.org/pkg/alltt <https://ctan.org/pkg/alltt>

TLDR: It's an environment akin to \starttyping ... \stoptyping, but with backslash and curly braces as normal characters. Something like asciimode plus monospaced font.

I know there is /BTEX ... /ETEX, but for some special reason I cannot add them for my work case and I don't want to reinvent the wheel. Thank you in advance.

You can mess with an existing catcode regime (originally a mkii term, in luametatex / mkiv we made those into catcode tables) or make one yourself:

\starttext

\newcatcodetable \fuzzycatcodes

\startcatcodetable \fuzzycatcodes
    \catcode\tabasciicode         \spacecatcode
    \catcode\endoflineasciicode   \endoflinecatcode
    \catcode\formfeedasciicode    \endoflinecatcode
    \catcode\spaceasciicode       \spacecatcode
    \catcode\spaceasciicode       \othercatcode
    \catcode\endoffileasciicode   \ignorecatcode
    \catcode\circumflexasciicode  \othercatcode
    \catcode\underscoreasciicode  \othercatcode
    \catcode\ampersandasciicode   \othercatcode
    \catcode\tildeasciicode       \othercatcode
    \catcode\hashasciicode        \othercatcode
    \catcode\dollarasciicode      \othercatcode
    \catcode\commentasciicode     \othercatcode
    \catcode\lessthanasciicode    \othercatcode
    \catcode\morethanasciicode    \othercatcode
    \catcode\leftbraceasciicode   \begingroupcatcode
    \catcode\rightbraceasciicode  \endgroupcatcode
    \catcode\doublequoteasciicode \othercatcode
    \catcode\singlequoteasciicode \othercatcode
    \catcode\forwardslashasciicode\othercatcode
    \catcode\backslashasciicode   \escapecatcode
    \catcode\barasciicode         \othercatcode
\stopcatcodetable

\start \catcodetable\fuzzycatcodes \tttf \obeylines \obeyspaces
    there are various    demands    and  {\bf solutions}
and it all depends on the kind of input and
    expectations of those who do that input
\stop

\start \catcodetable\fuzzycatcodes \tttf \obeylines
    there are various    demands    and  {\bf solutions}
and it all depends on the kind of input and
    expectations of those  who  do  that   input
\stop

\stoptext


-----------------------------------------------------------------
                                          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 : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to