What is the easiest way, if possible, to highlight some sections of verbatim text? given: \starttyping one two three four five six seven eight nine \stoptyping i'd like to color the word 'five' in red, or italic. .Floris
On 4/26/2021 10:25 AM, Floris van Manen wrote:
What is the easiest way, if possible, to highlight some sections of verbatim text?
given:
\starttyping one two three four five six seven eight nine \stoptyping
i'd like to color the word 'five' in red, or italic.
\starttext \starttyping[escape=/] one two three four /btex/bgroup/red five /egroup/etex six seven eight nine \stoptyping \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 -----------------------------------------------------------------
On 26/04/2021 10:59, Hans Hagen wrote:
\starttext \starttyping[escape=/] one two three four /btex/bgroup/red five /egroup/etex six seven eight nine \stoptyping \stoptext
That works indeed! Thanks. Are there restriction on what context commands can be given inside the bgroup? e.g. I tried to include a highlight definition with white font on black background with an inframed, but that doesn't seem to work (in my definitions that is)
Aparently all spaces after @etex get reduced to one only. I'd expect that to happen inside @btex and @etex \starttext \starttyping[escape=@] 1 137 26 25 > 1 69 32 2 @btex@bgroup@red@bf 137 @egroup@etex 26 25 > 1 69 32 3 @btex@bgroup@red@bf 137 @egroup@etex 26 25 > 1 69 32 4 137 26 25 > 1 69 32 5 @btex@bgroup@red@bf 137 @egroup@etex 26 25 > 1 69 32 \stoptyping \stoptext
On 4/26/2021 12:23 PM, Floris van Manen wrote:
\starttext \starttyping[escape=@] 1 137 26 25 > 1 69 32 2 @btex@bgroup@red@bf 137 @egroup@etex 26 25 > 1 69 32 3 @btex@bgroup@red@bf 137 @egroup@etex 26 25 > 1 69 32 4 137 26 25 > 1 69 32 5 @btex@bgroup@red@bf 137 @egroup@etex 26 25 > 1 69 32 \stoptyping \stoptext
\starttext \def\MyRed[#1]{{\red#1}} \starttyping[escape=@] 1 137 26 25 > 1 69 32 2 @btex@bgroup@red@bf 137 @egroup@etex@space 26 25 > 1 69 32 2 @MyRed[137] 26 25 > 1 69 32 3 137 26 25 > 1 69 32 \stoptyping \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 -----------------------------------------------------------------
participants (2)
-
Floris van Manen
-
Hans Hagen