ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jeroen via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Jeroen <contextntg@gmail.com>
Subject: Re: [NTG-context] Inline framed verbatim text
Date: Fri, 19 May 2023 15:06:39 +0100	[thread overview]
Message-ID: <CAPtmdbOcrjQhJwUz3OSmCzmP6ppWNL6S-GUaZ87hbrjUu9OoMw@mail.gmail.com> (raw)
In-Reply-To: <38205034-5240-038c-67ab-27b95d975280@gmail.com>


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

  reply	other threads:[~2023-05-19 14:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19 12:22 Jeroen via ntg-context
2023-05-19 13:09 ` Wolfgang Schuster via ntg-context
2023-05-19 14:06   ` Jeroen via ntg-context [this message]
2023-05-19 15:29     ` Aditya Mahajan via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPtmdbOcrjQhJwUz3OSmCzmP6ppWNL6S-GUaZ87hbrjUu9OoMw@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=contextntg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).