ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
To: Jeroen via ntg-context <ntg-context@ntg.nl>
Cc: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Subject: Re: [NTG-context] Inline framed verbatim text
Date: Fri, 19 May 2023 15:09:38 +0200	[thread overview]
Message-ID: <38205034-5240-038c-67ab-27b95d975280@gmail.com> (raw)
In-Reply-To: <CAPtmdbN0RRBaVPz4oGe-eHbf3ML0eaLVE2T8Q6BRwj7PPhJfxA@mail.gmail.com>

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
___________________________________________________________________________________

  reply	other threads:[~2023-05-19 13:10 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 [this message]
2023-05-19 14:06   ` Jeroen via ntg-context
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=38205034-5240-038c-67ab-27b95d975280@gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@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).