* [formatting verbatim text]
@ 2021-04-26 8:25 Floris van Manen
2021-04-26 8:59 ` Hans Hagen
0 siblings, 1 reply; 5+ messages in thread
From: Floris van Manen @ 2021-04-26 8:25 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [formatting verbatim text]
2021-04-26 8:25 [formatting verbatim text] Floris van Manen
@ 2021-04-26 8:59 ` Hans Hagen
2021-04-26 9:40 ` Floris van Manen
2021-04-26 10:23 ` Floris van Manen
0 siblings, 2 replies; 5+ messages in thread
From: Hans Hagen @ 2021-04-26 8:59 UTC (permalink / raw)
To: mailing list for ConTeXt users, Floris van Manen
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [formatting verbatim text]
2021-04-26 8:59 ` Hans Hagen
@ 2021-04-26 9:40 ` Floris van Manen
2021-04-26 10:23 ` Floris van Manen
1 sibling, 0 replies; 5+ messages in thread
From: Floris van Manen @ 2021-04-26 9:40 UTC (permalink / raw)
To: Hans Hagen, mailing list for ConTeXt users
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)
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [formatting verbatim text]
2021-04-26 8:59 ` Hans Hagen
2021-04-26 9:40 ` Floris van Manen
@ 2021-04-26 10:23 ` Floris van Manen
2021-04-26 11:41 ` Hans Hagen
1 sibling, 1 reply; 5+ messages in thread
From: Floris van Manen @ 2021-04-26 10:23 UTC (permalink / raw)
To: Hans Hagen, mailing list for ConTeXt users
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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [formatting verbatim text]
2021-04-26 10:23 ` Floris van Manen
@ 2021-04-26 11:41 ` Hans Hagen
0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2021-04-26 11:41 UTC (permalink / raw)
To: Floris van Manen, mailing list for ConTeXt users
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-26 11:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 8:25 [formatting verbatim text] Floris van Manen
2021-04-26 8:59 ` Hans Hagen
2021-04-26 9:40 ` Floris van Manen
2021-04-26 10:23 ` Floris van Manen
2021-04-26 11:41 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).