ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Inline framed verbatim text
@ 2023-05-19 12:22 Jeroen via ntg-context
  2023-05-19 13:09 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Jeroen via ntg-context @ 2023-05-19 12:22 UTC (permalink / raw)
  To: ntg-context; +Cc: Jeroen


[-- Attachment #1.1: Type: text/plain, Size: 583 bytes --]

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.

Thanks
Jeroen

[-- Attachment #1.2: Type: text/html, Size: 800 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NTG-context] Inline framed verbatim text
  2023-05-19 12:22 [NTG-context] Inline framed verbatim text Jeroen via ntg-context
@ 2023-05-19 13:09 ` Wolfgang Schuster via ntg-context
  2023-05-19 14:06   ` Jeroen via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2023-05-19 13:09 UTC (permalink / raw)
  To: Jeroen via ntg-context; +Cc: Wolfgang Schuster

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NTG-context] Inline framed verbatim text
  2023-05-19 13:09 ` Wolfgang Schuster via ntg-context
@ 2023-05-19 14:06   ` Jeroen via ntg-context
  2023-05-19 15:29     ` Aditya Mahajan via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Jeroen via ntg-context @ 2023-05-19 14:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jeroen


[-- Attachment #1.1: Type: text/plain, Size: 1961 bytes --]

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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3023 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NTG-context] Inline framed verbatim text
  2023-05-19 14:06   ` Jeroen via ntg-context
@ 2023-05-19 15:29     ` Aditya Mahajan via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Aditya Mahajan via ntg-context @ 2023-05-19 15:29 UTC (permalink / raw)
  To: Jeroen via ntg-context; +Cc: Aditya Mahajan

On Fri, 19 May 2023, Jeroen via ntg-context wrote:

> 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?

\framed[loffset=0.2ex, roffset=0.2ex]{...}

Also see: https://wiki.contextgarden.net/Command/setupframed

Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-19 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 12:22 [NTG-context] Inline framed verbatim text Jeroen via ntg-context
2023-05-19 13:09 ` Wolfgang Schuster via ntg-context
2023-05-19 14:06   ` Jeroen via ntg-context
2023-05-19 15:29     ` Aditya Mahajan via ntg-context

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).