Many thanks. Is there a proper way to add some space (a couple of pt or em) to the left and the right of the text itself so the frame does not get so close to the text?

Op vr 19 mei 2023 om 14:10 schreef Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>:
Jeroen via ntg-context schrieb am 19.05.2023 um 14:22:
> In order to get some inline framed verbatim text, I have in the past
> always used the following:
>
> \starttext
>
> This is an
> \inframed
>   [frame=on,
>   corner=00,
> radius=2mm,offset=-1.5pt]
>   {\ttx \bf example}
>
> \stoptext
>
> Since this has come-up more and more often, I created the following:
>
> \define[1]\infr{
> \inframed
> [frame=on,
>   corner=00,
>   radius=2mm,offset=-1.5pt]{#1}}
>
> \starttext
>
> This is an \infr{example}
>
> \stoptext
>
> This works fine except that I cannot get the text in
> verbatim/teletype. I have tried style=mono and style={\ttx \bf} but
> nothing seems to work.

\framed has no style key, you have to use the foregroundstyle to change
font style, size etc.

To create your own \framed (or \inframed when you add location=low) you
can use the \defineframed command:

\defineframed
   [infr]
   [location=low,
    frame=on,
    corner=00,
    radius=2mm,
    %offset=-1.5pt,
    foregroundstyle=\tt\bfx]

\starttext

This is an \infr{example}

\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________