Yves Cloutier schrieb am 15.03.2020 um 16:09:
Hello Wolfgang, after a few attempts that didn't work I copy-pasted the example from the wiki:
\definetyping[C][option=commands] \startC #include
int main(){ return 0; /BTEX{\em unreachedCode;}/ETEX } \stopC This did not work.
However following the example you provided this works perfectly! Many thanks.
When your goal is to format C or C++ code you can load the scite module
which provides support for additional languages.
The \setuptyping line is necessary because the module selects the wrong
formatter for C++ but this should be fixed in the next ConTeXt release
and you can remove it when you make a update to the newest version.
\usemodule[scite]
\setuptyping[CPP][option=cpp]
\starttext
\startCPP
#include