ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Blackboard bold
@ 2025-09-04  0:59 Kip Warner
  2025-09-04  2:35 ` [NTG-context] " Max Chernoff via ntg-context
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-04  0:59 UTC (permalink / raw)
  To: ntg-context


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

Hello ConTeXt list,

Is there any way to typeset the mathematical standard number set
characters, e.g. natural, real, integers, etc. in bold? I have read the
following:

   https://wiki.contextgarden.net/Mathematics/Fonts/Blackboard_bold

If I try \reals, I almost get what I'm looking for - except it is not
in bold. If I try {\bf \reals}, the \bf is ignored.

Yours truly,

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04  0:59 [NTG-context] Blackboard bold Kip Warner
@ 2025-09-04  2:35 ` Max Chernoff via ntg-context
  2025-09-04 16:04   ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Max Chernoff via ntg-context @ 2025-09-04  2:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Max Chernoff

Hi Kip,

On Wed, 2025-09-03 at 17:59 -0700, Kip Warner wrote:
> Is there any way to typeset the mathematical standard number set
> characters, e.g. natural, real, integers, etc. in bold? I have read the
> following:
>
>    https://wiki.contextgarden.net/Mathematics/Fonts/Blackboard_bold
>
> If I try \reals, I almost get what I'm looking for - except it is not
> in bold. If I try {\bf \reals}, the \bf is ignored.

Just "{\bf R}" or "\bold{R}" should work, or if you add

    \setupmathematics[symbolset=blackboard-to-bold]

to the start of your document, then "\reals" and "\naturalnumbers"
should be in bold automatically.

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04  2:35 ` [NTG-context] " Max Chernoff via ntg-context
@ 2025-09-04 16:04   ` Kip Warner
  2025-09-04 16:13     ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-04 16:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Wed, 2025-09-03 at 20:35 -0600, Max Chernoff wrote:
> Just "{\bf R}" or "\bold{R}" should work, or if you add
> 
>     \setupmathematics[symbolset=blackboard-to-bold]
> 
> to the start of your document, then "\reals" and "\naturalnumbers"
> should be in bold automatically.

Hey Max,

Unfortunately neither of those work. I can generate a bold R, per
above. But that's not quite the same symbol as the standard number set
for real numbers (note the double vertical line). I'm trying to typeset
a bold version of it.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04 16:04   ` Kip Warner
@ 2025-09-04 16:13     ` Wolfgang Schuster
  2025-09-04 18:35       ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2025-09-04 16:13 UTC (permalink / raw)
  To: ntg-context

Am 04.09.2025 um 18:04 schrieb Kip Warner:
> On Wed, 2025-09-03 at 20:35 -0600, Max Chernoff wrote:
>> Just "{\bf R}" or "\bold{R}" should work, or if you add
>>
>>      \setupmathematics[symbolset=blackboard-to-bold]
>>
>> to the start of your document, then "\reals" and "\naturalnumbers"
>> should be in bold automatically.
> 
> Hey Max,
> 
> Unfortunately neither of those work. I can generate a bold R, per
> above. But that's not quite the same symbol as the standard number set
> for real numbers (note the double vertical line). I'm trying to typeset
> a bold version of it.

\starttext

\doloopoverlist
   {bonum,cambria,concrete,dejavu,ebgaramond,erewhon,kpfonts,
    libertinus,lucida,modern,pagella,schola,stixtwo,termes,xcharter}
   {\switchtobodyfont[\recursestring]
    \recursestring: \im{\reals \mb \reals}\par}

\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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04 16:13     ` Wolfgang Schuster
@ 2025-09-04 18:35       ` Kip Warner
  2025-09-04 18:49         ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-04 18:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, 2025-09-04 at 18:13 +0200, Wolfgang Schuster wrote:
> \starttext
> 
> \doloopoverlist
>    {bonum,cambria,concrete,dejavu,ebgaramond,erewhon,kpfonts,
>     libertinus,lucida,modern,pagella,schola,stixtwo,termes,xcharter}
>    {\switchtobodyfont[\recursestring]
>     \recursestring: \im{\reals \mb \reals}\par}
> 
> \stoptext

Thanks Wolfgang. That's quite long though. I managed to reduce it to:

   \im{\mb \reals}

This does work, but I'm trying to understand what \im and \mb do here,
neither of which appear to be documented:

   https://wiki.contextgarden.net/Command/im
   
   https://wiki.contextgarden.net/Command/mb

I have quite a few locations where I need a bold \reals, among other
standard sets in bold. Is there a way of creating a short macro for a
\boldreals?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04 18:35       ` Kip Warner
@ 2025-09-04 18:49         ` Wolfgang Schuster
  2025-09-04 18:54           ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2025-09-04 18:49 UTC (permalink / raw)
  To: Kip Warner, mailing list for ConTeXt users

Am 04.09.2025 um 20:35 schrieb Kip Warner:
> On Thu, 2025-09-04 at 18:13 +0200, Wolfgang Schuster wrote:
>> \starttext
>>
>> \doloopoverlist
>>     {bonum,cambria,concrete,dejavu,ebgaramond,erewhon,kpfonts,
>>      libertinus,lucida,modern,pagella,schola,stixtwo,termes,xcharter}
>>     {\switchtobodyfont[\recursestring]
>>      \recursestring: \im{\reals \mb \reals}\par}
>>
>> \stoptext
> 
> Thanks Wolfgang. That's quite long though. I managed to reduce it to:
> 
>     \im{\mb \reals}
> 
> This does work, but I'm trying to understand what \im and \mb do here,
> neither of which appear to be documented:
> 
>     https://wiki.contextgarden.net/Command/im


The two commands \im and \dm can be used two force either textstyle or 
displaystyle for math content.

\starttext

text \im{\frac{2}{3}} text \dm{\frac{2}{3}} text

\stoptext


>     https://wiki.contextgarden.net/Command/mb

With \mb you switch to the bold math font, don't confuse it with bold 
symbols because the bold font can have its own bold style. Be aware even 
when a math font has a bold variant it sometimes lacks bold styles.

\starttext

normal: \im{a \bf b}

bold: \im{\mb a \bf b}

\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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04 18:49         ` Wolfgang Schuster
@ 2025-09-04 18:54           ` Kip Warner
  2025-09-04 19:02             ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-04 18:54 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


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

On Thu, 2025-09-04 at 20:49 +0200, Wolfgang Schuster wrote:
> The two commands \im and \dm can be used two force either textstyle
> or displaystyle for math content.
> 
> \starttext
> 
> text \im{\frac{2}{3}} text \dm{\frac{2}{3}} text
> 
> \stoptext
> 
> 
> >     https://wiki.contextgarden.net/Command/mb
> 
> With \mb you switch to the bold math font, don't confuse it with bold
> symbols because the bold font can have its own bold style. Be aware
> even when a math font has a bold variant it sometimes lacks bold
> styles.
> 
> \starttext
> 
> normal: \im{a \bf b}
> 
> bold: \im{\mb a \bf b}
> 
> \stoptext

I see. Is there a way to define a \boldreals in terms of \im{\mb
\reals}? That seems like it would solve the problem.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04 18:54           ` Kip Warner
@ 2025-09-04 19:02             ` Kip Warner
  2025-09-06  0:21               ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-04 19:02 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


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

On Thu, 2025-09-04 at 11:54 -0700, Kip Warner wrote:
> I see. Is there a way to define a \boldreals in terms of \im{\mb
> \reals}? That seems like it would solve the problem.

I think I got it:

   \define\boldreals{\im{\mb \reals}}

Is that the best way of doing it?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-04 19:02             ` Kip Warner
@ 2025-09-06  0:21               ` Kip Warner
  2025-09-06  7:37                 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-06  0:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, 2025-09-04 at 12:02 -0700, Kip Warner wrote:
> I think I got it:
> 
>    \define\boldreals{\im{\mb \reals}}
> 
> Is that the best way of doing it?

It looks like this breaks if I override the serif font to a font which
doesn't appear to have a bold \reals character:

   \definefontfamily[main_font][serif][titilliumweb]
   \setupbodyfont[main_font]
   
   \define\boldreals{\im{\mb \reals}}
   
   \starttext
   \boldreals\ \reals
   \stoptext

When I use ConTeXt on Web, sometimes the first R is bold and sometimes
it is not if I re-generate the PDF. I don't know if I'm doing something
wrong or if this is a race condition.

Is there a way I tell ConTeXt to just use the \mb font whenever
typesetting \boldreals and not titilliumweb?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-06  0:21               ` Kip Warner
@ 2025-09-06  7:37                 ` Hans Hagen via ntg-context
  2025-09-08  0:43                   ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Hans Hagen via ntg-context @ 2025-09-06  7:37 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 9/6/2025 2:21 AM, Kip Warner wrote:

> It looks like this breaks if I override the serif font to a font which
> doesn't appear to have a bold \reals character:

Symbols like \reals are coming from a math font and since luatex we also 
handle them (as an escape) in text mode (instead or erroring). If no 
proper math font is loaded you don't get them. And as already explained 
one has to explicitly switch to a bold math font in your case.

Now, if you don't know the dirty internal details, here is an approach
that does some checking.

\starttext

\starttexdefinition protected myreals
     \ifmmode
         \reals
     \orelse\iffontchar\font\mathcharslot\reals
         \char\mathcharslot\reals
     \else
         \im{\reals}
     \fi
\stoptexdefinition

\starttexdefinition protected myboldreals
     {
         \ifmmode
             \mb\reals
         \else
             \bf
             \iffontchar\font\mathcharslot\reals
               \char\mathcharslot\reals
             \else
               \egroup
               \im{\mb\reals}
               \bgroup
             \fi
         \fi
     }
\stoptexdefinition

\myreals {\myboldreals}

\im {\myreals {\myboldreals}}

\stoptext

Alternatively you could use symbols and getglyph etc and get auto 
adaptation to style then.

Now, if you really want to go dirty ... you can define a math symbol 
that takes from the bold family:

\Umathchardef\boldreals
    \mathcharclass\reals
    \plusthree % \c_font_fam_mb
    \mathcharslot\reals

Here we preserve some properties like class. Of course this assumes that 
we never change the math machinery (in this case unlikely as we're 
talking of normal versus bold math but it's not in the official mathb 
manual until Mikael agrees on this).

\reals \boldreals

This seems to work ok here. It all depends on use cases.

Hans

-----------------------------------------------------------------
                                           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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-06  7:37                 ` Hans Hagen via ntg-context
@ 2025-09-08  0:43                   ` Kip Warner
  2025-09-08  3:18                     ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-08  0:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Sat, 2025-09-06 at 09:37 +0200, Hans Hagen wrote:


Hello Hans,

> Symbols like \reals are coming from a math font and since luatex we
> also handle them (as an escape) in text mode (instead or erroring).
> If no proper math font is loaded you don't get them. And as already
> explained one has to explicitly switch to a bold math font in your
> case.

I did try that already, explicitly switching to a bold math font, but
wasn't able to get it to work.

> 
> Now, if you don't know the dirty internal details, here is an
> approach
> that does some checking.
> 
> \starttext
> 
> \starttexdefinition protected myreals
>      \ifmmode
>          \reals
>      \orelse\iffontchar\font\mathcharslot\reals
>          \char\mathcharslot\reals
>      \else
>          \im{\reals}
>      \fi
> \stoptexdefinition
> 
> \starttexdefinition protected myboldreals
>      {
>          \ifmmode
>              \mb\reals
>          \else
>              \bf
>              \iffontchar\font\mathcharslot\reals
>                \char\mathcharslot\reals
>              \else
>                \egroup
>                \im{\mb\reals}
>                \bgroup
>              \fi
>          \fi
>      }
> \stoptexdefinition
> 
> \myreals {\myboldreals}
> 
> \im {\myreals {\myboldreals}}
> 
> \stoptext
> 
> Alternatively you could use symbols and getglyph etc and get auto 
> adaptation to style then.
> 
> Now, if you really want to go dirty ... you can define a math symbol 
> that takes from the bold family:
> 
> \Umathchardef\boldreals
>     \mathcharclass\reals
>     \plusthree % \c_font_fam_mb
>     \mathcharslot\reals
> 
> Here we preserve some properties like class. Of course this assumes
> that 
> we never change the math machinery (in this case unlikely as we're 
> talking of normal versus bold math but it's not in the official mathb
> manual until Mikael agrees on this).
> 
> \reals \boldreals
> 
> This seems to work ok here. It all depends on use cases.

I appreciate your help, but unfortunately that's all quite convoluted
for me, given the current state of the documentation and trying to
understand what your code does. I'm just trying to typeset a single
bold character for a standard mathematical set.

The following is a minimal that demonstrates my problem. If I comment
out any of the first three lines, the first R is bold as expected. If I
leave all of the first three uncommented, both Rs are not bold:

   \setupbodyfont[11pt]
   \definefontfamily[main_font][serif][titilliumweb]
   \setupbodyfont[main_font]
   
   \define\boldnaturalnumbers{\im{\mb \naturalnumbers}}
   \define\boldintegers{\im{\mb \integers}}
   \define\boldrationals{\im{\mb \rationals}}
   \define\boldreals{\im{\mb \reals}}
   \define\boldcomplexes{\im{\mb \complexes}}
   \define\boldprimes{\im{\mb \primes}}
   
   \starttext
   \boldreals\ \reals
   \stoptext

The reason why I have the first three lines in the minimal is because
my project relies on them in my environment file in order to ensure the
rest of the document is typeset in the correct typeface.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-08  0:43                   ` Kip Warner
@ 2025-09-08  3:18                     ` Wolfgang Schuster
  2025-09-08  3:29                       ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2025-09-08  3:18 UTC (permalink / raw)
  To: ntg-context

Am 08.09.2025 um 02:43 schrieb Kip Warner:
> On Sat, 2025-09-06 at 09:37 +0200, Hans Hagen wrote:
> 
> 
> Hello Hans,
> 
>> Symbols like \reals are coming from a math font and since luatex we
>> also handle them (as an escape) in text mode (instead or erroring).
>> If no proper math font is loaded you don't get them. And as already
>> explained one has to explicitly switch to a bold math font in your
>> case.
> 
> I did try that already, explicitly switching to a bold math font, but
> wasn't able to get it to work.
> 
>>
>> Now, if you don't know the dirty internal details, here is an
>> approach
>> that does some checking.
>>
>> \starttext
>>
>> \starttexdefinition protected myreals
>>       \ifmmode
>>           \reals
>>       \orelse\iffontchar\font\mathcharslot\reals
>>           \char\mathcharslot\reals
>>       \else
>>           \im{\reals}
>>       \fi
>> \stoptexdefinition
>>
>> \starttexdefinition protected myboldreals
>>       {
>>           \ifmmode
>>               \mb\reals
>>           \else
>>               \bf
>>               \iffontchar\font\mathcharslot\reals
>>                 \char\mathcharslot\reals
>>               \else
>>                 \egroup
>>                 \im{\mb\reals}
>>                 \bgroup
>>               \fi
>>           \fi
>>       }
>> \stoptexdefinition
>>
>> \myreals {\myboldreals}
>>
>> \im {\myreals {\myboldreals}}
>>
>> \stoptext
>>
>> Alternatively you could use symbols and getglyph etc and get auto
>> adaptation to style then.
>>
>> Now, if you really want to go dirty ... you can define a math symbol
>> that takes from the bold family:
>>
>> \Umathchardef\boldreals
>>      \mathcharclass\reals
>>      \plusthree % \c_font_fam_mb
>>      \mathcharslot\reals
>>
>> Here we preserve some properties like class. Of course this assumes
>> that
>> we never change the math machinery (in this case unlikely as we're
>> talking of normal versus bold math but it's not in the official mathb
>> manual until Mikael agrees on this).
>>
>> \reals \boldreals
>>
>> This seems to work ok here. It all depends on use cases.
> 
> I appreciate your help, but unfortunately that's all quite convoluted
> for me, given the current state of the documentation and trying to
> understand what your code does. I'm just trying to typeset a single
> bold character for a standard mathematical set.
> 
> The following is a minimal that demonstrates my problem. If I comment
> out any of the first three lines, the first R is bold as expected. If I
> leave all of the first three uncommented, both Rs are not bold:
> 
>     \setupbodyfont[11pt]
>     \definefontfamily[main_font][serif][titilliumweb]

Add a math font:

\definetypeface[main_font][mm][math][modern]

Wolfgang

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-08  3:18                     ` Wolfgang Schuster
@ 2025-09-08  3:29                       ` Kip Warner
  2025-09-08  3:44                         ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-08  3:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Mon, 2025-09-08 at 05:18 +0200, Wolfgang Schuster wrote:
> Add a math font:
> 
> \definetypeface[main_font][mm][math][modern]

Thanks Wolfgang. That seemed to work.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-08  3:29                       ` Kip Warner
@ 2025-09-08  3:44                         ` Kip Warner
  2025-09-08 14:23                           ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Kip Warner @ 2025-09-08  3:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Sun, 2025-09-07 at 20:29 -0700, Kip Warner wrote:
> On Mon, 2025-09-08 at 05:18 +0200, Wolfgang Schuster wrote:
> > Add a math font:
> > 
> > \definetypeface[main_font][mm][math][modern]
> 
> Thanks Wolfgang. That seemed to work.

Well - it does work. But it appears to also break something else in my
document. My chapter and section headers are now in a different
typeface.

I am not sure why or how, but if there's a command you'd like me to run
to generate debugging info on the typeface state when the chapter and
section headers are typeset, I can provide that.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-08  3:44                         ` Kip Warner
@ 2025-09-08 14:23                           ` Wolfgang Schuster
  2025-09-09  0:10                             ` Kip Warner
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2025-09-08 14:23 UTC (permalink / raw)
  To: Kip Warner, mailing list for ConTeXt users

Am 08.09.2025 um 05:44 schrieb Kip Warner:
> On Sun, 2025-09-07 at 20:29 -0700, Kip Warner wrote:
>> On Mon, 2025-09-08 at 05:18 +0200, Wolfgang Schuster wrote:
>>> Add a math font:
>>>
>>> \definetypeface[main_font][mm][math][modern]
>>
>> Thanks Wolfgang. That seemed to work.
> 
> Well - it does work. But it appears to also break something else in my
> document. My chapter and section headers are now in a different
> typeface.
> 
> I am not sure why or how, but if there's a command you'd like me to run
> to generate debugging info on the typeface state when the chapter and
> section headers are typeset, I can provide that.

Take a look at you chapter and section setups, do you set a specific 
font (\switchtobodyfont) or style (style=sans)?

Wolfgang

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Blackboard bold
  2025-09-08 14:23                           ` Wolfgang Schuster
@ 2025-09-09  0:10                             ` Kip Warner
  0 siblings, 0 replies; 16+ messages in thread
From: Kip Warner @ 2025-09-09  0:10 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


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

On Mon, 2025-09-08 at 16:23 +0200, Wolfgang Schuster wrote:
> Take a look at you chapter and section setups, do you set a specific 
> font (\switchtobodyfont) or style (style=sans)?

I have the following in my environment:

   \setupmargindata
     [inmargin]
     [style={\switchtobodyfont[6pt]\bi]},
      color=colour_text]

But if I comment that out, it doesn't fix the chapter and section
headers still being in a different typeface. That's the only instance
of \switchtobodyfont.

I also have some calls to \setuphead for chapter and section headings
that set style=, but not explicitly to sans:

   \setuphead
     [chapter]
     [command=\PlaceSection,
      color=colour_head,
      page=yes,
      before=,
      header=nomarking,
      style=\bfd]
   
   \setuphead
     [title]
     [command=\PlaceSection,
      color=colour_head,
      page=right,
      before=,
      header=nomarking,
      style=\bfd]
   
   \setuphead
     [section]
     [command=\PlaceSection,
      color=colour_head,
      inbetween=,
      style=\bfb]
   
   \setuphead
     [subsection]
     [command=\PlaceSection,
      color=colour_head,
      before=\crlf,
      style=\bfa]
   
   \setuphead
     [subsubsection]
     [command=\PlaceSection,
      color=colour_head,
      before=\blank,
      style=\bsa]
   
   \define[2]\PlaceSection
     {\goodbreak
      \vbox
        {\localheadsetup
         \begstrut
         \inleftmargin{\hbox to \leftmarginwidth{\hss#1\hss}}%
         #2}}

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2025-09-09  0:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04  0:59 [NTG-context] Blackboard bold Kip Warner
2025-09-04  2:35 ` [NTG-context] " Max Chernoff via ntg-context
2025-09-04 16:04   ` Kip Warner
2025-09-04 16:13     ` Wolfgang Schuster
2025-09-04 18:35       ` Kip Warner
2025-09-04 18:49         ` Wolfgang Schuster
2025-09-04 18:54           ` Kip Warner
2025-09-04 19:02             ` Kip Warner
2025-09-06  0:21               ` Kip Warner
2025-09-06  7:37                 ` Hans Hagen via ntg-context
2025-09-08  0:43                   ` Kip Warner
2025-09-08  3:18                     ` Wolfgang Schuster
2025-09-08  3:29                       ` Kip Warner
2025-09-08  3:44                         ` Kip Warner
2025-09-08 14:23                           ` Wolfgang Schuster
2025-09-09  0:10                             ` Kip Warner

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