On 7/28/2021 2:14 PM, Jeroen via ntg-context wrote:
Is there a way to have two different types of typing. I tried the
following, but it does not seem to work.
\setuptyping[abc][style=\ttx]
\setuptyping[def][style=\ttxx]
\starttext
\starttyping[abc]
text
text
\stoptyping
\starttyping[def]
text
text
\stoptyping
\stoptext
in lmtx we can do this
\definetyping[abc] \setuptyping[abc][style=\ttx]
\definetyping[def] \setuptyping[def][style=\ttxx]
\unprotect
\tolerant\def\buff_verbatim_typing_start_yes[#1]#*[#2]%
{\let\m_typing\currenttyping
\ifhastok={#1}%
\setupcurrenttyping[#1]%
\orelse\ifcstok{#1}\v!continue
\lettypingparameter\c!continue\v!yes
\orelse\iftok{#1}\emptytoks
% assume typing
\orelse\ifcstok{#1}\v!typing
% no overload
\else
\edef\currenttyping{#1}%
\fi
\ifparameter#2\or
\setupcurrenttyping[#2]%
\fi
\typingparameter\c!before\relax
\startpacked[\v!blank]%
\buff_verbatim_setup_line_numbering
\buff_verbatim_initialize_typing_one
\buff_verbatim_setup_keep_together
\normalexpanded{\buff_verbatim_type_block{\e!start\m_typing}{\e!stop\m_typing}}}
\protect
\starttext
\starttyping[abc][color=red]
[text]
text
\stoptyping
\starttyping[def][style=\sl]
text
text
\stoptyping
\startdef
text
text
\stopdef
\stoptext
but first i want wolfgangs opinion on this (possible side effects and such)
Hans
-----------------------------------------------------------------
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
___________________________________________________________________________________